Jump to content

Clock Based Mortal Kombat Style Game


mouldableStudent

Recommended Posts

Hi guys, I'm currently designing a template for a JavaScript based engine and I have a problem. For the purposes of motion this engine operates on a two bit binary clock timed out every 20th of a second.It functions well, as far as my coding goes, but it could be improved and I'm not sure how I'd go about it. You see, as the game is played the clock gets faster, but this isn't supposed to happen it should remain at a constant steady speed.It's not my first attempt at making this engine neither, I've done it quite a few times before, and they all work fine sans the clock speed thing.There are other bugs that need ironing out as you will see, but this is the one that I need most help with. The game itself can be found here: http://www.respectable-title.com/The Javascript file is here: http://www.respectab....com/js/clox.js A few last things:Start the game by clicking "Fight?" on the rightYou can fight upto three times without needing to refreshThe game has only been tested in Firefox for LinuxI'm sorry for your eyesightArrow keys and SpaceI'm sorry there isn't a .zip available for itMerry Christmas or traditional holiday, enjoy :)

Link to comment
Share on other sites

It's kind of hard to follow that code without any indenting or formatting, but it looks like you're calling the isit function every 2 seconds, and that function calls the clock function which calls itself every 100 milliseconds. So every 2 seconds you're adding another series of timeouts for the clock function.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...