User prompt
when clicked light, spawn light unit , when medium clicked spawn medium unit . also for heavy
User prompt
don't spawn automatic units, units should spawn when user clicks buttons and the gold cost should br redacted from gold
User prompt
put buttons for spawning units, also player should earn gold every second, have three different units for every age
Code edit (1 edits merged)
Please save this source code
User prompt
Age of Defense: Evolution Wars
Initial prompt
Create a 2D mobile strategy-defense game inspired by ‘Age of War.’ The game must be optimized for Android and iOS. Use a side-view 2D layout. Core mechanics: • The player’s base is on the left, the enemy base is on the right. Each base has health points (HP). • Both sides spawn units automatically. Units walk toward the opponent’s base and attack when they meet enemy units. • The player earns gold by killing enemy units. Gold is used to spawn new units. • The player can upgrade through ages: Stone Age → Medieval Age → Modern Age → Future Age. • Each age unlocks stronger units, better base design, and a more powerful base weapon. • The base has a defensive turret that automatically shoots enemies. • The game ends when one base’s HP reaches 0. Gameplay rules: • Units move left-to-right (player side) and right-to-left (enemy side). • Units attack automatically when in range. • Each unit has stats: HP, attack, speed, cost. • Age upgrades require gold and trigger visual + gameplay changes. • Difficulty increases as the enemy upgrades ages and spawns stronger units. Mobile requirements: • Responsive UI with touch controls (buttons for spawning units, upgrading age, and showing gold/HP). • Optimized for smooth performance on both Android and iOS. • Simple, cartoon-like art style for readability on small screens. • Include basic sound effects for spawning, attacking, and upgrading. • Ensure the game runs in both portrait and landscape modes. Deliverables: • Core game loop (spawn units, fight, earn gold, upgrade ages). • Enemy AI that automatically spawns units and upgrades. • Mobile-friendly UI (gold counter, age upgrade button, unit spawn buttons, HP bar for both bases). • Scene management: main menu, gameplay, game over screen. • Code structured for scalability (easy to add more units or ages later)
/**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 });
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});