private void Start() { obstacleCollision = new ObstacleCollision(transform); waterCollision = new WaterCollision(transform); squeezeAnimation = new SqueezeAnimation(transform); swipeInput = new SwipeInput(); }
/// <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", "", "")); } }
private void Awake() { _obstacleCollision = GetComponent <ObstacleCollision>(); _rigidbody = GetComponent <Rigidbody>(); _collider = GetComponent <Collider>(); _camera = Camera.main; ShouldMove = false; _collisionOccured = false; _obstacleCollision.OnCollisionOccured += StopMotion; StartCoroutine(CheckMovementAvailability()); }
/// <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(); }
protected virtual void OnObstacleCollision() { ObstacleCollision?.Invoke(this, EventArgs.Empty); }
void Start() { instanceObstacleCollision = this; //score = PlayerPrefs.GetInt("BeersScore"); //scoreUi.text = score.ToString(); }
void Awake() { body = gameObject.GetComponent <SMBPhysicsBody>(); obsColls = gameObject.GetComponent <ObstacleCollision>(); }