public GameStateGameOver(int finalScore) { _backColor = new Color4(0f, 0f, 0f, 1f); _finalScore = finalScore; _font = FontManager.Get("glyphs"); _flatColorShader = ShaderManager.Get("FlatColorShader"); _gameOverText = new Text(new Vector2(10, 10), _font, _flatColorShader, Text.Alignment.MIDDLE, "Game Over"); _scoreText = new Text(new Vector2(10, 10), _font, _flatColorShader, Text.Alignment.MIDDLE, $"Your final score: {_finalScore}"); _name = ""; _nameText = new Text(new Vector2(10, 10), _font, _flatColorShader, Text.Alignment.LEFT, ""); _scoreboardText = new Text(new Vector2(10, 10), _font, _flatColorShader, Text.Alignment.MIDDLE, "Scoreboard"); _scoreboardNameText = new Text(new Vector2(10, 10), _font, _flatColorShader, Text.Alignment.RIGHT, ""); _scoreboardScoreText = new Text(new Vector2(10, 10), _font, _flatColorShader, Text.Alignment.LEFT, ""); _coinMesh = new Object3D("coin.obj", false, false, true); _coinMesh.LoadInGl(_flatColorShader); _coins = new List <CloneableCoin>(); _coinReference = new CloneableCoin(_coinMesh); _coinEmitter = new CoinEmitter(ref _coins, _coinReference, new Vector3(0, _height, 0), 0.2f, _finalScore / 20, (float)(80f * (Math.PI / 180f)), 1000, 1200); DownloadScores(); }
void Awake() { coinEmitter = GetComponent<CoinEmitter>(); controller = GetComponent<PlayerController>(); body = GetComponent<Rigidbody2D>(); collder = GetComponent<Collider2D>(); CoreLevelObjects.player = this; }