right = vk_right
left = vk_left
jump = vk_up
if !keyboard_check(left) && keyboard_check(right)
{
if place_free(x+hspeed,y) then hspeed = 12 else hspeed = 0
}
if !keyboard_check(right) && keyboard_check(left)
{
if place_free(x-hspeed,y) then hspeed = -12 else hspeed = 0
}Now here I want it to stop moving when nobody is pressing the keys. However instead the object keeps moving the direction you last pressed it. It seems to ignore the second part of the if statment. If anyone is wondering, yes this is from the SparkEngine I was seeing how I could use it to learn GML.
if !instance_place(x,y+1,WALL) gravity=0.5 if instance_place(x,y+1,WALL) gravity=0 if vspeed>10 vspeed=10
(the object WALL is not solid by the way)
The player should not fall through the wall as gravity is turned off when they are near it. Also here, the player falls through the walls as if it ignores the second if statement again. I'm really uncertain what I am doing wrong in both of these instances.
Edited by MrEvil178, 26 May 2010 - 09:15 PM.











