Time and Animation Fixes

After the last update, I was hearing that player movement and animation was really weird from a few friends who occasionally play-test for me, so I checked it out on a few browsers. Sure enough, each browser handled the code I wrote differently. I’ve made some fixes that, while they don’t equalize gameplay throughout all browsers (curse you, Firefox), brings me a few steps closer to it.

While I’m talking about Firefox, here is a list of stuff it does wrong:

  • Indoor room border color is radically different than Chrome/Safari. I will probably have to change this to an image and just include padding for the room instead of border. This will be annoying because I will likely have to adjust the top and left values for evaluating where stuff is in the room.
  • You can’t hold down a key to move the player, you have to press it each time.
  • If I leave any console.log commands in, the game won’t start for Firefox clients who have Firebug installed, but the console panel disabled.

As far as the animation fixes go, I added booleans to check to see if the player was already in the middle of an animation. There’s one to check if the player is moving vertically, one to check if it’s moving horizontally, and one to see if the feet are still animating. Then, it won’t execute the same command again until the animation finishes, which accounts for people holding down arrows.

Lastly, I’m thinking about implementing time today in 0.2.3. To start, the only facet of time would be that clocks automatically update to the correct game time when you interact with them, and if the time is between a certain range, the game will let you go to bed and wake up the next morning. I can’t decide if I want time to constantly advance, or if it should advance by a few minutes every time you walk through a door. I’ll probably do consistent time, but they both have advantages.

Leave a Comment

Name: (Required)

E-mail: (Required)