Esempio n. 1
0
        //passing null sprite because mario's states control his sprite
        public Mario(Vector2 position) : base(null, position, Color.Yellow)
        {
            Spawns = new List <Vector2>();
            Spawns.Add(new Vector2(position.X, position.Y));
            ActiveSpawn = Spawns[0];

            HasAirDash = true;

            Orientation    = Facing.Right;
            Gravity        = true;
            BounceCount    = 0;
            Lives          = 3;
            CoinCount      = 0;
            Winner         = true;
            LevelCompleted = false;

            StateMachine = new MarioStateMachine(this);
            StateMachine.Begin();
            _FireBallPool = new FireballPool(2);

            BoundingBox.UpdateHitBox(position, Sprite);

            EventManager.Instance.RaisePowerupCollectedEvent += ReceivePowerup;
        }
Esempio n. 2
0
 private void Start()
 {
     _fireballPool        = FindObjectOfType <FireballPool>();
     voiceOverAudioSource = _fireballPool.voiceOverObj.GetComponent <AudioSource>();
 }
Esempio n. 3
0
 void Awake()
 {
     hitboxManager  = GetComponent <HitboxManager>();
     spriteRenderer = GetComponent <SpriteRenderer>();
     fireballPool   = FindObjectOfType <FireballPool>();
 }
Esempio n. 4
0
 //Basic singleton implementation
 private void Awake()
 {
     Instance = this;
 }
Esempio n. 5
0
 void Awake()
 {
     fireballPool = FindObjectOfType <FireballPool>();
 }
Esempio n. 6
0
 private new void Start()
 {
     base.Start();
     _fireballPool = FindObjectOfType <FireballPool>();
 }