public void Collision() { foreach (AI ai in _ai) { if (ai.ColliedWith(_player)) { if (SplashKit.BitmapName(ai.CarBitmap) == "Reward1") { if (!_reward1) { _doubleSpeedTime = _timer.Ticks + 10000; } else { _doubleSpeedTime += 10000; } } else { SplashKit.DisplayDialog("GameOver", $"Your Score is: {_score} m", SplashKit.FontNamed("FontC"), 20); Restart = true; } } } }
public void Surface() { string bitmapName = SplashKit.BitmapName(_bitmap); string last = bitmapName.Substring(bitmapName.Length - 1, 1); _floatingState.Surface(this, last); }
public Enemy(int PlayerLevel) { _Enemies = new List <Bitmap>(); _dragon = new Bitmap("Dragon", "dragon.png"); _mage = new Bitmap("Mage", "badboy.png"); _lizardman = new Bitmap("Lizard Man", "lizardman.png"); _ghost = new Bitmap("Ghost", "ghost.png"); _minotaur = new Bitmap("Minotaur", "minotaur.png"); _Enemies.Add(_dragon); _Enemies.Add(_mage); _Enemies.Add(_lizardman); _Enemies.Add(_ghost); _Enemies.Add(_minotaur); _Enemy = _Enemies[SplashKit.Rnd(_Enemies.Count)]; _Name = SplashKit.BitmapName(_Enemy); _Image = _Enemy; _XP = SplashKit.Rnd(PlayerLevel * 100); _Level = 1 + _XP / 100; _Health = _Level * 100; _MaxHealth = _Level * 100; }
public void CheckReward() { _reward1 = (_timer.Ticks < _doubleSpeedTime); _reward2 = (_timer.Ticks < _invincibleTime); InvincibleBitmap(_player.CarBitmap, bitmap => SplashKit.BitmapName(bitmap)); }