User prompt
Please fix the bug: 'Uncaught TypeError: Cannot set properties of undefined (setting 'y')' in or related to this line: 'mode2Button.y = 2732 / 1.7;' Line Number: 94
User prompt
make the easy and nightmare mode more little bit near to normal mode
User prompt
make easy and nightmare more far from normal mode
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'y')' in or related to this line: 'mode1Button.y = (easyModeButton.y + mode2Button.y) / 2;' Line Number: 93
User prompt
make the normal mode button in the middle of easy mode and nightmare mode
User prompt
make the normal mode stands between easy mode and normal mode
User prompt
make the easy mode is more far from nightmare mode
User prompt
buat tombol mode mudah jadi lebih menjarak dari mode mimpi buruk
User prompt
Move the easy mode button to above the normal mode button
User prompt
Add easy mode
User prompt
make the NPCs walk from start
User prompt
hilangkan bulet
User prompt
make the time shows mm:ss everytime
User prompt
when the time show 06:00, end the game
User prompt
remove the time text
User prompt
make the time from time: 0 to 00:00
User prompt
make a timer, and show it when the game started
User prompt
make the clock appear when the game started
===================================================================
--- original.js
+++ change.js
@@ -68,22 +68,35 @@
var self = Container.call(this);
// Create a button for each game mode
var mode1Button = new Text2('Normal Mode', {
size: 100,
- fill: "#ffffff"
+ fill: 0xFFFFFF
});
mode1Button.anchor.set(0.5, 0.5);
mode1Button.x = 2048 / 2;
mode1Button.y = 2732 / 2;
self.addChild(mode1Button);
var mode2Button = new Text2('NIGHTMARE MODE', {
size: 100,
- fill: "#ff0000"
+ fill: 0xFF0000
});
mode2Button.anchor.set(0.5, 0.5);
mode2Button.x = 2048 / 2;
mode2Button.y = 2732 / 1.8;
self.addChild(mode2Button);
+ var easyModeButton = new Text2('EASY MODE', {
+ size: 100,
+ fill: 0x00FF00
+ });
+ easyModeButton.anchor.set(0.5, 0.5);
+ easyModeButton.x = 2048 / 2;
+ easyModeButton.y = 2732 / 1.6;
+ self.addChild(easyModeButton);
+ // Add event listener to easy mode button
+ easyModeButton.down = function () {
+ self.destroy(); // Remove menu screen
+ initializeGame('easy'); // Start the game in easy mode
+ };
// Add event listeners to mode buttons
mode1Button.down = function () {
self.destroy(); // Remove menu screen
initializeGame('mode1'); // Start the game in mode 1
@@ -179,18 +192,18 @@
var self = Container.call(this);
// Create a title text for the start screen
var titleText = new Text2('NIGHT OF THE MASSACRE 2', {
size: 150,
- fill: "#ffffff"
+ fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 2048 / 2;
titleText.y = 2732 / 4;
self.addChild(titleText);
// Create a start game button
var startButton = new Text2('Start Game', {
size: 150,
- fill: "#00ff00"
+ fill: 0x00FF00
});
startButton.anchor.set(0.5, 0.5);
startButton.x = 2048 / 2;
startButton.y = 2732 / 2;
@@ -235,9 +248,9 @@
function initializeGame(mode) {
// Initialize and display the timer
timerText = new Text2('Time: 00:00', {
size: 100,
- fill: "#ffffff"
+ fill: 0xFFFFFF
});
timerText.anchor.set(0.5, 0);
LK.gui.top.addChild(timerText);
var startTime = Date.now();
@@ -254,8 +267,10 @@
}, 1000);
console.log("Selected Game Mode:", mode);
if (mode === 'mode2') {
game.setBackgroundColor(0x8B0000); // Set background to dark red for NIGHTMARE MODE
+ } else if (mode === 'easy') {
+ game.setBackgroundColor(0x00FF00); // Set background to green for EASY MODE
}
// Initialize player
player = game.addChild(new Player());
player.x = 2048 / 2;
@@ -265,8 +280,10 @@
enemy.x = Math.random() * 2048;
enemy.y = Math.random() * 1000;
if (mode === 'mode2') {
enemy.speed *= 1.5; // Increase enemy speed by 50% in NIGHTMARE MODE
+ } else if (mode === 'easy') {
+ enemy.speed *= 0.5; // Decrease enemy speed by 50% in EASY MODE
}
enemies.push(enemy);
game.addChild(enemy);
// Initialize 30 trees and spread them across the game