User prompt
coloca otra orbita con cada click que tenga 200px y con cada click aumenten 50px
User prompt
orbita global para todos los objetos e intancias
User prompt
que todos los objetos giren con orbit
User prompt
todos los objetos y orbitas que se creen giraran tambien en su orbita
User prompt
todas las orbitas reaccionan al click del mouse
User prompt
todas las instancias y orbitas se crean desde el centro de la pantalla
User prompt
todas las orbitas que se crean salen desde el centro de la pantalla
User prompt
las instancias tambien se mueven en orbita en distancias relativas entre ellas
User prompt
con los click del mouse se crean instancias de las orbitas
User prompt
con cada click del mouse se crea una nueva orbita
User prompt
haz que las orbitas cambien de tamaño con los click del mouse
User prompt
cada click aumental el radio de las orbitas 100px
User prompt
con cada click las orbitas aplian el radio
User prompt
el jugador no avanza si no las orbitas
User prompt
el jugador solo se movera una orbira y luego quienes se muefven con cada click hacia afuera de la pantalla son las orbitas hacia el jugador
User prompt
que el rumbo del jugador sea el centro de la pantalla y en un punto con cada click se crea una nueva orbita
User prompt
crea un buble infinito de orbitas que vienen saliendo mientras el jugador avanza
User prompt
avanzara cada click del mouse y se colocara en la siguiente orbita o la mas sercana
User prompt
revierte el ultimo mandato
User prompt
haz que avancd relativo a las orbitas
User prompt
que el jugador sea ballplayer
User prompt
coloca un jugador an la parte de abajo de la pantalla
User prompt
coloca otra de orbita de 200px
User prompt
coloca un intancia del mismo enemigo con una orbita de 800px
User prompt
colocalo en el centro de la pantalla y que gire en una orbita de un radio 400px
/**** * Classes ****/ // Position near the top // Define Enemy class var Enemy = Container.expand(function () { var self = Container.call(this); // Attach enemy asset var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); // Set initial position and movement properties self.speed = 2; self.direction = 1; // 1 for right, -1 for left // Update method for enemy movement self.update = function () { self.x += self.speed * self.direction; // Reverse direction if enemy hits screen bounds if (self.x < 0 || self.x > 2048) { self.direction *= -1; } }; }); // Define Player class var Player = Container.expand(function () { var self = Container.call(this); // Attach player asset var playerGraphics = self.attachAsset('Ballplayer', { anchorX: 0.5, anchorY: 0.5 }); // Set initial position and movement properties self.speed = 5; // Update method for player movement self.update = function () { // Player remains stationary, no movement towards the center }; }); /**** * Initialize Game ****/ // Reset Assets section to initial state // Reset Asteroid class definition //<Assets used in the game will automatically appear here> // Reset Planet class definition // Reset Star class definition // Reset Initialize Game section to initial state // Reset Game Code section to initial state var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Add a player to the game var player = game.addChild(new Player()); // Set initial position of the player player.x = 1024; // Center horizontally player.y = 2500; // Position near the bottom // Define orbits var orbits = [200, 400, 800]; // Function to find the next closest orbit function getNextOrbit(currentY) { var currentOrbit = 2732 - currentY; for (var i = 0; i < orbits.length; i++) { if (orbits[i] > currentOrbit) { return 2732 - orbits[i]; } } // Add a new orbit to the end of the array to create an infinite loop var newOrbit = 200; // New orbit with a fixed radius of 200px orbits.push(newOrbit); return 2732 - newOrbit; } // Add event listener for mouse click game.down = function (x, y, obj) { // Player remains stationary, orbits move towards the player // Move existing orbits towards the player for (var i = 0; i < orbits.length; i++) { orbits[i] += 50; // Increase the radius of each orbit by 50 // Adjust the size of the orbiting enemies if (i === 0) { enemy3.orbitRadius = orbits[i]; } else if (i === 1) { enemy.orbitRadius = orbits[i]; } else if (i === 2) { enemy2.orbitRadius = orbits[i]; } } // Add a new orbit with each click var newOrbit = orbits[orbits.length - 1] + 200; orbits.push(newOrbit); }; // Add an enemy to the game var enemy = game.addChild(new Enemy()); // Set initial position of the enemy enemy.x = 1024; // Center horizontally enemy.y = 1366; // Center vertically // Add orbiting behavior enemy.orbitRadius = 400; enemy.orbitAngle = 0; enemy.orbitSpeed = 0.01; // Add a second enemy with a larger orbit radius var enemy2 = game.addChild(new Enemy()); // Set initial position of the second enemy enemy2.x = 1024; // Center horizontally enemy2.y = 1366; // Center vertically // Add orbiting behavior for the second enemy enemy2.orbitRadius = 800; enemy2.orbitAngle = 0; enemy2.orbitSpeed = 0.01; // Add a third enemy with a smaller orbit radius var enemy3 = game.addChild(new Enemy()); // Set initial position of the third enemy enemy3.x = 1024; // Center horizontally enemy3.y = 1366; // Center vertically // Add orbiting behavior for the third enemy enemy3.orbitRadius = 200; enemy3.orbitAngle = 0; enemy3.orbitSpeed = 0.01; // Update method for orbiting game.update = function () { enemy.orbitAngle += enemy.orbitSpeed; enemy.x = 1024 + enemy.orbitRadius * Math.cos(enemy.orbitAngle); enemy.y = 1366 + enemy.orbitRadius * Math.sin(enemy.orbitAngle); enemy2.orbitAngle += enemy2.orbitSpeed; enemy2.x = 1024 + enemy2.orbitRadius * Math.cos(enemy2.orbitAngle); enemy2.y = 1366 + enemy2.orbitRadius * Math.sin(enemy2.orbitAngle); enemy3.orbitAngle += enemy3.orbitSpeed; enemy3.x = 1024 + enemy3.orbitRadius * Math.cos(enemy3.orbitAngle); enemy3.y = 1366 + enemy3.orbitRadius * Math.sin(enemy3.orbitAngle); };
===================================================================
--- original.js
+++ change.js
@@ -70,18 +70,18 @@
return 2732 - orbits[i];
}
}
// Add a new orbit to the end of the array to create an infinite loop
- var newOrbit = orbits[orbits.length - 1] + 200;
+ var newOrbit = 200; // New orbit with a fixed radius of 200px
orbits.push(newOrbit);
return 2732 - newOrbit;
}
// Add event listener for mouse click
game.down = function (x, y, obj) {
// Player remains stationary, orbits move towards the player
// Move existing orbits towards the player
for (var i = 0; i < orbits.length; i++) {
- orbits[i] += 100; // Increase the radius of each orbit by 100
+ orbits[i] += 50; // Increase the radius of each orbit by 50
// Adjust the size of the orbiting enemies
if (i === 0) {
enemy3.orbitRadius = orbits[i];
} else if (i === 1) {
@@ -92,15 +92,8 @@
}
// Add a new orbit with each click
var newOrbit = orbits[orbits.length - 1] + 200;
orbits.push(newOrbit);
- // Create a new enemy for the new orbit
- var newEnemy = game.addChild(new Enemy());
- newEnemy.x = 1024; // Center horizontally
- newEnemy.y = 1366; // Center vertically
- newEnemy.orbitRadius = newOrbit;
- newEnemy.orbitAngle = 0;
- newEnemy.orbitSpeed = 0.01;
};
// Add an enemy to the game
var enemy = game.addChild(new Enemy());
// Set initial position of the enemy
@@ -129,11 +122,14 @@
enemy3.orbitAngle = 0;
enemy3.orbitSpeed = 0.01;
// Update method for orbiting
game.update = function () {
- var allObjects = [player, enemy, enemy2, enemy3];
- for (var i = 0; i < allObjects.length; i++) {
- allObjects[i].orbitAngle += allObjects[i].orbitSpeed;
- allObjects[i].x = 1024 + allObjects[i].orbitRadius * Math.cos(allObjects[i].orbitAngle);
- allObjects[i].y = 1366 + allObjects[i].orbitRadius * Math.sin(allObjects[i].orbitAngle);
- }
+ enemy.orbitAngle += enemy.orbitSpeed;
+ enemy.x = 1024 + enemy.orbitRadius * Math.cos(enemy.orbitAngle);
+ enemy.y = 1366 + enemy.orbitRadius * Math.sin(enemy.orbitAngle);
+ enemy2.orbitAngle += enemy2.orbitSpeed;
+ enemy2.x = 1024 + enemy2.orbitRadius * Math.cos(enemy2.orbitAngle);
+ enemy2.y = 1366 + enemy2.orbitRadius * Math.sin(enemy2.orbitAngle);
+ enemy3.orbitAngle += enemy3.orbitSpeed;
+ enemy3.x = 1024 + enemy3.orbitRadius * Math.cos(enemy3.orbitAngle);
+ enemy3.y = 1366 + enemy3.orbitRadius * Math.sin(enemy3.orbitAngle);
};
\ No newline at end of file
Dead
Sound effect
MusicaInicio
Music
musica4
Music
musica1
Music
musica7
Music
musica10
Music
musica13
Music
musica16
Music
musica19
Music
musica22
Music
musica25
Music
musica28
Music
musica2
Music
musica3
Music
musica5
Music
musica6
Music
musica8
Music
musica9
Music
musica11
Music
musica12
Music
musica14
Music
musica15
Music
musica17
Music
musica18
Music
musica20
Music
musica21
Music
musica23
Music
musica24
Music
musica26
Music
musica27
Music
musica29
Music
musica30
Music