Initial prompt
Fruit pencil
User prompt
Remove all in scene
User prompt
Remove all code
User prompt
Add pencil
User prompt
It's a fucking position, do it now
User prompt
make the pencil move left and right
User prompt
make it so that when you touch the screen, the pencil is thrown down.
User prompt
put bg in full screen, 720p
User prompt
increase the size of the bg asset I meant this. do
User prompt
the player has 3 lives,
User prompt
Please fix the bug: 'livesDisplay.setText is not a function' in or related to this line: 'livesDisplay.setText('Lives: ' + playerLives);' Line Number: 58
User prompt
Fix bug the pencil is being launched without having clicked on the screen
User prompt
make it so that if you make a mistake, another pencil is created, stops for 2 seconds, and moves back and forth
User prompt
make the next pencil not be released if you click on the screen on the previous pencil
User prompt
Please fix the bug: 'Uncaught TypeError: pencil.containsPoint is not a function' in or related to this line: 'if (pencil.containsPoint({' Line Number: 79
User prompt
the other pencils are being launched out of nowhere
User prompt
If you miss the target with your pencil, you lose.
User prompt
creates a random fruit in the middle of the screen (only one)
User prompt
the fruits are too small, make them 5x bigger
User prompt
If the fruit is hit, a bounce animation occurs and another random fruit is created. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'ReferenceError: tween is not defined' in or related to this line: 'tween(fruit, {' Line Number: 95 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
make the pencil also be destroyed after touching a fruit
User prompt
create another pencil after the previous one is released
User prompt
make the fruit is destroyed trigger only happens once per fruit destroyed
User prompt
when the pencil destroys one fruit, it destroys many, fix it
===================================================================
--- original.js
+++ change.js
@@ -1,106 +1,6 @@
-/****
-* Classes
-****/
-// Define a class for the Arrow
-var Arrow = Container.expand(function () {
- var self = Container.call(this);
- var arrowGraphics = self.attachAsset('arrow', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = -10;
- self.update = function () {
- self.y += self.speed;
- if (self.y < 0) {
- self.destroy();
- }
- };
-});
-//<Assets used in the game will automatically appear here>
-//<Write imports for supported plugins here>
-// Define a class for the Fruit
-var Fruit = Container.expand(function () {
- var self = Container.call(this);
- var fruitGraphics = self.attachAsset('fruit', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 3;
- self.update = function () {
- self.y += self.speed;
- if (self.y > 2732) {
- self.destroy();
- LK.showGameOver();
- }
- };
-});
-
-/****
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000 //Init game with black background
-});
-
-/****
-* Game Code
-****/
-var fruits = [];
-var arrows = [];
-// Function to clear all elements in the scene
-function clearScene() {
- // Destroy all fruits and clear the array
- for (var i = fruits.length - 1; i >= 0; i--) {
- fruits[i].destroy();
- }
- fruits = [];
- // Destroy all arrows and clear the array
- for (var i = arrows.length - 1; i >= 0; i--) {
- arrows[i].destroy();
- }
- arrows = [];
-}
-var score = 0;
-var scoreTxt = new Text2('0', {
- size: 150,
- fill: 0xFFFFFF
-});
-scoreTxt.anchor.set(0.5, 0);
-LK.gui.top.addChild(scoreTxt);
-function spawnFruit() {
- var fruit = new Fruit();
- fruit.x = Math.random() * 2048;
- fruit.y = 0;
- fruits.push(fruit);
- game.addChild(fruit);
-}
-function shootArrow(x, y) {
- var arrow = new Arrow();
- arrow.x = x;
- arrow.y = y;
- arrows.push(arrow);
- game.addChild(arrow);
-}
-game.down = function (x, y, obj) {
- shootArrow(x, y);
-};
-game.update = function () {
- if (LK.ticks % 60 == 0) {
- spawnFruit();
- }
- for (var i = arrows.length - 1; i >= 0; i--) {
- var arrow = arrows[i];
- for (var j = fruits.length - 1; j >= 0; j--) {
- var fruit = fruits[j];
- if (arrow.intersects(fruit)) {
- score += 1;
- scoreTxt.setText(score);
- fruit.destroy();
- fruits.splice(j, 1);
- arrow.destroy();
- arrows.splice(i, 1);
- break;
- }
- }
- }
-};
\ No newline at end of file
+ backgroundColor: 0x000000
+});
\ No newline at end of file
Pencil. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
picnic bg. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
heart icon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
mango fruit with eye and mouth animation.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Banana with eye and mouth animation.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
picnic bg in a night sky. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows