+ Base of a game UI

This commit is contained in:
2022-10-26 09:39:39 +02:00
parent c1ba4774fc
commit 7f632daadc
5 changed files with 129 additions and 70 deletions
+10
View File
@@ -2,6 +2,7 @@
using Microsoft.Xna.Framework.Graphics;
using MonoGame.Extended;
using MonoGame.Extended.Collisions;
using System;
namespace client
{
@@ -56,6 +57,15 @@ namespace client
// Collisions
public void OnCollision(CollisionEventArgs collisionInfo)
{
if (collisionInfo.Other.GetType().Equals(typeof(ScreenBounds)))
{
Velocity.Y *= -1;
}
else if (collisionInfo.Other.GetType().Equals(typeof(Player)))
{
Velocity.X *= -1;
}
Bounds.Position -= collisionInfo.PenetrationVector;
}
}