User prompt
The hand have to follow the mouse only right and left
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'x')' in this line: 'self.x = position.x;' Line Number: 4
User prompt
Fix Bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'move')' in this line: 'self.move = function (position) {' Line Number: 2
User prompt
the hand have to follow the mouse
User prompt
the hand have to be in front off the lake
User prompt
the hand dont move
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'var hand = self.addChild(new Hand());' Line Number: 29
User prompt
Add a moving hand at the botom off the screen moving to left to right
Initial prompt
Ricochet
var Hand = Container.expand(function () { var self = Container.call(this); var handGraphics = self.createAsset('hand', 'Moving hand at the bottom', 0.5, 0.5); self.x = 0; self.y = 2732 - handGraphics.height; self.direction = 1; self.speed = 2; self.move = function () {}; }); var Stone = Container.expand(function () { var self = Container.call(this); var stoneGraphics = self.createAsset('stone', 'Stone for ricochet', .5, .5); self.speed = 0; self.direction = 0; self.move = function () {}; self.ricochet = function () {}; }); var Lake = Container.expand(function () { var self = Container.call(this); var lakeGraphics = self.createAsset('lake', 'Lake for stone ricochet', .5, .5); self.checkRicochet = function (stone) {}; }); var Game = Container.expand(function () { var self = Container.call(this); var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); LK.stageContainer.setBackgroundColor(0x008080); var lake = self.addChild(new Lake()); lake.x = 2048 / 2; lake.y = 2732 / 2; var stone = self.addChild(new Stone()); stone.x = 2048 / 2; stone.y = 2732 / 2; var hand = self.addChild(new Hand()); var scoreTxt = new Text2('0', { size: 150, fill: "#ffffff" }); LK.gui.topCenter.addChild(scoreTxt); var isGameOver = false; var ricochets = 0; LK.on('tick', function () { hand.move(); stone.move(); if (lake.checkRicochet(stone)) { stone.ricochet(); ricochets++; LK.setScore(ricochets); scoreTxt.setText(ricochets); } if (isGameOver) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } }); stage.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); stone.x = pos.x; stone.y = pos.y; stone.speed = 5; stone.direction = Math.random() * Math.PI * 2; }); stage.on('up', function (obj) { stone.speed = 0; }); });
===================================================================
--- original.js
+++ change.js
@@ -21,9 +21,8 @@
self.checkRicochet = function (stone) {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
- var hand = self.addChild(new Hand());
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
@@ -33,8 +32,9 @@
lake.y = 2732 / 2;
var stone = self.addChild(new Stone());
stone.x = 2048 / 2;
stone.y = 2732 / 2;
+ var hand = self.addChild(new Hand());
var scoreTxt = new Text2('0', {
size: 150,
fill: "#ffffff"
});
A nice lake Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A hand Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A small stone Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A power bar Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A power bar Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A restart button Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.