User prompt
make the enemy cant killing when they're dissappear
User prompt
Please fix the bug: 'ReferenceError: bed is not defined' in or related to this line: 'break;' Line Number: 128
User prompt
Please fix the bug: 'ReferenceError: bed is not defined' in or related to this line: 'if (player.intersects(bed)) {' Line Number: 131
User prompt
when player touch bed, make the enemy gone and reappear after 10 seconds
User prompt
make a bed at the bottom of the screen
User prompt
make the enemy can killing
User prompt
make the enemy 10X faster
User prompt
make the enemy chase player
User prompt
clear the game
User prompt
Make the enemy and player cannot collide to the wall.
User prompt
make the player can collide with the wall
User prompt
make the wall cant collide
User prompt
remove the green flash from the walls
User prompt
make the wall cant killing
User prompt
make a 2 door at the wall
User prompt
make the wall longer to x
User prompt
make the wall stay at the top of the screen and below the enemy
===================================================================
--- original.js
+++ change.js
@@ -1,7 +1,14 @@
/****
* Classes
****/
+var Bed = Container.expand(function () {
+ var self = Container.call(this);
+ var bedGraphics = self.attachAsset('bed', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+});
// Class for the enemy creatures
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.attachAsset('enemy', {
@@ -94,8 +101,12 @@
fill: "#ffffff"
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
+ // Create bed
+ var bed = game.addChild(new Bed());
+ bed.x = 2048 / 2;
+ bed.y = 2732 - 50;
}
// Function to update the game state
game.update = function () {
// Check if any enemy is touching the player