User prompt
make circle around start
Code edit (1 edits merged)
Please save this source code
User prompt
Migrate to the latest version of LK
User prompt
Fix Bug: 'Uncaught TypeError: Graphics is not a constructor' in this line: 'var startButton = new Graphics();' Line Number: 341
User prompt
Fix Bug: 'Uncaught TypeError: Graphics is not a constructor' in this line: 'var levelProgress = new Graphics();' Line Number: 274
User prompt
Fix Bug: 'Uncaught TypeError: Graphics is not a constructor' in this line: 'var levelBar = new Graphics();' Line Number: 268
User prompt
Fix Bug: 'Uncaught TypeError: Graphics is not a constructor' in this line: 'var modalBackground = new Graphics();' Line Number: 30
User prompt
Fix Bug: 'Uncaught TypeError: Graphics is not a constructor' in this line: 'var gridGraphics = new Graphics();' Line Number: 126
Code edit (1 edits merged)
Please save this source code
User prompt
Add stars to the background
User prompt
Remove everything from the game
Initial prompt
Rogue Defuse
var Bomb = Container.expand(function () { var self = Container.call(this); var bombGraphics = self.createAsset('bomb', 'Bomb Graphics', .5, .5); self.defuse = function () {}; }); var Hero = Container.expand(function () { var self = Container.call(this); var heroGraphics = self.createAsset('hero', 'Hero Graphics', .5, .5); self.move = function () {}; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.createAsset('enemy', 'Enemy Graphics', .5, .5); self.attack = function () {}; }); var Game = Container.expand(function () { var self = Container.call(this); var starGraphics = self.createAsset('stars', 'Stars Background', 0, 0); starGraphics.width = 2048; starGraphics.height = 2732; self.addChild(starGraphics); var hero = self.addChild(new Hero()); hero.x = 2048 / 2; hero.y = 2732 / 2; var bombs = []; var enemies = []; LK.on('tick', function () { hero.move(); for (var i = 0; i < bombs.length; i++) { bombs[i].defuse(); } for (var i = 0; i < enemies.length; i++) { enemies[i].attack(); } }); stage.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); hero.x = pos.x; hero.y = pos.y; }); stage.on('up', function (obj) { var bomb = new Bomb(); bomb.x = hero.x; bomb.y = hero.y; bombs.push(bomb); self.addChild(bomb); }); });
var Bomb = Container.expand(function () {
var self = Container.call(this);
var bombGraphics = self.createAsset('bomb', 'Bomb Graphics', .5, .5);
self.defuse = function () {};
});
var Hero = Container.expand(function () {
var self = Container.call(this);
var heroGraphics = self.createAsset('hero', 'Hero Graphics', .5, .5);
self.move = function () {};
});
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('enemy', 'Enemy Graphics', .5, .5);
self.attack = function () {};
});
var Game = Container.expand(function () {
var self = Container.call(this);
var starGraphics = self.createAsset('stars', 'Stars Background', 0, 0);
starGraphics.width = 2048;
starGraphics.height = 2732;
self.addChild(starGraphics);
var hero = self.addChild(new Hero());
hero.x = 2048 / 2;
hero.y = 2732 / 2;
var bombs = [];
var enemies = [];
LK.on('tick', function () {
hero.move();
for (var i = 0; i < bombs.length; i++) {
bombs[i].defuse();
}
for (var i = 0; i < enemies.length; i++) {
enemies[i].attack();
}
});
stage.on('down', function (obj) {
var event = obj.event;
var pos = event.getLocalPosition(self);
hero.x = pos.x;
hero.y = pos.y;
});
stage.on('up', function (obj) {
var bomb = new Bomb();
bomb.x = hero.x;
bomb.y = hero.y;
bombs.push(bomb);
self.addChild(bomb);
});
});