User prompt
add answer class that will show one out of two assets
User prompt
move yesorno 200 pixels dodwn
User prompt
move cat and box 300 pixels up
User prompt
move yesorno 500 pixels up
Code edit (1 edits merged)
Please save this source code
User prompt
use LK.getAsset for yesorno
User prompt
on tick show yesorno asset
User prompt
create a new class calle yesorno
User prompt
add a new class to show assets as messages in the game
Code edit (3 edits merged)
Please save this source code
User prompt
create a new asset named yesorno. the asset will spawn at game start 700 pixels on top of box.
Code edit (1 edits merged)
Please save this source code
User prompt
spawn new asset yesorno 500 pixes up from box
User prompt
On game start show yesorno in the top center of the acreen
User prompt
Add new yesorno asset on the top of the screen on game start
User prompt
Delete tedundant amchor
User prompt
Show bottom text
User prompt
Move bottom text 100 pixela below box
User prompt
Center bottom message
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'LK.gui.bottomCenter.addChild(bottomMessageTxt);' Line Number: 93
User prompt
Add a complete new message in the bottom of the secreen. It should not affect the current message on the game
User prompt
Show messagetxt on start in top
User prompt
Create var textmessage2 to show a differnt message
User prompt
On game start show top message too
User prompt
Create a new instance of meesage
===================================================================
--- original.js
+++ change.js
@@ -1,8 +1,13 @@
-var YesOrNo = Container.expand(function () {
+var Answer = Container.expand(function () {
var self = Container.call(this);
- var yesOrNoGraphics = LK.getAsset('yesorno', 'YesOrNo Graphics', 0.5, 0.5);
- self.addChild(yesOrNoGraphics);
+ var answerGraphics;
+ if (Math.random() < 0.5) {
+ answerGraphics = self.createAsset('yes', 'Yes Graphics', 0.5, 0.5);
+ } else {
+ answerGraphics = self.createAsset('no', 'No Graphics', 0.5, 0.5);
+ }
+ self.addChild(answerGraphics);
});
var Box = Container.expand(function () {
var self = Container.call(this);
var boxGraphics = self.createAsset('box', 'Box Graphics', .5, .5);
@@ -47,11 +52,11 @@
box.x = 2048 / 2;
box.y = 2732 / 2 + 500 - 300;
kitty.x = 2048 / 2;
kitty.y = 2732 / 2 + 500 - 300;
- var yesOrNo = self.addChild(new YesOrNo());
- yesOrNo.x = 2048 / 2;
- yesOrNo.y = box.y - 1000;
+ var answer = self.addChild(new Answer());
+ answer.x = 2048 / 2;
+ answer.y = box.y - 700;
var start;
var end;
self.on('down', function (obj) {
start = obj.event.getLocalPosition(self);
8-bit. cartoon. red button. do not touch! Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8-bit. cartoon. black tub stopper with chain. in game asset.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8-bit. cartoon. axe. in game asset. no shadow.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Break in case of emergency square. Ax drawing inside. simple. 8-bit. cartoon. blackand white.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Delete