Esempio n. 1
0
        private void RunningSwitchCollision(GameObject runningSwitch, GameObject colidedWith)
        {
            //running switch and player
            Player player = colidedWith as Player;

            if (player != null)
            {
                int collisionID = map.gameObjectList.IndexOf(runningSwitch);
                if (CollisionManager.GameObjectCollision(player, runningSwitch))
                {
                    if (!player.collisionsList.Contains(collisionID))
                    {
                        player.FlipRunning();
                        player.collisionsList.Add(collisionID);
                    }
                }
                else
                {
                    player.collisionsList.Remove(collisionID);
                }
            }
        }