D
Dylaniza
Guest
I used matharoo's basic platformer tutorial on The GameDev Palace. The tutorial used GameMaker: Studio and I used Studio 2, I don't know if this matters or not, but when you jump and hit the ceiling or walk to a wall it is off a few pixels in certain places but not in others. The code:
I am pretty hopeless when it comes to platformers and collision but have been trying to learn and want to know why this might not be working.
Code:
//Create Event
gravity = 1;
//Step Event
if keyboard_check(ord("A")) && place_free(x - 3,y){
hspeed = -3;
}
else{
if keyboard_check(ord("D")) && place_free(x + 3,y){
hspeed = 3;
}
else{
hspeed = 0;
}
}
if keyboard_check(vk_space) && !place_free(x,y+1){
vspeed = -13;
}
//Collision Event
vspeed = 0;
Last edited: