private void Start()
 {
     obstacleCollision = new ObstacleCollision(transform);
     waterCollision    = new WaterCollision(transform);
     squeezeAnimation  = new SqueezeAnimation(transform);
     swipeInput        = new SwipeInput();
 }
示例#2
0
 /// <summary>
 /// This method takes two arguments and render the map by using the methods from the level class.
 /// </summary>
 /// <param name="levelNum"> Number of the level in the level container </param>
 private void CheckGameOver(int levelNum)
 {
     if (levelCollisionCheckers[levelNum].GetGameOverChecker())
     {
         ObstacleCollision.CreateExplosion(player);
         SpaceBus.GetBus().RegisterEvent(
             GameEventFactory <object> .CreateGameEventForAllProcessors(
                 GameEventType.GameStateEvent, this, "GAME_OVER", "", ""));
     }
 }
示例#3
0
    private void Awake()
    {
        _obstacleCollision = GetComponent <ObstacleCollision>();
        _rigidbody         = GetComponent <Rigidbody>();
        _collider          = GetComponent <Collider>();
        _camera            = Camera.main;

        ShouldMove        = false;
        _collisionOccured = false;

        _obstacleCollision.OnCollisionOccured += StopMotion;

        StartCoroutine(CheckMovementAvailability());
    }
示例#4
0
        /// <summary>
        /// Render the different entities and features.
        /// </summary>
        public void RenderState()
        {
            backGroundImage.RenderEntity();
            GameRunning.cashLabel.RenderText();
            foreach (Passenger passenger in levelPassengers[GameRunning.levelCounter])
            {
                passenger.RenderPassenger();
            }

            foreach (Passenger passenger in PassengerCollision.GetPassengerPickups())
            {
                passenger.RenderPassenger();
            }

            player.RenderPlayer();
            levels[GameRunning.levelCounter].RenderEntities();
            ObstacleCollision.GetExplosion().RenderAnimations();
        }
示例#5
0
 protected virtual void OnObstacleCollision()
 {
     ObstacleCollision?.Invoke(this, EventArgs.Empty);
 }
示例#6
0
 void Start()
 {
     instanceObstacleCollision = this;
     //score = PlayerPrefs.GetInt("BeersScore");
     //scoreUi.text = score.ToString();
 }
示例#7
0
 void Awake()
 {
     body     = gameObject.GetComponent <SMBPhysicsBody>();
     obsColls = gameObject.GetComponent <ObstacleCollision>();
 }