Header

Header

Wednesday 29 October 2014

ACSS InfoTech 2014-15 Day: 24

Today I managed to (somewhat) apply gravity and collisions to my already-made level. To get this done, I recommend checking out the videos provided below. I chose these tutorials mainly because they are pretty quick and very informative if you are looking to add these functions (gravity, collisions) into a game. In order to add collisions to my game, 2 individual objects were needed. In this case the main sprite and the walls of the level were the 2 objects used. I also added a collision action to the main sprite only when it touches the walls. This allows the sprite to bounce off the walls rather than go through the walls.

The gravity in my game still has some issues but I was able to get most of the steps done. Basically to add gravity, the vertical speed and movement needed some adjustments. The issue I am having right now is that once my main sprite touches the ground, it starts to bounce as a reaction due to the collisions I added early on. Ty was able to give me some helpful advice and suggested I should maybe play around with the vertical speed (and possibly setting it to 0).

No comments:

Post a Comment