make player able to hit block from below
This commit is contained in:
parent
6fc89f832c
commit
4f668f94d9
@ -87,6 +87,14 @@ public class Player : KinematicBody2D
|
|||||||
{
|
{
|
||||||
_eventBus.EmitSignal("PlayerTouched");
|
_eventBus.EmitSignal("PlayerTouched");
|
||||||
}
|
}
|
||||||
|
else if (collider.IsInGroup("Block") && Vector2.Down.Dot(collision.Normal) > 0)
|
||||||
|
{
|
||||||
|
if (collider.HasMethod("Hit"))
|
||||||
|
{
|
||||||
|
collider.RemoveFromGroup("Block");
|
||||||
|
collider.CallDeferred("Hit");
|
||||||
|
}
|
||||||
|
}
|
||||||
collision.Dispose();
|
collision.Dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user