diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2011-08-05 08:31:29 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2011-08-05 08:31:29 +0300 |
| commit | bb02dc5b8b2788abe92b119817c334824308fd06 (patch) | |
| tree | d24496e49ea8ad326cf89aa8c0bf2f040ea8e25c | |
| parent | 44c899dbdedfaa445b5e4c999178142de9e75a17 (diff) | |
| download | catgag-bb02dc5b8b2788abe92b119817c334824308fd06.tar.gz catgag-bb02dc5b8b2788abe92b119817c334824308fd06.zip | |
Modify Cat to use ResourceMan
| -rw-r--r-- | Cat.js | 16 |
1 files changed, 5 insertions, 11 deletions
@@ -15,20 +15,14 @@ var p = Cat.prototype = new Container(); p.initialize = function() { p.base_initialize(); - var _this = this; - - this.img = new Image(); - this.img.onload = function() { _this.setup(); }; - this.img.src = "gfx/cat.jpg"; - }; - - p.setup = function() { + this.img = Game.resMan.get("cat"); this.gfx = new Bitmap(this.img); - this.addChild(this.gfx); - + this.regX = this.img.width / 2; this.regY = this.img.height / 2; - } + + this.addChild(this.gfx); + }; p.tick = function() { if (this._barrelRolling) { |
