Archive for May, 2005

The diagrams explaining it.

Sunday, May 29th, 2005

Working on gravity still.

I have the movement down, but the hit detection is still wrong. The player eventually falls through the earth. The problem is with my hit detection method.

There are two obvious methods.

Method 1 moves the player to the ending position and checks if he is touching anything. If he is not, then it allows the move, if he is, it moves him back.

Method 2 Checks the space from the player’s starting position to the player’s next position for any objects besides the player itself. It’s more complex, not impossible. It’s not neccessarily slow either.

Here’s a diagram

hit detection diagram

The problem is when the player moves diagonally, it involves the equation for a line, and can be much more complex than this diagram, unless I cut corners, which could lead to weird gameplay.

Maybe I should work more on the code and not the diagrams explaining it though.

Jumper Progress

Wednesday, May 25th, 2005

I am currently working on a platformer game’s gravity. Progress is going pretty well. I had to flip the Y axis. SDL, the graphics API I am using, has the lower Y closer to the top of the screen. This can be really confusing, especially for gravity. To check to see if an object is above another object, I have to use the less than operator. I am switching the way it works to Cartesian coordinates before I get too deep in development.

I’ve got the code pretty object-oriented. Because of this, I feel comfortable with the idea that I could switch to directX from SDL if I found the time to learn directX, which I’d like to do. I learned the very basics of using SDL from jnrdev. That site has many tutorials for making platform games; though I am not using any of the site’s tutorials yet. I am doing things a lot differently.

Soon I am going to work on the player movement code. Movement code is pretty easy if the player instantaniously changes direction and speed, but I want the player to have to decelerate/accelerate like mario. I’ve found that, as simple as it is, the NES Mario has a lot of little intricacies.

Some Things added

Sunday, May 15th, 2005

This is my first foray into both style sheets and php. Although I’m still working on the theme for this site, I have managed to add a downloads page to the site. Included on it so far are two of my counter-strike maps, and one very early demo for a programming project I am working on in my free time. While I am at it, I’ll throw up a game for zzt I made, though I don’t expect anyone to even have an idea what zzt is.

My plans for this site is to post general development updates for my 2d game project, and to post anything else I find interesting in the process.