User prompt
On peut pas mourrir si on touche pas les obstacle
User prompt
Enlève la hitbox des obstacle
User prompt
Réduit la hitbox des obstacles
User prompt
Fait qu’on meurt que quand on touche un obstacle
User prompt
Réduit un peu la hitbox des obstacle
User prompt
Augmente la hitbox de tout
User prompt
Réduit la zone d’impacts de mort d’un objet
User prompt
Fait en sorte que le joueur meurt quand il va sur un obstacle
User prompt
Anulle l’effet que jeu meurt en touchant rien
User prompt
Annule les points par obstacle
User prompt
Fait que le score augmente de 1 chaque seconde
User prompt
Augmente le nombre d’obstacle au fur et à mesures que le temps passe
User prompt
Ajoute un fond autoraute
User prompt
Réduit la hitbox des obstacles
User prompt
Fait que le score augmente de 1 À chaque fois que obstacle se fait dépasser par le joueur
User prompt
Ajoute un score
User prompt
Ajoute un score à chaque fois qu obstacle disparaît
Initial prompt
Furax
/****
* Classes
****/
// Define the Obstacle class
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 5;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.destroy();
}
};
});
//<Assets used in the game will automatically appear here>
// Define the Player class
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 10;
self.update = function () {
// Player update logic
};
self.move = function (x, y) {
self.x = x;
self.y = y;
};
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000 //Init game with black background
});
/****
* Game Code
****/
// Initialize player
var player = new Player();
player.x = 2048 / 2;
player.y = 2732 - 200;
game.addChild(player);
// Initialize obstacles array
var obstacles = [];
// Function to spawn a new obstacle
function spawnObstacle() {
var obstacle = new Obstacle();
obstacle.x = Math.random() * 2048;
obstacle.y = -50;
obstacles.push(obstacle);
game.addChild(obstacle);
}
// Handle player movement
game.move = function (x, y, obj) {
player.move(x, y);
};
// Update game state
game.update = function () {
// Update player
player.update();
// Update obstacles
for (var i = obstacles.length - 1; i >= 0; i--) {
obstacles[i].update();
if (obstacles[i].intersects(player)) {
// Flash screen red for 1 second (1000ms) to show we are dead.
LK.effects.flashScreen(0xff0000, 1000);
// Show game over. The game will be automatically paused while game over is showing.
LK.showGameOver(); // Calling this will destroy the 'Game' and reset entire game state.
}
}
// Spawn new obstacle every 60 ticks (1 second)
if (LK.ticks % 60 == 0) {
spawnObstacle();
}
};
Chevalier à moitié mort. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Château fort détruit. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Épée argenté dirigée vers bas. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.