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
User prompt
start of game hero should move 400 pixels to the front and 1 second later 400 pixels to the back
User prompt
rotate engine particles 90 degrees
User prompt
Fix Bug: 'ReferenceError: particles is not defined' in this line: 'particles.forEach(function (particle, index) {' Line Number: 235
User prompt
Fix Bug: 'ReferenceError: particles is not defined' in this line: 'particles.forEach(function (particle, index) {' Line Number: 235
Code edit (1 edits merged)
Please save this source code
User prompt
reduce engine paarticles to 10
User prompt
decrease ammount of engine particles progressible
User prompt
destroy engine paticles when not in use
User prompt
less engine particles
User prompt
show engineparticles behing hero
Code edit (1 edits merged)
Please save this source code
User prompt
show engine particles
User prompt
spawn engine particles behing hero on game start
User prompt
spawn energyparticles below hero
User prompt
show eneryparticles on tick
User prompt
spawn energyparticles behing hero
User prompt
show energyparticles behing hero. not a lot. keep it performant.
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'x')' in this line: 'engineParticle.x = hero.x;' Line Number: 136
===================================================================
--- original.js
+++ change.js
@@ -49,12 +49,27 @@
self.movementSpeed = 0.5;
self.movementRange = 50;
self.originalX = 2048 / 2;
self.x = self.originalX;
+ self.startAnimation = true;
+ self.animationTicks = 0;
self.updateMovement = function () {
- self.x += self.movementDirection * self.movementSpeed;
- if (self.x < self.originalX - self.movementRange || self.x > self.originalX + self.movementRange) {
- self.movementDirection *= -1;
+ if (self.startAnimation) {
+ var totalAnimationTicks = 120;
+ var forwardDistance = 500;
+ if (self.animationTicks <= totalAnimationTicks / 2) {
+ self.y -= forwardDistance / (totalAnimationTicks / 2);
+ } else if (self.animationTicks <= totalAnimationTicks) {
+ self.y += forwardDistance / (totalAnimationTicks / 2);
+ } else {
+ self.startAnimation = false;
+ }
+ self.animationTicks++;
+ } else {
+ self.x += self.movementDirection * self.movementSpeed;
+ if (self.x < self.originalX - self.movementRange || self.x > self.originalX + self.movementRange) {
+ self.movementDirection *= -1;
+ }
}
if (Math.random() < 0.02) {
var particle = new EngineParticle();
particle.x = self.x;
@@ -195,10 +210,8 @@
dropShadowDistance: 6
});
LK.gui.topCenter.addChild(scoreTxt);
var isGameOver = false;
- hero.x = 2048 / 2;
- hero.y = 2732 - 280;
LK.setInterval(function () {
if (Math.random() < 0.02) {
var particle = new EngineParticle();
particle.x = hero.x;
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.