Last active
June 28, 2019 21:37
-
-
Save zaynyatyi/8fec96fff7094dc578b5 to your computer and use it in GitHub Desktop.
Actuate in kha using manual update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import motion.actuators.SimpleActuator; | |
class Game | |
{ | |
public function new() | |
{ | |
} | |
public function render(framebuffer:Framebuffer):Void | |
{ | |
} | |
public function update():Void | |
{ | |
SimpleActuator.stage_onEnterFrame(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var project = new Project('Game'); | |
project.addDefine('actuate_manual_time'); | |
project.addDefine('actuate_manual_update'); | |
project.addLibrary('actuate'); | |
project.addSources('Sources'); | |
project.addAssets('Assets/**'); | |
return project; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import motion.actuators.SimpleActuator; | |
import kha.Scheduler; | |
import kha.System; | |
class Main | |
{ | |
public static function main() | |
{ | |
System.init("Game", 0, 0, initialized); | |
} | |
static function initialized():Void | |
{ | |
SimpleActuator.getTime = Scheduler.time; | |
var game:Game = new Game(); | |
System.notifyOnRender(game.render); | |
Scheduler.addTimeTask(game.update, 0, 1 / 60); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment