User prompt
Add a background
User prompt
Every document you get make a 1/10 change to spawn a 500 x 500 size drone to kill the player
User prompt
Make 1 out of every 10 drones 200x200 size and able to kill the ai
User prompt
Every drone the ai eat spawn 2 more
User prompt
After you get 10 documents make 200x200 drone spawn the drones x2 and let the player eat\delete 100x100 drones
User prompt
Kill squares are not spawning fix it
User prompt
After you get ten documents start spawning kill squares
User prompt
Make all kill squares and drones spawn at the top and sides
User prompt
Only start spawning enemies and kill squares one second after the start
User prompt
Make it so the kill squares spawn at least 100 pixels above you on spawn
User prompt
Make the closest that they can spawn at the start 50 pixels away
User prompt
Make the closest any thing can spawn from you at the start 10 pixels away
User prompt
Make the kill squares move on the side at the same speed as drones
User prompt
Add random 100x200 and 200x100 squares that kill you
User prompt
At the start spawn 10 documents
User prompt
Make it so every five documents you eat five more spawn randomly
Initial prompt
Ai feed and grow
===================================================================
--- original.js
+++ change.js
@@ -1,100 +1,109 @@
-/****
+/****
* Classes
-****/
+****/
//<Assets used in the game will automatically appear here>
// AI class representing the player's character
var AI = Container.expand(function () {
- var self = Container.call(this);
- var aiGraphics = self.attachAsset('ai', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 5;
- self.update = function () {
- // AI movement logic can be added here
- };
+ var self = Container.call(this);
+ var aiGraphics = self.attachAsset('ai', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 5;
+ self.update = function () {
+ // AI movement logic can be added here
+ };
});
// Document class representing the items AI can consume
var Document = Container.expand(function () {
- var self = Container.call(this);
- var documentGraphics = self.attachAsset('document', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.update = function () {
- // Document behavior logic can be added here
- };
+ var self = Container.call(this);
+ var documentGraphics = self.attachAsset('document', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ // Document behavior logic can be added here
+ };
});
// Drone class representing the enemies
var Drone = Container.expand(function () {
- var self = Container.call(this);
- var droneGraphics = self.attachAsset('drone', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 3;
- self.update = function () {
- self.y += self.speed;
- if (self.y > 2732) {
- self.y = -self.height;
- }
- };
+ var self = Container.call(this);
+ var droneGraphics = self.attachAsset('drone', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 3;
+ self.update = function () {
+ self.y += self.speed;
+ if (self.y > 2732) {
+ self.y = -self.height;
+ }
+ };
});
-/****
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000 //Init game with black background
+ backgroundColor: 0x000000 //Init game with black background
});
-/****
+/****
* Game Code
-****/
+****/
// Initialize game variables
var ai = game.addChild(new AI());
ai.x = 2048 / 2;
ai.y = 2732 - 200;
var documents = [];
var drones = [];
// Create initial documents and drones
for (var i = 0; i < 5; i++) {
- var document = new Document();
- document.x = Math.random() * 2048;
- document.y = Math.random() * 2732;
- documents.push(document);
- game.addChild(document);
- var drone = new Drone();
- drone.x = Math.random() * 2048;
- drone.y = Math.random() * 2732;
- drones.push(drone);
- game.addChild(drone);
+ var document = new Document();
+ document.x = Math.random() * 2048;
+ document.y = Math.random() * 2732;
+ documents.push(document);
+ game.addChild(document);
+ var drone = new Drone();
+ drone.x = Math.random() * 2048;
+ drone.y = Math.random() * 2732;
+ drones.push(drone);
+ game.addChild(drone);
}
// Handle AI movement
game.move = function (x, y, obj) {
- ai.x = x;
- ai.y = y;
+ ai.x = x;
+ ai.y = y;
};
// Update game logic
game.update = function () {
- // Check for collisions between AI and documents
- for (var i = documents.length - 1; i >= 0; i--) {
- if (ai.intersects(documents[i])) {
- documents[i].destroy();
- documents.splice(i, 1);
- // Increase AI size or score
- }
- }
- // Check for collisions between AI and drones
- for (var j = drones.length - 1; j >= 0; j--) {
- if (ai.intersects(drones[j])) {
- // Handle collision with drone (e.g., game over)
- LK.effects.flashScreen(0xff0000, 1000);
- LK.showGameOver();
- }
- }
- // Update drones
- for (var k = 0; k < drones.length; k++) {
- drones[k].update();
- }
+ // Check for collisions between AI and documents
+ for (var i = documents.length - 1; i >= 0; i--) {
+ if (ai.intersects(documents[i])) {
+ documents[i].destroy();
+ documents.splice(i, 1);
+ // Increase AI size or score
+ if ((5 - documents.length) % 5 === 0) {
+ for (var n = 0; n < 5; n++) {
+ var newDocument = new Document();
+ newDocument.x = Math.random() * 2048;
+ newDocument.y = Math.random() * 2732;
+ documents.push(newDocument);
+ game.addChild(newDocument);
+ }
+ }
+ }
+ }
+ // Check for collisions between AI and drones
+ for (var j = drones.length - 1; j >= 0; j--) {
+ if (ai.intersects(drones[j])) {
+ // Handle collision with drone (e.g., game over)
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ }
+ }
+ // Update drones
+ for (var k = 0; k < drones.length; k++) {
+ drones[k].update();
+ }
};
\ No newline at end of file
A yellow folder document. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A evil cartoon drone. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A fun loving hungry cartoon drone with a giant mouth. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A cartoon flying police car. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A top down view of a city. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.