Search the Community
Showing results for tags 'stabe-based-game'.
-
Hi guys, I bet this is a really dumb question, but I can't seem to get timers to work. It's in a state based game, and other calls to the game (this) are working perfectly fine. This is the exact error thrown by FireFox. TypeError: this.time.create is not a functionChromium throws: Uncaught TypeError: Object #<Object> has no method 'create' (index):56States.Game.create (index):56d.StateManager.loadComplete phaser.min.js:4d.Game.loadComplete phaser.min.js:5d.SignalBinding.execute phaser.min.js:4d.Signal.dispatch phaser.min.js:4dispatch phaser.min.js:4d.Loader.nextFile phaser.min.js:10d.Loader.fileComplete phaser.min.js:9a.data.onloadHere is my code (if you need to see more let me know) : States.Game = function (game) { ... var timer; };States.Game.prototype = { ... create: function () { ... timer = this.time.create(false); timer.add(500, spawnEnemy, this.context); timer.start(); }, ...}I'm fairly new to JS (I have the most experience with Java, but am not an expert by any means) so there might be some structure issues with the code. Any help would be appreciated.
- 6 replies
-
- javascript
- noob
-
(and 3 more)
Tagged with: