User prompt
Move the health bar slightly down and to the left
User prompt
Move the health bar slightly down and to the left 2 x
User prompt
verplaat gezondheids bar iets meer naar onder en naar links
User prompt
verplaat gezondheids bar recht boven de player
User prompt
maak een gezondheidsbar boven de player
User prompt
make bullets for me wat die graphics zijn er nog niet
User prompt
zorg er voor dat er een systeem in het spel zit voor het schieten
User prompt
Fix Bug: 'ReferenceError: player is not defined' in this line: 'player.health -= 1;' Line Number: 30
User prompt
my health bar is decreasing, when i am shooting
User prompt
my health bar is decreasing, can this be fixed?
User prompt
de players hp is op eens weg en me gun schiet raar kan jij dit fixen?
User prompt
add a gun
User prompt
Verwijder alle ID's, assets en gegevens met betrekking tot geweren en kogels.
User prompt
maak een bullet id waarom doe je het niet!
User prompt
laat er voor zorgen dat mijn gun nu bullets af kan schieten dus fix dat
User prompt
je zegt dat je een asset aan maakt voor bullet maar het gebeurt niet vind niet niet leuk
User prompt
make a bullet for me that the gun can fires
User prompt
okay can you nou write a code that the weapon can shoot to where the mouse is
User prompt
can the gun shoot?
User prompt
place the gun slightly downwards
User prompt
Move the gun a little to the right
User prompt
Move the gun a little to the right
User prompt
Move the gun a little to the right
User prompt
Move the gun a little to the right
User prompt
Move the gun a little to the right
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; 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; LK.on('tick', function () { 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
@@ -26,9 +26,9 @@
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 = -50;
+ self.healthBar.y = -playerGraphics.height;
self.targetPos = {
x: self.x,
y: self.y
};
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.