Day 9: Rudimentary physics

January 11, 2010 by pekuja · Leave a Comment 

Sorry about missing a couple of updates. Was in a bit of a coding slump over the weekend. I think I’m back on track now though.

Today, I whipped up some basic physics for my character. Well, all it is is basically a jump action, but I did end up changing my state system a bit because I found it too clunky to have separate states for left and right facing states, so I changed that into a little variable, since I was adding internal state to the states anyhow because I needed to keep track of the character’s vertical velocity. I’m currently implementing the jump action with a separate jump state and fall state. The point being that the character can only hit a ceiling while he’s jumping, and only land on the floor when he’s falling. My state changes are currently a bit wonky because they end up taking a frame where nothing happens. I think the way to fix this is by making the collision checks *before* the character actually collides with anything.

Now that I think about it, adding the jump physics is actually a significant step, because after the collision detection and jumping works, I can actually start making levels and roam them. Well, after I add scrolling, but that should be easy enough.

In other news, I’ve decided that I’m going to stop switching libraries/environments and stick to one. I chose the winning library with a fair dice roll, and it ended up being my own library/basecode, which I’m calling Scratchy. That doesn’t really change much right now, because I was using it anyways, but I’ve now decided I won’t change it anymore. I wonder if I should do this for IDE’s as well… I’ve so far switched from Code::Blocks to NetBeans to Eclipse to NetBeans again. I also just switched from Windows to Linux, but that doesn’t change much unless I decide to develop on the command line.

About pekuja

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!