User prompt
Increase the size of the enemies a bit
User prompt
Make the player a bit bigger
User prompt
Add a score
User prompt
Spawn new enemies every 8 seconds randomly on the map
User prompt
Make the player faster every 5 seconds as well
User prompt
Increase the speed of the enemies every 5 seconds
User prompt
Add touch function to move the player around
User prompt
Make the player move, using Touch
User prompt
Add touch control
Initial prompt
Manhunt
===================================================================
--- original.js
+++ change.js
@@ -26,8 +26,9 @@
var self = Container.call(this);
var hero = self.addChild(new Hero());
var enemies = [];
var isGameOver = false;
+ var lastSpeedIncrease = 0;
hero.x = 2048 / 2;
hero.y = 2732 / 2;
for (var i = 0; i < 5; i++) {
var enemy = self.addChild(new Enemy());
@@ -55,8 +56,14 @@
touchStart = obj.event.getLocalPosition(self);
hero.move(touchStart, touchStart);
});
LK.on('tick', function () {
+ if (LK.ticks - lastSpeedIncrease >= 300) {
+ for (var i = 0; i < enemies.length; i++) {
+ enemies[i].speed += 1;
+ }
+ lastSpeedIncrease = LK.ticks;
+ }
for (var i = 0; i < enemies.length; i++) {
enemies[i].chase(hero);
if (enemies[i].intersects(hero)) {
isGameOver = true;