Skip to content

Instantly share code, notes, and snippets.

@teukstrid
Created May 24, 2018 07:44
Show Gist options
  • Save teukstrid/2422d72d256df43da351efebcbe5e4e7 to your computer and use it in GitHub Desktop.
Save teukstrid/2422d72d256df43da351efebcbe5e4e7 to your computer and use it in GitHub Desktop.
o_player_collision_with_hitbox
/// @description Hit logic
if hurtbox_entity_can_be_hurt_by(other)
{
invincible_ = true;
alarm[0] = global.one_second *0.75;
global.player_health -= other.damage;
var _direction = point_direction(other.x, other.y, x, y);
set_movement(_direction, other.knockback_);
state_ = player.hit;
event_user(state_);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment