presentations/highlight-js/test/detect/gml/default.txt

22 lines
435 B
Text
Raw Permalink Normal View History

2018-12-07 08:48:05 -06:00
/// @description Collision code
// standard collision handling
// Horizontal collisions
if(place_meeting(x+hspd, y, obj_wall)) {
while(!place_meeting(x+sign(hspd), y, obj_wall)) {
x += sign(hspd);
}
hspd = 0;
}
x += hspd;
// Vertical collisions
if(place_meeting(x, y+vspd, collide_obj)) {
while(!place_meeting(x, y+sign(vspd), collide_obj)) {
y += sign(vspd);
}
vspd = 0;
}
y += vspd;
show_debug_message("This is a test");