User prompt
Move the menu asset down a lot more
User prompt
Move the menu asset down a lot
User prompt
Move the menu asset down a lot
User prompt
Make the menu asset a bit bigger
User prompt
Make the menu asset bigger
User prompt
Make the menu asset 3x bigger
User prompt
Make the menu asset realy big
User prompt
Make it really big
User prompt
Add the menu asset
User prompt
Move it s little higher
User prompt
Move it down
User prompt
More to the left
User prompt
And move it to the left a lot
User prompt
Make it 2x bigger
User prompt
Add slime asset to the screen
User prompt
DELETE THE CUBES AND THE LOGIC
User prompt
No i mean delete the game itself its nothing like what i want. Make just a green background
User prompt
Delete all that,
Initial prompt
Slime battle
/**** * Initialize Game ****/ //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> var game = new LK.Game({ backgroundColor: 0x008000 //Init game with green background });
===================================================================
--- original.js
+++ change.js
@@ -1,114 +1,8 @@
-/****
-* Classes
-****/
-// Define a class for bullets
-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;
- // Destroy the bullet if it goes off the screen
- if (self.y < 0 || self.y > 2732) {
- self.destroy();
- }
- };
-});
-// Define a class for enemies
-var Enemy = Container.expand(function () {
- var self = Container.call(this);
- var enemyGraphics = self.attachAsset('enemy', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 2;
- self.update = function () {
- self.y += self.speed;
- if (self.y > 2732) {
- self.y = 0;
- self.x = Math.random() * 2048;
- }
- };
-});
+/****
+* Initialize Game
+****/
//<Assets used in the game will automatically appear here>
//<Write imports for supported plugins here>
-// Define a class for the player character
-var Player = Container.expand(function () {
- var self = Container.call(this);
- var playerGraphics = self.attachAsset('player', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 5;
- self.update = function () {
- // Update logic for player
- };
-});
-
-/****
-* Initialize Game
-****/
var game = new LK.Game({
backgroundColor: 0x008000 //Init game with green background
-});
-
-/****
-* Game Code
-****/
-// Initialize player
-var player = game.addChild(new Player());
-player.x = 1024;
-player.y = 2500;
-// Initialize enemies
-var enemies = [];
-for (var i = 0; i < 5; i++) {
- var enemy = new Enemy();
- enemy.x = Math.random() * 2048;
- enemy.y = Math.random() * 1000;
- enemies.push(enemy);
- game.addChild(enemy);
-}
-// Initialize bullets
-var bullets = [];
-// Handle player movement
-game.move = function (x, y, obj) {
- player.x = x;
- player.y = y;
-};
-// Handle shooting
-game.down = function (x, y, obj) {
- var bullet = new Bullet();
- bullet.x = player.x;
- bullet.y = player.y;
- bullets.push(bullet);
- game.addChild(bullet);
-};
-// Update game state
-game.update = function () {
- // Update enemies
- for (var i = 0; i < enemies.length; i++) {
- enemies[i].update();
- }
- // Update bullets
- for (var j = bullets.length - 1; j >= 0; j--) {
- bullets[j].update();
- if (bullets[j].y < 0) {
- bullets.splice(j, 1);
- }
- }
- // Check for collisions
- for (var k = bullets.length - 1; k >= 0; k--) {
- for (var l = enemies.length - 1; l >= 0; l--) {
- if (bullets[k].intersects(enemies[l])) {
- bullets[k].destroy();
- enemies[l].destroy();
- bullets.splice(k, 1);
- enemies.splice(l, 1);
- break;
- }
- }
- }
-};
\ No newline at end of file
+});
\ No newline at end of file