Search the Community
Showing results for tags 'coffeescript'.
Found 5 results
Coffeescript + Phaser + NW = Uncaught TypeError
Update timer seconds value!
malav1410 posted a topic in Coding and Game DesignIn my game, i have a timer event which will run for 60 seconds. This is a startGame function in coffeescript. Which has a time event in bold letters. I passed @seconds_counter value which is 60. So this timer will count till 60 seconds and afterthat calls @removeCounter function. startGame: -> left_button = @add.button(60, 350, 'button', @checkAnswerForLeft, this) right_button = @add.button(460, 350, 'button', @checkAnswerForRight, this) @time.events.remove @timer # Start main game counter @seconds_timer = @time.events.loop(Phaser.Timer.SECOND, @updateSecondsCounter, this) @time.events.add Phaser.Timer.SECOND * @seconds_counter, @removeCounter, this In my game i want to give users a time bonus in which i want to add extra seconds to this time event. I added 10 seconds to @seconds_counter but it won't affect this timer event. So in short, my game loop is 60 seconds. If user get time bonus then add 10 seconds to game loop so for that user gae will be of 70 seconds and after that @removeCounter function should call. Is there any way to update time for running timer??
Project Template for Phaser games in Meteor