User prompt
increce sppeed enemy
User prompt
increce speed
User prompt
Please fix the bug: 'player is not defined' in or related to this line: 'player.x = 2048 / 2;' Line Number: 82
User prompt
add nukes and bows
User prompt
reduce lag
User prompt
make bomb enemys that explode when you get too cloce
User prompt
increse enemy
User prompt
faster
User prompt
make the ememy faster
User prompt
useing mouse
User prompt
doge but the enemy speed is fast
User prompt
make so you can doge but more enemys an speed
User prompt
make itimmpossable
User prompt
make possable but immpossable game
Initial prompt
infinity dash
===================================================================
--- original.js
+++ change.js
@@ -1,9 +1,47 @@
-/****
-* Initialize Game
-****/
+/****
+* Classes
+****/
+var Enemy = Container.expand(function () {
+ var self = Container.call(this);
+ var enemyGraphics = self.attachAsset('enemy', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ // Enemy movement logic goes here
+ };
+});
//<Assets used in the game will automatically appear here>
//<Write imports for supported plugins here>
-//<Write entity 'classes' with empty functions for important behavior here>
+var Player = Container.expand(function () {
+ var self = Container.call(this);
+ var playerGraphics = self.attachAsset('player', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.update = function () {
+ game.update = function () {
+ if (player.intersects(enemy)) {
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ }
+ };
+ };
+});
+
+/****
+* Initialize Game
+****/
var game = new LK.Game({
- backgroundColor: 0x000000 //Init game with black background
-});
\ No newline at end of file
+ backgroundColor: 0x000000 //Init game with black background
+});
+
+/****
+* Game Code
+****/
+var player = game.addChild(new Player());
+player.x = 2048 / 2;
+player.y = 2732 / 2;
+var enemy = game.addChild(new Enemy());
+enemy.x = Math.random() * 2048;
+enemy.y = Math.random() * 2732;
\ No newline at end of file