U
UncharteredAnon
Guest
Hi guys, day 1 Game Maker 2 owner here and super excited to be taking the plunge... I started looking at some youtube tutorials and found Shaun Spalding's complete platformer tutorial.. AMAZING tutorials provided by him, however i'm getting stuck on one section of a "Horizontal Collision" test and can't seem to move my sprite player at all, the game loads but i can't seem to move him left / right ...
Code i am using
//input from player
key_left = keyboard_check(vk_left);
key_right = keyboard_check(vk_right);
key_jump = keyboard_check_pressed(vk_space);
//calculate movement
var move = key_right - key_left;
hsp = move * walksp;
//Horizontal Collision
if (place_meeting(x+hsp,y,Obj_Wall))
{
while (!place_meeting(x+sign(hsp),y,Obj_Wall))
{
x = x + sign(hsp);
}
hsp = 0;
}
x = x + hsp;
Just trying to get the feel of things, it's literally the same code/event that was used in Shauns tutorial... am i missing something here?
Any help would be much appreciated!
Code i am using
//input from player
key_left = keyboard_check(vk_left);
key_right = keyboard_check(vk_right);
key_jump = keyboard_check_pressed(vk_space);
//calculate movement
var move = key_right - key_left;
hsp = move * walksp;
//Horizontal Collision
if (place_meeting(x+hsp,y,Obj_Wall))
{
while (!place_meeting(x+sign(hsp),y,Obj_Wall))
{
x = x + sign(hsp);
}
hsp = 0;
}
x = x + hsp;
Just trying to get the feel of things, it's literally the same code/event that was used in Shauns tutorial... am i missing something here?
Any help would be much appreciated!