Sign in to follow this  
CODEXANA

A basic problem in my game

Recommended Posts

I'm making a PC game via Game Maker 7.0, and I have a problem I can't shake off... I've fixed the gravity in the game, but when my game character lands on the solid surface of the floor tiles, I'm incapable of manually moving the character in any direction whatsoever... I already know a collision event for the tile is needed, but I can't figure out the action which will allow me to have the gravity set, and still move along the floor tiles with it being in effect. PLEASE HELP. I REALLY need help on this...

Share this post


Link to post
Share on other sites
Sounds like a design flaw. Gravity should not effect horizontal movement (or jumping). Move the player up until he no longer collides with the ground after a collision.

A hackish way to solve it is to set a flag "at_rest" and only use gravity when you don't detect a tile below.

Share this post


Link to post
Share on other sites
Well, I don't think it's like that. You see, my game's gravity setting forces the character to sink straight through the floor and into the offscreen down position. If I set a collision event of any kind for the tile and the character, it will land on the floor instead of the void pit. But any collision event I make won't allow me to keep the event still, and allow manual movement along the solid objects...
What is the action to the collision event I need to implement in order for this to become possible?

Share this post


Link to post
Share on other sites
I'm taking a shot in the dark, since I don't know how Game Maker works at all.

Could you possibly make two events, one is (for want of a better phrase) a leave-floor event which activates gravity for the character and the other is a land-on-floor collision event which then disables gravity.
When the character jumps or falls the leave-floor event is fired and he starts accelerating downwards, when he lands the land-on-floor event is fired then gravity is halted so the acceleration stops.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this