var Hero = Container.expand(function () { var self = Container.call(this); var heroGraphics = self.createAsset('hero', 'Hero character', .5, .5); self.speed = 5; self.move = function () {}; self.jump = function () {}; self.shoot = function () {}; self.update = function () {}; }); var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5); self.speed = 3; self.move = function () {}; self.attack = function () {}; }); var HeroBullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.createAsset('heroBullet', 'Hero Bullet', .5, .5); self.speed = 10; self.move = function () {}; }); var EnemyBullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.createAsset('enemyBullet', 'Enemy Bullet', .5, .5); self.speed = 7; 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 = 1024; hero.y = 1366; LK.on('tick', function () { hero.update(); for (var i = 0; i < enemies.length; i++) { enemies[i].update(); } for (var i = 0; i < heroBullets.length; i++) { heroBullets[i].update(); } for (var i = 0; i < enemyBullets.length; i++) { enemyBullets[i].update(); } }); self.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); if (pos.x > hero.x) { hero.move(); } else { hero.shoot(); } }); });
===================================================================
--- original.js
+++ change.js
@@ -4,8 +4,9 @@
self.speed = 5;
self.move = function () {};
self.jump = function () {};
self.shoot = function () {};
+ self.update = function () {};
});
var Enemy = Container.expand(function () {
var self = Container.call(this);
var enemyGraphics = self.createAsset('enemy', 'Enemy character', .5, .5);
Hero Character for platformer game Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Enemy turtle for survival game Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Bullet from bullethell Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
healthbar Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Epic brawl stars styled Background Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.