User prompt
make a wall on the sides
User prompt
if you keep clicing you get out makewal to
User prompt
make th game more detailed
User prompt
make it wayyyy harder
User prompt
make the screen follow me
User prompt
make me keep move side ways
User prompt
make gravity and the player jumps when you click
User prompt
make a ground
User prompt
make the player go side ways continuasly and change the background to mach the playr
Initial prompt
geometry crash
===================================================================
--- original.js
+++ change.js
@@ -101,12 +101,15 @@
// Initialize player
var player = game.addChild(new Player());
player.x = 1024;
player.y = 2500;
-// Initialize wall
-var wall = game.addChild(new Wall());
-wall.x = 1024;
-wall.y = 1500;
+// Initialize walls on the sides
+var leftWall = game.addChild(new Wall());
+leftWall.x = 0;
+leftWall.y = 1366;
+var rightWall = game.addChild(new Wall());
+rightWall.x = 2048;
+rightWall.y = 1366;
// Initialize ground
var ground = game.addChild(new Ground());
ground.x = 1024;
ground.y = 2732 - ground.height / 2;
@@ -132,10 +135,10 @@
// Game update loop
game.update = function () {
// Update player
player.update();
- // Check for collision between player and wall
- if (player.intersects(wall)) {
+ // Check for collision between player and the walls
+ if (player.intersects(leftWall) || player.intersects(rightWall)) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
// Make the screen follow the player