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.

No comments:

Post a Comment