User prompt
make that there are more ennemy pig
Code edit (1 edits merged)
Please save this source code
User prompt
make that the ennemy pigs bigger
User prompt
make that you clic on the spacebar, a bullet goes from the pig to the nearest ennemy pig
User prompt
Make the pig bigger
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'intersects')' in or related to this line: 'if (enemyPigs[i].intersects(playerPig)) {' Line Number: 136
User prompt
make that if the pig is touched by a ennemy pig he will die
User prompt
make that if the bullet touch a enemyPig he will die
User prompt
Please fix the bug: 'Uncaught TypeError: window.addEventListener is not a function' in or related to this line: 'window.addEventListener('keydown', function (event) {' Line Number: 98
User prompt
Make that if you clic spacebar the pig choots a bullet
User prompt
make the pig can move every where in the map
Initial prompt
pig wars
===================================================================
--- original.js
+++ change.js
@@ -87,9 +87,9 @@
enemyPigs.push(enemyPig);
game.addChild(enemyPig);
}, 2000);
// Update the game state every frame
-window.addEventListener('keydown', function (event) {
+LK.on('keydown', function (event) {
if (event.code === 'Space') {
var bullet = new Bullet();
bullet.x = playerPig.x;
bullet.y = playerPig.y;
A pig with a gun. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
monster pig horrorific. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a bullet. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.