public Pause(TimeGuardianGame game, LevelBase level) { _level = level; _game = game; x = -500; Sprite background = new Sprite(UtilStrings.SpritesPause + "background_pause.png"); background.SetOrigin(0,background.height/2); background.y = game.height/2; Sprite header = new Sprite(UtilStrings.SpritesPause + "header_pause.png"); header.SetOrigin(header.width/2, header.height/2); header.SetXY(background.width/2, 200); _buttons = new[] { new Button(UtilStrings.SpritesPause + "button_resume.png", 2, background.width/2, 350, "Resume"), new Button(UtilStrings.SpritesPause + "button_restart.png", 2, background.width/2, 450, _level.GetLevelName()), new Button(UtilStrings.SpritesPause + "button_exit.png", 2, background.width/2, 550, "MainMenu") }; AddChild(background); AddChild(header); foreach (Button button in _buttons) { AddChild(button); } _selectedSound = new Sound(UtilStrings.SoundsMenu + "sound_selected.wav"); _openSound = new Sound(UtilStrings.SoundsMenu + "sound_pause.wav"); }
protected LevelBase(TimeGuardianGame game) { Game = game; Pause = new Pause(game, this); Enemies = new List<GameObject>(); Backgrounds = new List<Background>(); Walls = new List<Wall>(); }
public WonGame(TimeGuardianGame game) { _game = game; Sprite background = new Sprite(UtilStrings.SpritesOther + "gamewon/background.png"); Sprite header = new Sprite(UtilStrings.SpritesOther + "gamewon/header.png"); header.SetXY(100, game.height-400); AddChild(background); AddChild(header); }
public Level2(TimeGuardianGame game, int lives) : base(game) { Game = game; BackgroundCreator(); _tileMap = FileReader.levelMaker(_levelNr, UtilStrings.TilesX, UtilStrings.TilesY); Player = new Player(lives, this, Game); _enemy = new EnemyOwl(this); CreateLevel(); AddChild(Player); AddChild(_enemy); Music = new Sound(UtilStrings.SoundsBackground + "music_level_2.mp3", true, true); MusicChannel = Music.Play(); AddChild(Pause); }
public Player(int lives, LevelBase level, TimeGuardianGame game) : base(UtilStrings.SpritesPlayer + "spritesheet_hero.png", 8, 2) { SetOrigin(width/2, 0); SetXY(100, 500); _game = game; _lives = lives; _level = level; _timestopTimer = MaxTimeStopTimer; DeadSpriteCreator(); HitBoxCreator(); _hud = new HUD(_lives, _level, this); _jumpSound = new Sound(UtilStrings.SoundsPlayer + "sound_jump.wav"); _hurtSound = new Sound(UtilStrings.SoundsPlayer + "sound_hurt.wav"); _getLifeSound = new Sound(UtilStrings.SoundsPlayer + "sound_getLife.wav"); _abilityLoadedSound = new Sound(UtilStrings.SoundsPlayer + "sound_abilityActive.wav"); _abilityDepletedSound = new Sound(UtilStrings.SoundsPlayer + "sound_abilityDepleted.wav"); }
public GameOver(TimeGuardianGame game, LevelBase level) { _game = game; _level = level; SetBackground(); SetHeader(); _buttons = new[] { new Button(UtilStrings.SpritesOther + "gameover/button_restart.png", 2, 300, 550, _level.GetLevelName()), new Button(UtilStrings.SpritesOther + "gameover/button_exit.png", 2, game.width - 300, 550, "MainMenu") }; foreach (var button in _buttons) { AddChild(button); } _buttons[0].Selected(); }
public BossBeaten(TimeGuardianGame game, LevelBase level) { _game = game; _level = level; SetBackground(); SetHeader(); _buttons = new[] { new Button(UtilStrings.SpritesOther + "levelbeaten/button_next.png", 2, 300, 550, _level.GetNextLevelName()), new Button(UtilStrings.SpritesOther + "levelbeaten/button_exit.png", 2, game.width - 300, 550, "MainMenu") }; foreach (Button button in _buttons) { AddChild(button); } _buttons[0].Selected(); }
public MainMenu(TimeGuardianGame game) { _game = game; SetBackground(); SetHeader(); _buttons = new [] { new Button(UtilStrings.SpritesMenu + "button_newgame.png", 2, game.width/2, 350, "Level1"), new Button(UtilStrings.SpritesMenu + "button_highscore.png", 2, game.width/2, 450, "HighScores"), new Button(UtilStrings.SpritesMenu + "button_credits.png", 2, game.width/2, 550, "Credits"), new Button(UtilStrings.SpritesMenu + "button_exit.png", 2, game.width/2, 650, "Exit") }; foreach (Button button in _buttons) { AddChild(button); } _selectedSound = new Sound(UtilStrings.SoundsMenu + "sound_selected.wav"); _music = new Sound(UtilStrings.SoundsMenu + "music_menu.mp3", true, true); _musicChannel = _music.Play(); _buttons[0].Selected(); }
public HighScores(TimeGuardianGame game) { _game = game; }
public Credits(TimeGuardianGame game) { _game = game; }