User prompt
eliminar el boton de reproduccion y en su lugar coloca el boton de play en medio de la pantalla arriba de el boton de play coloca la seleccion de personajes y añade una interfaz a la seleccion de personajes
User prompt
no se requiere eljir un personaje para empezar a jugar
User prompt
la musica suena despues de presionar al boton de play
User prompt
agrega un boton de play
User prompt
agrega nuevas instrucciones
User prompt
elimina las frases
User prompt
coloca un boton para empezar a jugar
User prompt
el sonido de muerte suena al haber perdido el sonido de victoria suena al ganar el juego la musica suena justo al empezar a jugar
User prompt
condicion de victoria sera de 10000
User prompt
el boton se mirara por encima de el suelo
User prompt
en la esquina inferior izquierda
User prompt
coloca un boton de disparo en la esquina inferior derecha de la pantalla
User prompt
el jugador va a tner el arma un poco mas arriba y recta mirando hacia enfrente
User prompt
el jugador va a tener el arma en la mano
User prompt
el arma el jugador la va a tener en todo momento
User prompt
un arma que tengan los jugadores
User prompt
agrega un objeto con el que el jugador pueda disparar a los enemigos y desaparecerlos agrega otro enemigo que este en el aire
User prompt
agrega otro personaje
User prompt
eliminar el bloque rompible
User prompt
la duracion de la invencibilidad de el bloque rompible sera de solo 5 segundos
User prompt
reduce la probabilidad de que aparezcan los potenciadores un poco mas
User prompt
puntuacion para la victoria 100,000
User prompt
un menos de posibilidad de que aparezcan los bloques rompibles
User prompt
los bloques rompibles estan en el aire y al romperlos te dan un potenciador de invencibilidad con una duracion de 5 segundos y mayor distancia entre obstaculos y enemigos ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
mayor probabilidad de que aparezcan los bloques rompibles
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Bullet = Container.expand(function () {
var self = Container.call(this);
var bulletGraphics = self.attachAsset('bullet', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = 15;
self.update = function () {
self.x += self.speed;
};
return self;
});
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.attachAsset('enemy', {
anchorX: 0.5,
anchorY: 1.0
});
self.speed = -8;
self.update = function () {
self.x += self.speed;
};
return self;
});
var FlyingEnemy = Container.expand(function () {
var self = Container.call(this);
var flyingEnemyGraphics = self.attachAsset('flyingEnemy', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -10;
self.update = function () {
self.x += self.speed;
};
return self;
});
var GroundSegment = Container.expand(function () {
var self = Container.call(this);
var groundGraphics = self.attachAsset('ground', {
anchorX: 0,
anchorY: 0
});
self.speed = -8;
self.update = function () {
self.x += self.speed;
};
return self;
});
var Hole = Container.expand(function () {
var self = Container.call(this);
var holeGraphics = self.attachAsset('hole', {
anchorX: 0,
anchorY: 0
});
self.speed = -8;
self.update = function () {
self.x += self.speed;
};
return self;
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 1.0
});
self.speed = -8;
self.update = function () {
self.x += self.speed;
};
return self;
});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 1.0
});
self.isJumping = false;
self.jumpSpeed = 0;
self.gravity = 0.8;
self.jumpPower = -25;
self.groundY = 0;
self.customColor = 0x4CAF50;
self.jumpCount = 0;
self.maxJumps = 2;
self.characterType = 'player';
self.isInvincible = false;
self.invincibilityTimer = 0;
self.hasWeapon = false;
self.weaponGraphics = null;
self.jump = function () {
if (self.jumpCount < self.maxJumps) {
if (!self.isJumping) {
self.isJumping = true;
}
self.jumpSpeed = self.jumpPower;
self.jumpCount++;
LK.getSound('jump').play();
}
};
self.setColor = function (color) {
self.customColor = color;
playerGraphics.tint = color;
};
self.setCharacter = function (characterType) {
self.characterType = characterType;
playerGraphics.destroy();
playerGraphics = self.attachAsset(characterType, {
anchorX: 0.5,
anchorY: 1.0
});
};
self.activateInvincibility = function () {
self.isInvincible = true;
self.invincibilityTimer = 300; // 5 seconds at 60fps
// Flash effect
tween(playerGraphics, {
alpha: 0.3
}, {
duration: 200,
easing: tween.easeInOut,
onFinish: function onFinish() {
if (self.isInvincible) {
tween(playerGraphics, {
alpha: 1
}, {
duration: 200,
easing: tween.easeInOut,
onFinish: function onFinish() {
if (self.isInvincible) {
self.activateInvincibility();
}
}
});
}
}
});
};
self.pickupWeapon = function () {
self.hasWeapon = true;
// Create weapon graphics attached to player
if (self.weaponGraphics) {
self.weaponGraphics.destroy();
}
self.weaponGraphics = self.attachAsset('weapon', {
anchorX: 0.5,
anchorY: 0.5
});
// Position weapon higher and straight in player's hand pointing forward
self.weaponGraphics.x = 40;
self.weaponGraphics.y = -200;
self.weaponGraphics.scaleX = 3;
self.weaponGraphics.scaleY = 3;
self.weaponGraphics.rotation = 0; // Straight forward
};
self.update = function () {
if (self.isJumping) {
self.jumpSpeed += self.gravity;
self.y += self.jumpSpeed;
var landingY = self.groundY;
if (self.y >= landingY) {
self.y = landingY;
self.isJumping = false;
self.jumpSpeed = 0;
self.jumpCount = 0;
}
}
// Handle invincibility timer
if (self.isInvincible) {
self.invincibilityTimer--;
if (self.invincibilityTimer <= 0) {
self.isInvincible = false;
tween.stop(playerGraphics);
playerGraphics.alpha = 1;
}
}
};
return self;
});
var Weapon = Container.expand(function () {
var self = Container.call(this);
var weaponGraphics = self.attachAsset('weapon', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -8;
self.update = function () {
self.x += self.speed;
self.y += Math.sin(LK.ticks * 0.1) * 2; // Floating animation
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
var gameState = 'instructions'; // 'instructions', 'customization', 'ready', 'playing', 'gameOver'
var selectedCharacter = 'player';
var player;
var groundSegments = [];
var holes = [];
var enemies = [];
var obstacles = [];
var bullets = [];
var flyingEnemies = [];
var weapons = [];
var gameSpeed = 8;
var spawnTimer = 0;
var shootTimer = 0;
var distance = 0;
var groundY = 2400;
var invincibilitySpacing = 1;
var lastInvincibilityTime = 0;
// UI Elements
var character1Button = LK.getAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
character1Button.x = 648;
character1Button.y = 1200;
character1Button.scaleX = 0.5;
character1Button.scaleY = 0.5;
var character2Button = LK.getAsset('player2', {
anchorX: 0.5,
anchorY: 0.5
});
character2Button.x = 1024;
character2Button.y = 1200;
character2Button.scaleX = 0.5;
character2Button.scaleY = 0.5;
var character3Button = LK.getAsset('player3', {
anchorX: 0.5,
anchorY: 0.5
});
character3Button.x = 1400;
character3Button.y = 1200;
character3Button.scaleX = 0.5;
character3Button.scaleY = 0.5;
var startButton = LK.getAsset('startButton', {
anchorX: 0.5,
anchorY: 0.5
});
startButton.x = 1024;
startButton.y = 1800;
startButton.visible = false;
var distanceText = new Text2('0m', {
size: 60,
fill: 0xFFFFFF
});
distanceText.anchor.set(0.5, 0);
LK.gui.top.addChild(distanceText);
// Instructions UI
var instructionBox = LK.getAsset('instructionBox', {
anchorX: 0.5,
anchorY: 0.5
});
instructionBox.x = 1024;
instructionBox.y = 800;
instructionBox.alpha = 0.8;
var instructionTitle = new Text2('INSTRUCCIONES', {
size: 80,
fill: 0xFFFFFF
});
instructionTitle.anchor.set(0.5, 0.5);
instructionTitle.x = 1024;
instructionTitle.y = 500;
var instructionText1 = new Text2('• Toca la pantalla para saltar', {
size: 50,
fill: 0xFFFFFF
});
instructionText1.anchor.set(0.5, 0.5);
instructionText1.x = 1024;
instructionText1.y = 650;
var instructionText2 = new Text2('• Usa el botón de fuego para disparar', {
size: 50,
fill: 0xFFFFFF
});
instructionText2.anchor.set(0.5, 0.5);
instructionText2.x = 1024;
instructionText2.y = 720;
var instructionText3 = new Text2('• Evita obstáculos y enemigos', {
size: 50,
fill: 0xFFFFFF
});
instructionText3.anchor.set(0.5, 0.5);
instructionText3.x = 1024;
instructionText3.y = 790;
var instructionText4 = new Text2('• Llega a 10,000m para ganar', {
size: 50,
fill: 0xFFFFFF
});
instructionText4.anchor.set(0.5, 0.5);
instructionText4.x = 1024;
instructionText4.y = 860;
var instructionText5 = new Text2('• Doble salto disponible', {
size: 50,
fill: 0xFFFFFF
});
instructionText5.anchor.set(0.5, 0.5);
instructionText5.x = 1024;
instructionText5.y = 930;
var closeInstructionsText = new Text2('Toca para continuar', {
size: 40,
fill: 0xFFFF00
});
closeInstructionsText.anchor.set(0.5, 0.5);
closeInstructionsText.x = 1024;
closeInstructionsText.y = 1050;
var fireButton = LK.getAsset('fireButton', {
anchorX: 0.5,
anchorY: 0.5
});
fireButton.x = 150;
fireButton.y = 2200;
game.addChild(fireButton);
// Initialize player
player = new Player();
player.x = 400;
player.y = groundY;
player.groundY = groundY;
game.addChild(player);
// Initialize ground segments
for (var i = 0; i < 15; i++) {
var ground = new GroundSegment();
ground.x = i * 200;
ground.y = groundY;
groundSegments.push(ground);
game.addChild(ground);
}
function initializeGame() {
gameState = 'playing';
distance = 0;
gameSpeed = 8;
spawnTimer = 0;
LK.playMusic('musica');
// Hide customization UI
startButton.visible = false;
character1Button.visible = false;
character2Button.visible = false;
character3Button.visible = false;
// Hide instructions UI
instructionBox.visible = false;
instructionTitle.visible = false;
instructionText1.visible = false;
instructionText2.visible = false;
instructionText3.visible = false;
instructionText4.visible = false;
instructionText5.visible = false;
closeInstructionsText.visible = false;
// Clear existing obstacles
clearAllObstacles();
// Reset player position
player.x = 400;
player.y = groundY;
player.isJumping = false;
player.jumpSpeed = 0;
player.jumpCount = 0;
player.isInvincible = false;
player.invincibilityTimer = 0;
// Give player weapon at start
player.pickupWeapon();
invincibilitySpacing = 1;
lastInvincibilityTime = 0;
// Reset ground segments
for (var i = 0; i < groundSegments.length; i++) {
groundSegments[i].x = i * 200;
groundSegments[i].speed = -gameSpeed;
}
}
function clearAllObstacles() {
for (var i = holes.length - 1; i >= 0; i--) {
holes[i].destroy();
holes.splice(i, 1);
}
for (var i = enemies.length - 1; i >= 0; i--) {
enemies[i].destroy();
enemies.splice(i, 1);
}
for (var i = obstacles.length - 1; i >= 0; i--) {
obstacles[i].destroy();
obstacles.splice(i, 1);
}
for (var i = bullets.length - 1; i >= 0; i--) {
bullets[i].destroy();
bullets.splice(i, 1);
}
for (var i = flyingEnemies.length - 1; i >= 0; i--) {
flyingEnemies[i].destroy();
flyingEnemies.splice(i, 1);
}
}
function spawnObstacle() {
var rand = Math.random();
var spawnX = 2200;
if (rand < 0.15) {
// Spawn hole
var hole = new Hole();
hole.x = spawnX;
hole.y = groundY;
hole.speed = -gameSpeed;
holes.push(hole);
game.addChild(hole);
} else if (rand < 0.25) {
// Spawn enemy
var enemy = new Enemy();
enemy.x = spawnX;
enemy.y = groundY;
enemy.speed = -gameSpeed;
enemies.push(enemy);
game.addChild(enemy);
} else if (rand < 0.35) {
// Spawn obstacle
var obstacle = new Obstacle();
obstacle.x = spawnX;
obstacle.y = groundY;
obstacle.speed = -gameSpeed;
obstacles.push(obstacle);
game.addChild(obstacle);
} else if (rand < 0.45) {
// Spawn flying enemy
var flyingEnemy = new FlyingEnemy();
flyingEnemy.x = spawnX;
flyingEnemy.y = groundY - 300 - Math.random() * 200;
flyingEnemy.speed = -gameSpeed;
flyingEnemies.push(flyingEnemy);
game.addChild(flyingEnemy);
}
}
function checkCollisions() {
// Check bullet vs enemy collisions
for (var i = bullets.length - 1; i >= 0; i--) {
var bullet = bullets[i];
var bulletHit = false;
// Check bullet vs ground enemies
for (var j = enemies.length - 1; j >= 0; j--) {
var enemy = enemies[j];
if (bullet.intersects(enemy)) {
// Remove bullet and enemy
bullet.destroy();
bullets.splice(i, 1);
enemy.destroy();
enemies.splice(j, 1);
bulletHit = true;
break;
}
}
// Check bullet vs flying enemies
if (!bulletHit) {
for (var j = flyingEnemies.length - 1; j >= 0; j--) {
var flyingEnemy = flyingEnemies[j];
if (bullet.intersects(flyingEnemy)) {
// Remove bullet and flying enemy
bullet.destroy();
bullets.splice(i, 1);
flyingEnemy.destroy();
flyingEnemies.splice(j, 1);
break;
}
}
}
}
// Skip damage collisions if invincible
if (!player.isInvincible) {
// Check hole collisions
for (var i = 0; i < holes.length; i++) {
var hole = holes[i];
if (player.x > hole.x && player.x < hole.x + 150 && !player.isJumping) {
gameOver();
return;
}
}
// Check enemy collisions
for (var i = 0; i < enemies.length; i++) {
var enemy = enemies[i];
if (player.intersects(enemy)) {
gameOver();
return;
}
}
// Check flying enemy collisions
for (var i = 0; i < flyingEnemies.length; i++) {
var flyingEnemy = flyingEnemies[i];
if (player.intersects(flyingEnemy)) {
gameOver();
return;
}
}
// Check obstacle collisions
for (var i = 0; i < obstacles.length; i++) {
var obstacle = obstacles[i];
if (player.intersects(obstacle)) {
gameOver();
return;
}
}
}
}
function gameOver() {
gameState = 'gameOver';
LK.getSound('hit').play();
LK.getSound('muerte').play();
LK.showGameOver();
}
function updateSpeed() {
gameSpeed = 8 + distance / 100;
for (var i = 0; i < groundSegments.length; i++) {
groundSegments[i].speed = -gameSpeed;
}
for (var i = 0; i < holes.length; i++) {
holes[i].speed = -gameSpeed;
}
for (var i = 0; i < enemies.length; i++) {
enemies[i].speed = -gameSpeed;
}
for (var i = 0; i < obstacles.length; i++) {
obstacles[i].speed = -gameSpeed;
}
for (var i = 0; i < flyingEnemies.length; i++) {
flyingEnemies[i].speed = -gameSpeed;
}
}
game.down = function (x, y, obj) {
if (gameState === 'instructions') {
// Any tap closes instructions and goes to character selection
gameState = 'customization';
// Hide instructions UI
instructionBox.visible = false;
instructionTitle.visible = false;
instructionText1.visible = false;
instructionText2.visible = false;
instructionText3.visible = false;
instructionText4.visible = false;
instructionText5.visible = false;
closeInstructionsText.visible = false;
// Show character selection UI
character1Button.visible = true;
character2Button.visible = true;
character3Button.visible = true;
} else if (gameState === 'customization') {
// Check character 1 button
if (x > 563 && x < 733 && y > 1050 && y < 1350) {
selectedCharacter = 'player';
player.setCharacter('player');
gameState = 'ready';
// Hide character selection UI
character1Button.visible = false;
character2Button.visible = false;
character3Button.visible = false;
// Show ready UI
startButton.visible = true;
}
// Check character 2 button
else if (x > 939 && x < 1109 && y > 1050 && y < 1350) {
selectedCharacter = 'player2';
player.setCharacter('player2');
gameState = 'ready';
// Hide character selection UI
character1Button.visible = false;
character2Button.visible = false;
character3Button.visible = false;
// Show ready UI
startButton.visible = true;
}
// Check character 3 button
else if (x > 1315 && x < 1485 && y > 1050 && y < 1350) {
selectedCharacter = 'player3';
player.setCharacter('player3');
gameState = 'ready';
// Hide character selection UI
character1Button.visible = false;
character2Button.visible = false;
character3Button.visible = false;
// Show ready UI
startButton.visible = true;
}
} else if (gameState === 'ready') {
// Check start button click
if (x > 874 && x < 1174 && y > 1750 && y < 1850) {
initializeGame();
}
} else if (gameState === 'playing') {
// Check fire button click (bottom left corner)
if (x > 90 && x < 210 && y > 2140 && y < 2260) {
// Fire button pressed - shoot bullet
if (shootTimer <= 0) {
var bullet = new Bullet();
bullet.x = player.x + 50;
bullet.y = player.y - 100;
// Player always has weapon so bullets are always enhanced
bullet.speed = 20;
bullet.scaleX = 1.2;
bullet.scaleY = 1.2;
bullets.push(bullet);
game.addChild(bullet);
LK.getSound('shoot').play();
shootTimer = 5; // Fast shooting since player always has weapon
}
} else {
// Regular screen tap - jump
player.jump();
}
}
};
game.update = function () {
if (gameState === 'playing') {
distance += gameSpeed / 10;
distanceText.setText(Math.floor(distance) + 'm');
// Update speed based on distance
updateSpeed();
// Spawn obstacles
spawnTimer++;
var spawnRate = (120 - Math.min(distance / 15, 50)) * invincibilitySpacing;
if (spawnTimer >= spawnRate) {
spawnObstacle();
spawnTimer = 0;
}
// Reset invincibility spacing after effect wears off
if (distance - lastInvincibilityTime > 300 && invincibilitySpacing > 1) {
invincibilitySpacing = 1;
}
// Update ground segments - make continuous
for (var i = 0; i < groundSegments.length; i++) {
var ground = groundSegments[i];
if (ground.x < -200) {
// Find the rightmost ground segment
var maxX = -1000;
for (var j = 0; j < groundSegments.length; j++) {
if (groundSegments[j].x > maxX) {
maxX = groundSegments[j].x;
}
}
ground.x = maxX + 200;
}
}
// Update and clean up holes
for (var i = holes.length - 1; i >= 0; i--) {
var hole = holes[i];
if (hole.x < -200) {
hole.destroy();
holes.splice(i, 1);
}
}
// Update and clean up enemies
for (var i = enemies.length - 1; i >= 0; i--) {
var enemy = enemies[i];
if (enemy.x < -100) {
enemy.destroy();
enemies.splice(i, 1);
}
}
// Update and clean up obstacles
for (var i = obstacles.length - 1; i >= 0; i--) {
var obstacle = obstacles[i];
if (obstacle.x < -100) {
obstacle.destroy();
obstacles.splice(i, 1);
}
}
// Update and clean up bullets
for (var i = bullets.length - 1; i >= 0; i--) {
var bullet = bullets[i];
if (bullet.x > 2200) {
bullet.destroy();
bullets.splice(i, 1);
}
}
// Update and clean up flying enemies
for (var i = flyingEnemies.length - 1; i >= 0; i--) {
var flyingEnemy = flyingEnemies[i];
if (flyingEnemy.x < -100) {
flyingEnemy.destroy();
flyingEnemies.splice(i, 1);
}
}
// Update shoot timer
if (shootTimer > 0) {
shootTimer--;
}
// Check collisions
checkCollisions();
// Update score
LK.setScore(Math.floor(distance));
// Check win condition
if (distance >= 10000) {
gameState = 'won';
LK.getSound('victoria').play();
LK.showYouWin();
return;
}
}
};
// Show instructions UI initially
game.addChild(instructionBox);
game.addChild(instructionTitle);
game.addChild(instructionText1);
game.addChild(instructionText2);
game.addChild(instructionText3);
game.addChild(instructionText4);
game.addChild(instructionText5);
game.addChild(closeInstructionsText);
// Add customization UI (initially hidden)
game.addChild(startButton);
game.addChild(character1Button);
game.addChild(character2Button);
game.addChild(character3Button);
// Initially hide character selection UI
character1Button.visible = false;
character2Button.visible = false;
character3Button.visible = false;
; ===================================================================
--- original.js
+++ change.js
@@ -210,9 +210,9 @@
/****
* Game Code
****/
-var gameState = 'customization'; // 'customization', 'ready', 'playing', 'gameOver'
+var gameState = 'instructions'; // 'instructions', 'customization', 'ready', 'playing', 'gameOver'
var selectedCharacter = 'player';
var player;
var groundSegments = [];
var holes = [];
@@ -265,8 +265,65 @@
fill: 0xFFFFFF
});
distanceText.anchor.set(0.5, 0);
LK.gui.top.addChild(distanceText);
+// Instructions UI
+var instructionBox = LK.getAsset('instructionBox', {
+ anchorX: 0.5,
+ anchorY: 0.5
+});
+instructionBox.x = 1024;
+instructionBox.y = 800;
+instructionBox.alpha = 0.8;
+var instructionTitle = new Text2('INSTRUCCIONES', {
+ size: 80,
+ fill: 0xFFFFFF
+});
+instructionTitle.anchor.set(0.5, 0.5);
+instructionTitle.x = 1024;
+instructionTitle.y = 500;
+var instructionText1 = new Text2('• Toca la pantalla para saltar', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+instructionText1.anchor.set(0.5, 0.5);
+instructionText1.x = 1024;
+instructionText1.y = 650;
+var instructionText2 = new Text2('• Usa el botón de fuego para disparar', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+instructionText2.anchor.set(0.5, 0.5);
+instructionText2.x = 1024;
+instructionText2.y = 720;
+var instructionText3 = new Text2('• Evita obstáculos y enemigos', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+instructionText3.anchor.set(0.5, 0.5);
+instructionText3.x = 1024;
+instructionText3.y = 790;
+var instructionText4 = new Text2('• Llega a 10,000m para ganar', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+instructionText4.anchor.set(0.5, 0.5);
+instructionText4.x = 1024;
+instructionText4.y = 860;
+var instructionText5 = new Text2('• Doble salto disponible', {
+ size: 50,
+ fill: 0xFFFFFF
+});
+instructionText5.anchor.set(0.5, 0.5);
+instructionText5.x = 1024;
+instructionText5.y = 930;
+var closeInstructionsText = new Text2('Toca para continuar', {
+ size: 40,
+ fill: 0xFFFF00
+});
+closeInstructionsText.anchor.set(0.5, 0.5);
+closeInstructionsText.x = 1024;
+closeInstructionsText.y = 1050;
var fireButton = LK.getAsset('fireButton', {
anchorX: 0.5,
anchorY: 0.5
});
@@ -297,8 +354,17 @@
startButton.visible = false;
character1Button.visible = false;
character2Button.visible = false;
character3Button.visible = false;
+ // Hide instructions UI
+ instructionBox.visible = false;
+ instructionTitle.visible = false;
+ instructionText1.visible = false;
+ instructionText2.visible = false;
+ instructionText3.visible = false;
+ instructionText4.visible = false;
+ instructionText5.visible = false;
+ closeInstructionsText.visible = false;
// Clear existing obstacles
clearAllObstacles();
// Reset player position
player.x = 400;
@@ -470,9 +536,25 @@
flyingEnemies[i].speed = -gameSpeed;
}
}
game.down = function (x, y, obj) {
- if (gameState === 'customization') {
+ if (gameState === 'instructions') {
+ // Any tap closes instructions and goes to character selection
+ gameState = 'customization';
+ // Hide instructions UI
+ instructionBox.visible = false;
+ instructionTitle.visible = false;
+ instructionText1.visible = false;
+ instructionText2.visible = false;
+ instructionText3.visible = false;
+ instructionText4.visible = false;
+ instructionText5.visible = false;
+ closeInstructionsText.visible = false;
+ // Show character selection UI
+ character1Button.visible = true;
+ character2Button.visible = true;
+ character3Button.visible = true;
+ } else if (gameState === 'customization') {
// Check character 1 button
if (x > 563 && x < 733 && y > 1050 && y < 1350) {
selectedCharacter = 'player';
player.setCharacter('player');
@@ -623,10 +705,23 @@
return;
}
}
};
-// Show customization UI initially
+// Show instructions UI initially
+game.addChild(instructionBox);
+game.addChild(instructionTitle);
+game.addChild(instructionText1);
+game.addChild(instructionText2);
+game.addChild(instructionText3);
+game.addChild(instructionText4);
+game.addChild(instructionText5);
+game.addChild(closeInstructionsText);
+// Add customization UI (initially hidden)
game.addChild(startButton);
game.addChild(character1Button);
game.addChild(character2Button);
game.addChild(character3Button);
+// Initially hide character selection UI
+character1Button.visible = false;
+character2Button.visible = false;
+character3Button.visible = false;
;
\ No newline at end of file
un agujero hecho con pixeles. In-Game asset. 2d. High contrast. No shadows
un mounstro grande hecho con pixeles con perspectiva de lado y mas aterrador In-Game asset. 2d. High contrast. No shadows
un suelo de pasto y tierra hecho con pixeles. In-Game asset. 2d. High contrast. No shadows
una pincho grande hecho con pixeles In-Game asset. 2d. High contrast. No shadows
una bala de pistola 9 milimetros hecha con pixeles con perspectiva lateral. In-Game asset. 2d. High contrast. No shadows
un mounstro con alas hecho con pixeles. In-Game asset. 2d. High contrast. No shadows
un puño agarrando un arma hecho con pixeles y de perspectiva lateral. In-Game asset. 2d. High contrast. No shadows
un boton rojo que en medio dice shot hecho con pixeles. In-Game asset. 2d. High contrast. No shadows
un boton cuadrado hecho con pixeles que dice play. In-Game asset. 2d. High contrast. No shadows
un hombre obrero hecho con pixeles de cuerpo completo sosteniendo un arma
un policia de cuerpo completo hecho con pixeles con persepectiva lateral apuntando con un arma I
un hombre de traje hecho con pixeles de cuerpo completo apuntando con un rifle de asalto m4
goku de dragon ball hecho con pixeles de cuepo completo con perspectiva lateral apuntando don un rifle de asalto m4 In-Game asset. 2d. High contrast. No shadows
homero simpson hecho con pixeles de cuerpo completo con perspectiva lateral apuntando con rifle de asalto m4 I
letras hechas con pixeles que dicen shot and jump las letras shot tendran un estilo medieval y tendran un color gris,las letras and color blanco con contorno negro y las letras jump de color amarillo con contorno naranja