Exemplo 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;
        }
Exemplo n.º 2
0
 private void Start()
 {
     _fireballPool        = FindObjectOfType <FireballPool>();
     voiceOverAudioSource = _fireballPool.voiceOverObj.GetComponent <AudioSource>();
 }
Exemplo n.º 3
0
 void Awake()
 {
     hitboxManager  = GetComponent <HitboxManager>();
     spriteRenderer = GetComponent <SpriteRenderer>();
     fireballPool   = FindObjectOfType <FireballPool>();
 }
Exemplo n.º 4
0
 //Basic singleton implementation
 private void Awake()
 {
     Instance = this;
 }
Exemplo n.º 5
0
 void Awake()
 {
     fireballPool = FindObjectOfType <FireballPool>();
 }
Exemplo n.º 6
0
 private new void Start()
 {
     base.Start();
     _fireballPool = FindObjectOfType <FireballPool>();
 }