A basic problem in my game

Started by
6 comments, last by CODEXANA 16 years, 2 months ago
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...
Advertisement
Please help!
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.
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?
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.
I can't find those types of actions, but yes, I can make more than one action in a collision event. Any other ideas?
Try asking here:
http://gmc.yoyogames.com/
Thanks! I searched around and I found it!

The answer is set vertical speed to 0 in the collision event with the floor tiles.

This topic is closed to new replies.

Advertisement