Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///objSolid begin_step
- if (other.crushPlayer) {
- show_debug_message("crushed at right");
- if (!global.debugInvincibility)
- global._health = 0;
- }
- else {
- if (floor(y) < floor(bbox_get_ycenter(other)))
- shunt_up(id, other.id, true, false);
- else
- shunt_down(id, other.id, true, false);
- }
- ///shunt_down(id, [_solid = other], [is_first = true], [is_left = true])
- var ins = id;
- var _solid = other;
- if (argument_count > 2)
- _solid = argument[2];
- var is_first = true;
- if (argument_count > 3)
- is_first = argument[3];
- var is_left = true;
- if (argument_count > 4)
- is_left = argument[4];
- with(_solid) {
- var shunt_block_check = collision_rectangle(floor(ins.bbox_left), ceil(bbox_bottom) + 32, ceil(ins.bbox_right), ceil(bbox_bottom) + 1, objSolid, false, true);
- }
- if (!shunt_block_check) {
- ins.y = ceil(_solid.bbox_bottom) + (floor(bbox_get_height(ins) / 2) + 1);
- hit_player(_solid.contactDamage);
- if (is_left)
- show_debug_message("Shunted down from left.");
- else
- show_debug_message("Shunted down from right.");
- }
- else {
- if (is_first) {
- shunt_up(ins, _solid, false, is_left);
- }
- else {
- if (is_left)
- show_debug_message("Failed to shunt from left. Crushing now.");
- else
- show_debug_message("Failed to shunt from right. Crushing now.");
- if (!global.debugInvincibility)
- global._health = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement