User prompt
On tick slowly move the background to generate a sense of movement
User prompt
Slowly move background image to the left generating a sense of movement
User prompt
Enemies can have different speed at start. May vary up to 50% faste
User prompt
Increase enemy speed at start by 50 %
User prompt
Double ammount of obstacles on start
Code edit (1 edits merged)
Please save this source code
User prompt
when enemy is hit increase its speed 3 times
User prompt
when enemy is hit by hero bullet, stop the enemy for half a second, then triple its speed, and move forwards with the bullet attached as it currently is.
Code edit (8 edits merged)
Please save this source code
User prompt
obstacles should span at least 500 pixels from the bottom of the screen
Code edit (1 edits merged)
Please save this source code
User prompt
obstacles should spawn higher than Y = 700
Code edit (2 edits merged)
Please save this source code
User prompt
as ishit flag to enemy class
Code edit (1 edits merged)
Please save this source code
User prompt
add is hit flag for every enemy
User prompt
limit point to we awarded by the collision of a hero bullet with a enemy to 1
Code edit (2 edits merged)
Please save this source code
User prompt
move attachment of hero bullet to enemy 50 pixels up.
User prompt
move attachment of hero bullet to hero 50 pixels up
User prompt
hero bullet attached to enemy should move at the same speed and direction as enemy and remain attached to it.
User prompt
keep bullet attached to enemy no matter what
Code edit (1 edits merged)
Please save this source code
User prompt
add a flag to mark enemy as hit. if enemy has been hit, then bullets will not touch him anymore.
User prompt
when herobullet is attached to enemy. enemy should stop moving for a second and then double his speed.
===================================================================
--- original.js
+++ change.js
@@ -69,14 +69,10 @@
var self = Container.call(this);
var background = self.createAsset('background', 'Game Background', 0, 0);
background.width = 2048;
background.height = 2732;
- background.baseSpeed = -0.5;
- background.move = function () {
- background.x += background.baseSpeed;
- if (background.x <= -2048) background.x = 0;
- };
self.addChildAt(background, 0);
+ background.verticalPosition = 0;
var hero = self.addChild(new Hero());
hero.x = 2048 / 2 - 200;
hero.y = 2732 / 2;
var obstacles = [];
@@ -90,8 +86,13 @@
var isGameOver = false;
var tickOffset = 0;
var speedIncreaseFactor = 0;
LK.on('tick', function () {
+ background.verticalPosition -= 1;
+ if (background.verticalPosition <= -2732) {
+ background.verticalPosition = 0;
+ }
+ background.y = background.verticalPosition;
hero.update();
if (hero.y > 2732 || hero.y < 0) {
isGameOver = true;
}