User prompt
zorg er ook voor dat er nog niks spawn of dat de score om hoog gaat voor dat de play button is geklikt
User prompt
de game nog niet beginnen als jij niet op play klik
User prompt
zet de play button er weer in
User prompt
Fix Bug: 'Uncaught ReferenceError: filters is not defined' in this line: 'backgroundGraphics.filters = [new filters.BlurFilter(blurAmount)];' Line Number: 5
User prompt
Fix Bug: 'Uncaught ReferenceError: filters is not defined' in this line: 'backgroundGraphics.filters = [new filters.BlurFilter(blurAmount)];' Line Number: 5
User prompt
Fix Bug: 'Uncaught ReferenceError: filters is not defined' in this line: 'backgroundGraphics.filters = [new filters.BlurFilter(blurAmount)];' Line Number: 5
User prompt
maak een layer achter de play button die wazig is zo dat het lijkt dat er nog niks begonnen is
User prompt
you have to press te play button before you can play the game!
User prompt
Fix Bug: 'TypeError: LK.resumeGame is not a function' in this line: 'LK.resumeGame();' Line Number: 6
User prompt
Fix Bug: 'Uncaught TypeError: LK.pauseGame is not a function' in this line: 'LK.pauseGame();' Line Number: 86
User prompt
make a play button before you can start
User prompt
Move the health bar slightly up
User prompt
Move the health bar slightly up
User prompt
Move the health bar slightly up
User prompt
Move the health bar slightly down and to the left
User prompt
Move the health bar slightly up and to the left
User prompt
Move the health bar slightly down and to the left
User prompt
Move the health bar slightly down and to the right
User prompt
Move the health bar slightly down and to the right
User prompt
Move the health bar slightly down and to the left
User prompt
Move the health bar slightly down and to the right
User prompt
Move the health bar slightly down and to the right
User prompt
✅ Move the health bar slightly down and to the left
var HealthBar = Container.expand(function () { var self = Container.call(this); var barGraphics = self.createAsset('healthbar', 'Health bar', 0, 0.5); self.update = function (health) { barGraphics.scale.x = health / 100; }; }); var Prison = Container.expand(function () { var self = Container.call(this); var prisonGraphics = self.createAsset('prison', 'Prison object', .5, .5); self.freezePlayer = function (player, monster) { if (self.intersects(player)) { player.isFrozen = true; monster.scale.x *= 1.001; monster.scale.y *= 1.001; LK.setTimeout(function () { player.isFrozen = false; }, 3000); self.destroy(); } }; self.update = function (player, monster) { self.freezePlayer(player, monster); }; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.createAsset('player', 'Player character', .5, .5); self.healthBar = self.addChild(new HealthBar()); self.healthBar.y = -playerGraphics.height + 80; self.healthBar.x = -60; self.targetPos = { x: self.x, y: self.y }; self.health = 100; self.isFrozen = false; self.move = function () { var dx = self.targetPos.x - self.x; var dy = self.targetPos.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0 && !self.isFrozen) { self.x += dx / distance * 4; self.y += dy / distance * 4; } }; self.update = function () { self.move(); self.healthBar.update(self.health); }; }); var Monster = Container.expand(function () { var self = Container.call(this); var monsterGraphics = self.createAsset('monster', 'Monster character', .5, .5); self.chase = function (player) { var dx = player.x - self.x; var dy = player.y - self.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > 0) { self.x += dx / distance * 2; self.y += dy / distance * 2; } }; self.update = function () {}; }); var Maze = Container.expand(function () { var self = Container.call(this); var mazeGraphics = self.createAsset('maze', 'Maze structure', .5, .5); self.generate = function () {}; }); var Game = Container.expand(function () { var self = Container.call(this); var maze = self.addChild(new Maze()); var player = self.addChild(new Player()); var survivalTimeDisplay = new Text2('0', { size: 150, fill: '#ffffff' }); survivalTimeDisplay.anchor.set(.5, 0); LK.gui.topCenter.addChild(survivalTimeDisplay); var monster = self.addChild(new Monster()); var prisons = []; player.x = 1024; player.y = 1366; monster.x = 2048; monster.y = 2732; maze.generate(); self.spawnPrison = function () { var prison = self.addChild(new Prison()); prison.x = Math.random() * 2048; prison.y = Math.random() * 2732; prisons.push(prison); }; var isGameOver = false; var survivalTime = 0; var isGameStarted = false; var playButton = self.createAsset('playButton', 'Play button', .5, .5); playButton.x = 1024; playButton.y = 1366; playButton.on('down', function () { self.removeChild(playButton); isGameStarted = true; }); LK.on('tick', function () { if (isGameStarted) { player.update(); monster.chase(player); monster.update(); if (LK.ticks % 180 === 0) { self.spawnPrison(); } survivalTime += 1 / 60; for (var i = 0; i < prisons.length; i++) { prisons[i].update(player, monster); } if (player.intersects(monster)) { player.health -= 1; if (player.health <= 0) { isGameOver = true; } } survivalTimeDisplay.setText(Math.floor(survivalTime)); if (isGameOver) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } }); var isMouseDown = false; stage.on('down', function (obj) { var event = obj.event; player.targetPos = event.getLocalPosition(self); isMouseDown = true; }); stage.on('move', function (obj) { if (isMouseDown) { var event = obj.event; player.targetPos = event.getLocalPosition(self); } }); stage.on('up', function (obj) { isMouseDown = false; }); });
===================================================================
--- original.js
+++ change.js
@@ -105,27 +105,27 @@
if (isGameStarted) {
player.update();
monster.chase(player);
monster.update();
- }
- if (LK.ticks % 180 === 0) {
- self.spawnPrison();
- }
- survivalTime += 1 / 60;
- for (var i = 0; i < prisons.length; i++) {
- prisons[i].update(player, monster);
- }
- if (player.intersects(monster)) {
- player.health -= 1;
- if (player.health <= 0) {
- isGameOver = true;
+ if (LK.ticks % 180 === 0) {
+ self.spawnPrison();
}
+ survivalTime += 1 / 60;
+ for (var i = 0; i < prisons.length; i++) {
+ prisons[i].update(player, monster);
+ }
+ if (player.intersects(monster)) {
+ player.health -= 1;
+ if (player.health <= 0) {
+ isGameOver = true;
+ }
+ }
+ survivalTimeDisplay.setText(Math.floor(survivalTime));
+ if (isGameOver) {
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ }
}
- survivalTimeDisplay.setText(Math.floor(survivalTime));
- if (isGameOver) {
- LK.effects.flashScreen(0xff0000, 1000);
- LK.showGameOver();
- }
});
var isMouseDown = false;
stage.on('down', function (obj) {
var event = obj.event;
maak een horror player karakter van boven af en het moet vriendelijk zijn Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
make a prison Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
maak een horror player karakter van boven af Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a blur grey horror background Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
make a light pointer to the left Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
make a health bar black and white basic Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
play button black and white Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.