예제 #1
0
파일: Letter.cs 프로젝트: mokujin/DN
 private void HeroOnCollisionWithObjects(GameObject sender, GameObject gameObject)
 {
     if(gameObject is Hero)
     {
         _heroWasCollided = true;
         IgnoreCollisions = true;
     }
 }
예제 #2
0
파일: GameWorld.cs 프로젝트: mokujin/DN
 private void HeroOnTakeDamageEvent(GameObject sender, float amount)
 {
     Camera.Rumble(0.2f, 4, 4);
     Game.g_Gamepad.Vibrate(0.6f, 0.6f, 0.2f);
 }
예제 #3
0
파일: GameWorld.cs 프로젝트: mokujin/DN
 public void RemoveObject(GameObject gameObject)
 {
     _deleteObjectsQueue.Enqueue(gameObject);
 }
예제 #4
0
파일: GameWorld.cs 프로젝트: mokujin/DN
 public float DistanceToObject(GameObject g1, GameObject g2)
 {
     return (float)Math.Sqrt(Math.Pow(g1.Position.X - g2.Position.X, 2) + Math.Pow(g1.Position.Y - g2.Position.Y, 2)); ;
 }
예제 #5
0
파일: GameWorld.cs 프로젝트: mokujin/DN
 public Vector2 DirectionToObject(GameObject g1, GameObject g2)
 {
     float angle = (float)Math.Atan2(g1.Position.Y - g2.Position.Y, g1.Position.X - g2.Position.X);
     return new Vector2(-(float)Math.Cos(angle), -(float)Math.Sin(angle));
 }
예제 #6
0
파일: GameWorld.cs 프로젝트: mokujin/DN
 public void AddObject(GameObject gameObject)
 {
     _addNewObjectsQueue.Enqueue(gameObject);
 }
예제 #7
0
파일: GameObject.cs 프로젝트: mokujin/DN
 public void CollisionWithObject(GameObject sender, GameObject gameObject)
 {
     if(CollisionWithObjects != null)
     CollisionWithObjects(sender, gameObject);
 }