Esempio n. 1
0
        private bool collidedWithPlayer(TouhouPlayer player)
        {
            // Let's assume that player is a circle for simplicity

            var playerPosition = player.PlayerPosition();
            var distance       = Math.Sqrt(Math.Pow(Math.Abs(playerPosition.X - Position.X), 2) + Math.Pow(Math.Abs(playerPosition.Y - Position.Y), 2));
            var playerRadius   = player.PlayerDrawSize().X / 2f;
            var cherryRadius   = finalSize / 2f;

            if (distance < playerRadius + cherryRadius)
            {
                return(true);
            }

            return(false);
        }
Esempio n. 2
0
        public TouhouPlayfield(TouhouHealthProcessor healthProcessor)
        {
            this.healthProcessor = healthProcessor;

            InternalChildren = new Drawable[]
            {
                new TouhouBackground(),
                new Container
                {
                    RelativeSizeAxes = Axes.Both,
                    Masking          = true,
                    Children         = new Drawable[]
                    {
                        HitObjectContainer,
                        Player = new TouhouPlayer()
                    }
                }
            };
        }
Esempio n. 3
0
 public void GetPlayerToTrace(TouhouPlayer player) => Player = player;