S
Smidge7
Guest
Hey guys i'm new to this, I've watched many tutorials on attaining perfect pixel collision with walls but they are all based on arrow key/wasd movement and hspd/vspd variables. My issue is that my character doesn't move using these methods.
My obj_player has and orb (obj_dot) that orbits it and when you press the mouse button it flies in that direction using the speed value and the angle between the obj_player and the obj_dot.
The player keeps flying until it hits a wall with a collision event where it sets speed = 0.
This causes the player to sometimes stop just short of the wall or just inside the wall due to the speed value not being incredibly slow.
Is there a way to achieve the same movement using 'hspd/vspd' instead of 'speed'? If so i'm confident I can achieve perfect collision with the walls the same way you would with an arrow key set up. Is there a better way i'm missing?
Thanks
My obj_player has and orb (obj_dot) that orbits it and when you press the mouse button it flies in that direction using the speed value and the angle between the obj_player and the obj_dot.
Code:
// Player Movement
if (mouse_check_button(mb_left)) && speed = 0
{
direction = point_direction(x,y,obj_dot.x,obj_dot.y);
speed = 16;
}
This causes the player to sometimes stop just short of the wall or just inside the wall due to the speed value not being incredibly slow.
Is there a way to achieve the same movement using 'hspd/vspd' instead of 'speed'? If so i'm confident I can achieve perfect collision with the walls the same way you would with an arrow key set up. Is there a better way i'm missing?
Thanks