Trouble with adding field types and Gravity

Blitz3D Forums/Blitz3D Beginners Area/Trouble with adding field types and Gravity

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

OK, I have another question and I'm going to post it here instead of making a new thread.
Now I have a level like this:

+----------------+
|.........._..........|
|.........| |.........|
|-------| |-------| the periods represent nothing, air if you will.
|......................| the --- and | represent walls
+----------------+

And I need the player to stop when he hits the wall. My code looks like this:

If Player1\Gravity = 1 Then
Player1\y = Player1\y + 5 ; initial gravity
If ImagesCollide(Player1Anim, Player1\x, Player1\y, 0, WhatLevel, GraphicsWidth()/2, GraphicsHeight()/2, 0) Then
While ImagesCollide(Player1Anim, Player1\x, Player1\y, 0, WhatLevel, GraphicsWidth()/2, GraphicsHeight()/2, 0)
Player1\y = Player1\y - 1

Wend
endif
endif

But if I do this and the player collides with that wall, he will just "jump" to the top of the wall because of my While loop, any help please?