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
the player has 3 lives,
User prompt
increase the size of the bg asset I meant this. do
User prompt
put bg in full screen, 720p
User prompt
make it so that when you touch the screen, the pencil is thrown down.
User prompt
make the pencil move left and right
User prompt
It's a fucking position, do it now
User prompt
Add pencil
User prompt
Remove all code
User prompt
Remove all in scene
Initial prompt
Fruit pencil
/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 });
===================================================================
--- 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
Watermelon with eye and mouth animation. In-Game asset. 2d. High contrast. No shadows
Orange with eye and mouth animation. In-Game asset. 2d. High contrast. No shadows
Shop icon. In-Game asset. 2d. High contrast. No shadows
Coin icon. In-Game asset. 2d. High contrast. No shadows
Emoji_shocked. In-Game asset. 2d. High contrast. No shadows
Settings icon. In-Game asset. 2d. High contrast. No shadows