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.

Day 7: Getting Scratchy up to date

January 8, 2010 by pekuja · Leave a Comment 

I’m continuing my work on my personal game development library. I ported my map loader from my earlier SFML code and also added some of the player state machine stuff in, so now I can at least move the character around a bit. I do still need to write my own animation code though, because the old code was SFML specific and the license had the Creative Commons Share-Alike clause, so I’d rather avoid that, since this isn’t a huge deal to write my own code for.
One thing I like about writing my own base code is that I get to finally learn some OpenGL. I’ve been meaning to learn it for a while, but just never got around to it. So far, not doing much with it. Just textured quads. I did figure out how to use vertex arrays instead of immediate mode, so at least my code should be pretty portable if I want to go embedded some day.

Day 6: Scratchy

January 7, 2010 by pekuja · Leave a Comment 

So, after experiencing some minor problems with SFML, I got this itching to start from scratch with a lower level library. So, today I grabbed GLFW and wrote some simple code. I also grabbed Tom Seddon’s public domain image loader library so I could load textures in. I’m not very proficient with OpenGL, so I’m not exactly off to a blazing start, but I basically have a texture loaded and displayed on the screen. I’ll wrap the code in some nicer bunches to try and see if I can get actual work done this way.
I had this little epiphany today relating to this issue with wanting to write my code more from scratch. I think my problem is that I’m a bit too much of a nerd so I tend to care too much about minor technical details. I bet most people are fine with whatever tools they happen to have picked, but when I see some minor problem with a tool, I tend to form a dislike towards that tool, even if the problem is minor or doesn’t concern me at that moment. If I make my own tools, the only problem is not having enough time to implement everything I want. I think that might be fun though, so we’ll see. I’ll try this for a little bit, see if it boosts my morale or whatever.