private void _on_hitbox_body_shape_entered(int body_di, PhysicsBody2D body, int body_shape, int area_shape) { if (hitstun > 0) { hitstun -= 1; } if (hitstun == 0 && body.Get("DAMAGE") != null && (string)body.Get("TYPE") != TYPE) { health -= (int)body.Get("DAMAGE"); hitstun = 20; // knockDir = Transform.Origin + (body.Transform.Origin) ; //GD.Print("hitstun is: " + hitstun); } }
private void _on_attackhitbox_body_entered(PhysicsBody2D body) { if (body.Get("HEALTH") != null) { body.Set("knockDir", Transform.Origin + body.Transform.Origin); body.Set("HEALTH", 0); } }
public void OnBodyEntered(PhysicsBody2D body) { body.Set("lifes", (int)body.Get("lifes") - fireDamage); QueueFree(); }