Tuesday, April 27, 2010

side of wall and floor

So I've gotten the wall to work so that i don't go through it, i just made another class, but i sometimes have the same problem with the floors (although i don't know why?), so i've made another class thats similar to the one i just made for the side of the walls and just slightly tweaked to work vertically. Now that i've got those working, i just need to work on positioning the pieces properly, then I am going to work on creating enemies (for now they will just be a coloured square, and later, like my player, i will add in an image).

Monday, April 26, 2010

side of wall

I thought of something i could do to fix the side wall problem. I could make a surface just infront of the side of the other one so that if my player hits the new rect, his y velocity will cause him to fall down instead of keep going up through the wall.

I do realize that there might be a problem then if he were to land on to of the new surface, so i'm going to make its hight on the top and bottom a bit less than the floor height, but make the width only a fraction greater, so it doesn't stick out too much.

Saturday, April 24, 2010

Gravity

I have made several floors, and am working on the placement of them right now. The best thing thats happened is that I unintentionally created gravity. My original plan was to make two different types of floors, on on top and one on bottom, so that if my player rect hit the top one, he would just stop, and if my player rect hit the bottom, his y velocity would be made downwards. Since i was only working on the top right now, my players y value was supposed to just be 0, but instead he moves down. I was worried about having to create two types floors, and the problems that it might cause, but now when my player hits the bottom floor he moves downwards, so thats a major hassle that I have avoided.

The next problem i have to work on after positioning all the floors close to the exact places i want them is to make it so that if the player hits the side of the floor, he will bounce off of it instead of getting stuck in the middle of the floor and moving up through it. I'm not quite sure how i will do this yet, but i will try to come up with something by my next post.

Wednesday, April 21, 2010

Making the Game

At first i tried to edit the Arena tank game that we just finished and tweak everything, but after getting to many errors, i realized that it would be much easier to just start from scratch and include the parts I need from previous files.

At this point in the game, I've just made a floor, a square (for the player), and am in the process of making him move. I've gotten the left to right easily enough, but the "jump" is what is giving me trouble. I'm trying to get a accelerated jump that does not depend on how long the "UP" key is pressed, but just when it is pressed.

The next thing i need to do after that, is make the player rect. stop vertically when he collides with a floor, and once that is completed, create the floors all over the map.