New account registration is temporarily disabled.

[DRAGONSTAR] GAME MAKER HELP NEEDED: PLAYER COLLISION

Posts

Pages: first prev 12 last
I actually could use some help with slopes, if we're thinking the same thing! So far all the platforms are vertical, and I really could use some advise on how to approach slanted surfaces!
Alright I'll give it a shot.
You need a new sprite for your slopes name them spr_slope_r and spr_slope_l, where r is going up to the right and l is up to the left.
for both you will need to make a 17x16 sprite, with the left most column empty (for the transparent colour) and set the x,y of the sprite to 1,0 instead of 0,0.
The sprite itself will literally be your original box cut in half diagonally (one way for each).

We're gonna change your movement code again.

if keyboard_check(vk_right) && place_free(x+4,y)
{
x += 4
}
else if keyboard_check(vk_right) && place_free(x+4,y-4)
{
x += 4
y -= 4
}

And the same for left (except x-4 instead of x+4)

This checks if the space is free in front of you, and if it isn't it the checks if there is a slope in front of you instead.

As for going down slopes, try this, might not work 100% as I remember this taking a while.

if keyboard_check(vk_right) && place_free(x+4,y+4)
{
x += 4
y += 4
}
else if keyboard_check(vk_right) && place_free(x+4,y)
{
x += 4
}
else if keyboard_check(vk_right) && place_free(x+4,y-4)
{
x += 4
y -= 4
}

Basically the same but it checks for the down slope, if there is solid floor, checks for normal movement, and if theres something in the way it checks for the up slope.
Pages: first prev 12 last