User prompt
Fix Bug: 'Uncaught TypeError: requestAnimationFrame is not a function' in this line: 'requestAnimationFrame(gameLoop);' Line Number: 137
User prompt
Fix Bug: 'Uncaught TypeError: requestAnimationFrame is not a function' in this line: 'requestAnimationFrame(gameLoop);' Line Number: 137
User prompt
zorg er voor dat er minder fps drops zijn
User prompt
kan er voor zorgen dat de game geen fps drops meer heeft
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in this line: 'heroBullets.splice(a, 1);' Line Number: 100
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in this line: 'heroBullets.splice(a, 1);' Line Number: 100
User prompt
zorg dat ik de enemy kan killen
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'speed')' in this line: 'self.speed = 4.23;' Line Number: 30
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'speed')' in this line: 'self.speed = 4.23;' Line Number: 30
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'speed')' in this line: 'self.speed = self.speed || 4.23;' Line Number: 30
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'speed')' in this line: 'self.speed = 4.23;' Line Number: 30
User prompt
Fix Bug: 'TypeError: Cannot set properties of undefined (setting 'speed')' in this line: 'self.speed = 4.23;' Line Number: 29
User prompt
Fix Bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'expand')' in this line: 'var SmallEnemy = Enemy.expand(function () {' Line Number: 1
User prompt
zorg er voor dat de enemy gekillt kan worden en als hij gekillt is dat er 2 small enemys uit komen die ook op jou afkomen maar 10% sneller zijn
User prompt
Fix Bug: 'TypeError: self.getStage is not a function' in this line: 'var gameContainer = self.getStage();' Line Number: 81
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.parent.addChild(smallEnemy1);' Line Number: 81
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'gameInstance.addChild(smallEnemy1);' Line Number: 81
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.parent.addChild(smallEnemy1);' Line Number: 81
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'gameInstance.addChild(smallEnemy1);' Line Number: 81
User prompt
zorg er voor dat er 2 andere smallenemy uit de enemy komt die je killt
User prompt
zorg er voor dat er 2 andere enemys uit de enemy komt die je killt
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in this line: 'heroBullets.splice(a, 1);' Line Number: 118
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'addChild')' in this line: 'self.parent.addChild(smallEnemy1, smallEnemy2);' Line Number: 72
User prompt
zorg er voor dat ik de enemy kan killen en dat ie dan in 2 splits en dat er 2 kleinere enemys komen
User prompt
Increase the speed of the hero by 10%
===================================================================
--- original.js
+++ change.js
@@ -78,12 +78,13 @@
});
LK.gui.topCenter.addChild(fpsCounter);
var lastTick = Date.now();
var frameCount = 0;
- LK.on('tick', function () {
+ var gameLoop = function () {
if (isGameOver) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
+ return;
}
frameCount++;
var now = Date.now();
if (now - lastTick >= 1000) {
@@ -93,24 +94,25 @@
}
hero.update();
enemy.followHero(hero);
for (var a = heroBullets.length - 1; a >= 0; a--) {
- var bullet = heroBullets[a];
- bullet.move();
- if (bullet.y < -50 || bullet.y > 2732 + 50 || bullet.x < -50 || bullet.x > 2048 + 50 || bullet && enemy && bullet.intersects(enemy)) {
- if (bullet && enemy && bullet.intersects(enemy)) {
- enemy.hit();
- }
- bullet.destroy();
+ heroBullets[a].move();
+ if (heroBullets[a].y < -50 || heroBullets[a].y > 2732 + 50 || heroBullets[a].x < -50 || heroBullets[a].x > 2048 + 50) {
+ heroBullets[a].destroy();
heroBullets.splice(a, 1);
+ } else if (heroBullets[a] && enemy && heroBullets[a].intersects(enemy)) {
+ enemy.hit();
+ heroBullets[a].destroy();
+ heroBullets.splice(a, 1);
}
}
for (var a = enemyBullets.length - 1; a >= 0; a--) {
- var bullet = enemyBullets[a];
- bullet.move();
- if (bullet.y > 2732 + 50) {
- bullet.destroy();
- enemyBullets.splice(a, 1);
+ if (enemyBullets[a]) {
+ enemyBullets[a].move();
+ if (enemyBullets[a].y > 2732 + 50) {
+ enemyBullets[a].destroy();
+ enemyBullets.splice(a, 1);
+ }
}
}
var lastShot = 0;
var bulletCount = 0;
@@ -128,9 +130,10 @@
heroBullets.push(newBullet);
self.addChild(newBullet);
hero.knockback(-dx / (mag * 10), -dy / (mag * 10));
});
- LK.on('tick', function () {
- if (bulletCount > 0) bulletCount--;
- });
- });
+ if (bulletCount > 0) bulletCount--;
+ requestAnimationFrame(gameLoop);
+ };
+ requestAnimationFrame(gameLoop);
+ ;
});
watergun Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
water ball Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
water health bar Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
fire Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
blue play button Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
explosion smoke Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.