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
@@ -1,4 +1,30 @@
+var Enemy = Container.expand(function () {
+ var self = Container.call(this);
+ self.health = 3;
+ var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5);
+ self.followHero = function (hero) {
+ var dx = hero.x - self.x;
+ var dy = hero.y - self.y;
+ var mag = Math.sqrt(dx * dx + dy * dy);
+ self.x += 3.85 * dx / mag;
+ self.y += 3.85 * dy / mag;
+ };
+ self.takeDamage = function () {
+ self.health--;
+ if (self.health <= 0) {
+ var smallEnemy1 = new SmallEnemy();
+ smallEnemy1.x = self.x;
+ smallEnemy1.y = self.y;
+ self.parent.addChild(smallEnemy1);
+ var smallEnemy2 = new SmallEnemy();
+ smallEnemy2.x = self.x;
+ smallEnemy2.y = self.y;
+ self.parent.addChild(smallEnemy2);
+ self.destroy();
+ }
+ };
+});
var SmallEnemy = Enemy.expand(function () {
var self = Enemy.call(this);
self.speed = 4.23;
});
@@ -53,34 +79,8 @@
self.dx = -dx * 116.886;
self.dy = -dy * 116.886;
};
});
-var Enemy = Container.expand(function () {
- var self = Container.call(this);
- self.health = 3;
- var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5);
- self.followHero = function (hero) {
- var dx = hero.x - self.x;
- var dy = hero.y - self.y;
- var mag = Math.sqrt(dx * dx + dy * dy);
- self.x += 3.85 * dx / mag;
- self.y += 3.85 * dy / mag;
- };
- self.takeDamage = function () {
- self.health--;
- if (self.health <= 0) {
- var smallEnemy1 = new SmallEnemy();
- smallEnemy1.x = self.x;
- smallEnemy1.y = self.y;
- self.parent.addChild(smallEnemy1);
- var smallEnemy2 = new SmallEnemy();
- smallEnemy2.x = self.x;
- smallEnemy2.y = self.y;
- self.parent.addChild(smallEnemy2);
- self.destroy();
- }
- };
-});
var Game = Container.expand(function () {
var self = Container.call(this);
LK.stageContainer.setBackgroundColor(0x000000);
var hero = self.addChild(new Hero());
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.