D
DevNorway
Guest
What's the basic idea behind having collisions based on your "height"?
What I want, is a collision that is determined by what your current height is. How would I go about this?
Code:
// horizontal collision
if place_meeting(x + hsp * spd, y, obj_collision) {
x -= hsp * spd;
}
x += hsp * spd * !attacking;
// vertical collision
if place_meeting(x, y + vsp * spd, obj_collision) {
y -= vsp * spd;
}
y += vsp * spd * !attacking;