User prompt
Add game over to all phases and fix collision in bullet to destroy the right enemy
User prompt
make sure that in every phase, you have to defeat all enemies for the portal to appear and add follow to enemy to follow the player
User prompt
Continue add colisão, follow, game over e outros nas fases a coans
User prompt
!fix does not go to the next phase when going to the open portal
User prompt
Make then walk faster to the portal
User prompt
Add the same function with all phases (infinites phases)
User prompt
When the player collide with the portal, it goes to the next stage
User prompt
If the portal is open, the player automatically walks to the portal, and goes to stage 2 with more enemies
User prompt
Add enemy follow, lk score, and game over lk
User prompt
Add bullet move
User prompt
The portal have a sprite, if all enemies are defeated, change to portal open
User prompt
Add all assets to serve for something
User prompt
Continue place more code and add functions move
User prompt
Make the game, but avançado
User prompt
Delete all code
Initial prompt
a shooting game
===================================================================
--- original.js
+++ change.js
@@ -1,68 +1,6 @@
/****
-* Classes
-****/
-// Bullet class
-var Bullet = Container.expand(function () {
- var self = Container.call(this);
- var bulletGraphics = self.attachAsset('bullet', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 10;
- self.update = function () {
- self.y -= self.speed;
- };
-});
-// The assets will be automatically created and loaded by the LK engine
-// Player class
-var Player = Container.expand(function () {
- var self = Container.call(this);
- var playerGraphics = self.attachAsset('player', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.update = function () {
- // Player movement and shooting logic goes here
- };
-});
-
-/****
* Initialize Game
****/
var game = new LK.Game({
- backgroundColor: 0x000000 // Init game with black background
-});
-
-/****
-* Game Code
-****/
-// Initialize player
-var player = game.addChild(new Player());
-player.x = 2048 / 2;
-player.y = 2732 - 200;
-// Initialize bullets array
-var bullets = [];
-// Game update function
-game.update = function () {
- // Update bullets
- for (var i = bullets.length - 1; i >= 0; i--) {
- var bullet = bullets[i];
- if (bullet.y < 0) {
- bullets.splice(i, 1);
- bullet.destroy();
- }
- }
-};
-// Game touch events
-game.down = function (x, y, obj) {
- // Fire bullet
- var bullet = new Bullet();
- bullet.x = player.x;
- bullet.y = player.y;
- bullets.push(bullet);
- game.addChild(bullet);
-};
-game.move = function (x, y, obj) {
- // Move player
- player.x = x;
-};
\ No newline at end of file
+ backgroundColor: 0x000000
+});
\ No newline at end of file
character with a gun looking from above. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Bullet. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
background of an abandoned street. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.