User prompt
Migrate to the latest version of LK
User prompt
make the power-ups disappear when the hero moves over them
User prompt
make the game more fun
User prompt
make the hero move faster
User prompt
make the hero continue moving towards the pointer
User prompt
make the hero movement better
User prompt
I want to be able to move the hero ffs
User prompt
Fix Bug: 'TypeError: hero.move is not a function' in this line: 'hero.move();' Line Number: 55
User prompt
Fix Bug: 'TypeError: hero.move is not a function' in this line: 'hero.move();' Line Number: 55
User prompt
remove hero move logic
User prompt
invoke the `move` method on the `hero` instance within the `Game` class
User prompt
Make this game more fun
User prompt
Fix Bug: 'Uncaught TypeError: Graphics is not a constructor' in this line: 'var frame = new Graphics();' Line Number: 25
User prompt
Make a frame that is 10 px at the edges of the screen
User prompt
Make the enemies move
User prompt
Make the enemies move in different directions. When they hit the frame, they should change direction towards the hero
User prompt
Create a frame that is 10 px wide at the end of the screens
User prompt
make the enemies move in random direction
User prompt
Remove the brown hero square
Initial prompt
Super Evil Game
var Hero = Container.expand(function () { var self = Container.call(this); var heroGraphics = self.createAsset('hero', 'Hero character', .5, .5); self.move = function () {}; self.shoot = function () {}; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5); self.move = function () { self.x += Math.random() * 10 - 5; self.y += Math.random() * 10 - 5; }; self.shoot = function () {}; }); var HeroBullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.createAsset('heroBullet', 'Hero Bullet', .5, .5); self.move = function () {}; }); var EnemyBullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.createAsset('enemyBullet', 'Enemy Bullet', .5, .5); self.move = function () {}; }); var Game = Container.expand(function () { var self = Container.call(this); var hero = self.addChild(new Hero()); var enemies = []; var heroBullets = []; var enemyBullets = []; hero.x = 2048 / 2; hero.y = 2732 / 2; for (var i = 0; i < 5; i++) { var enemy = new Enemy(); enemy.x = Math.random() * 2048; enemy.y = Math.random() * 2732; enemies.push(enemy); self.addChild(enemy); } LK.on('tick', function () { hero.move(); enemies.forEach(function (enemy) { enemy.move(); }); heroBullets.forEach(function (bullet) { bullet.move(); }); enemyBullets.forEach(function (bullet) { bullet.move(); }); if (LK.ticks % 60 == 0) { var heroBullet = new HeroBullet(); heroBullet.x = hero.x; heroBullet.y = hero.y; heroBullets.push(heroBullet); self.addChild(heroBullet); enemies.forEach(function (enemy) { var enemyBullet = new EnemyBullet(); enemyBullet.x = enemy.x; enemyBullet.y = enemy.y; enemyBullets.push(enemyBullet); self.addChild(enemyBullet); }); } }); });
===================================================================
--- original.js
+++ change.js
@@ -1,13 +1,17 @@
var Hero = Container.expand(function () {
var self = Container.call(this);
+ var heroGraphics = self.createAsset('hero', 'Hero character', .5, .5);
self.move = function () {};
self.shoot = function () {};
});
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5);
- self.move = function () {};
+ self.move = function () {
+ self.x += Math.random() * 10 - 5;
+ self.y += Math.random() * 10 - 5;
+ };
self.shoot = function () {};
});
var HeroBullet = Container.expand(function () {
var self = Container.call(this);