I am developing a HTML5 game in javascript. Now I have created a few bots and they should be able to change their orientation after a few seconds/a fixed timestamp in the game loop.
Suppose my game loop is like this:
function loop() {
bots.updateOrientation();
bots.render();
player.update();
player.render();
requestAnimationFrame(loop);
}
How can I make that happen in my game loop?
No comments:
Post a Comment