User prompt
bg2 should also move while bg1 is moving
User prompt
background should move from down up
Code edit (1 edits merged)
Please save this source code
User prompt
change backgroudn movement to be from down to up
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: scrollingBackground is not defined' in this line: 'scrollingBackground.scroll();' Line Number: 117
User prompt
Fix Bug: 'Uncaught ReferenceError: secondBackground is not defined' in this line: 'self.setChildIndex(secondBackground, 0);' Line Number: 150
User prompt
Fix Bug: 'Uncaught ReferenceError: secondBackground is not defined' in this line: 'self.setChildIndex(secondBackground, 0);' Line Number: 108
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'alpha')' in this line: 'scrollingBackground.secondBackground.alpha = 0.9;' Line Number: 123
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: ScrollingBackground is not defined' in this line: 'var scrollingBackground = self.addChild(new ScrollingBackground());' Line Number: 103
Code edit (3 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught Error: [object Object]addChildAt: The index 1 supplied is out of bounds 0' in this line: 'self.scroll = function () {' Line Number: 94
Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: background is not defined' in this line: 'background.alpha = 0.8;' Line Number: 128
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught ReferenceError: background is not defined' in this line: 'background.alpha = 0.8;' Line Number: 112
Code edit (2 edits merged)
Please save this source code
User prompt
Particles should start behind fhe hero and move downwards
User prompt
make sure engine particles dissapear when hero moves back
User prompt
on game start move hero 500 pixels to the front in 2 seconds and then back to the start position, where it will stay for the rest of the game.
User prompt
start spawning engine particles the moment the game starts
User prompt
on game start move hero 500 pixels to the front in 2 seconds and then back to the start position, where it will stay for the rest of the game.
User prompt
on game start move hero 500 pixels to the front in 2 seconds, and then back 500 pixels in 2 seconds
===================================================================
--- original.js
+++ change.js
@@ -197,24 +197,29 @@
LK.gui.topCenter.addChild(scoreTxt);
var isGameOver = false;
hero.x = 2048 / 2;
hero.y = 2732 - 280;
- var heroMoveForward = true;
- var heroMoveDuration = 120;
- var heroMoveDistance = 500;
- var heroMoveStep = heroMoveDistance / heroMoveDuration;
- var heroMoveTicker = 0;
+ LK.setTimeout(function () {
+ var startPosition = hero.y;
+ var endPosition = startPosition - 500;
+ var duration = 120;
+ var step = (startPosition - endPosition) / duration;
+ var currentStep = 0;
+ var moveHero = function () {
+ if (currentStep < duration) {
+ hero.y -= step;
+ currentStep++;
+ } else if (currentStep < duration * 2) {
+ hero.y += step;
+ currentStep++;
+ } else {
+ hero.y = startPosition;
+ LK.clearInterval(heroMoveInterval);
+ }
+ };
+ var heroMoveInterval = LK.setInterval(moveHero, 1000 / 60);
+ }, 0);
LK.on('tick', function () {
- if (heroMoveTicker < heroMoveDuration) {
- var moveAmount = heroMoveForward ? -heroMoveStep : heroMoveStep;
- hero.y += moveAmount;
- heroMoveTicker++;
- } else if (heroMoveTicker === heroMoveDuration) {
- heroMoveForward = !heroMoveForward;
- heroMoveTicker = 0;
- }
- });
- LK.on('tick', function () {
for (var i = 0; i < heroBullets.length; i++) {
heroBullets[i].move();
for (var j = 0; j < enemies.length; j++) {
if (heroBullets[i].intersects(enemies[j])) {
Goku arms doing kamehameha. seen from above. 8-bit. Cartoon. In game asset. No shadow Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8-bit. Cartoon. Orange energy ball. . In game asset. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
rotate image 45 degrees
8-bit. cartoon. white energy ball. gradieint. transparent. in game asset. flicker. shoot. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
8-bit. cartoon. front view. flying final boss. white. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.