public LevelSelectController(GameState gm, SpriteBatch sb) { gameState = gm; PAGES = (gm.Levels.Length + LevelSelectView.PER_PAGE - 1) / LevelSelectView.PER_PAGE; spriteBatch = sb; levelSelectScreen = new LevelSelectView(sb, gameState); }
public WiiController(Game game, GameState gm, InputBuffer b) : base(game, gm, b) { wm = new WiimoteLib.Wiimote(); wm.Connect(); wm.SetReportType(WiimoteLib.InputReport.IRAccel, WiimoteLib.IRSensitivity.Maximum, true); }
/// <summary> /// Allows the game component to perform any initialization it needs to before starting /// to run. This is where it can query for any required services and load content. /// </summary> public override void Initialize() { Visible = false; Enabled = false; state = Game.Services.GetService(typeof(GameState)) as GameState; base.Initialize(); }
public LevelSelectView(SpriteBatch sb, GameState s) { spriteBatch = sb; state = s; offsetBottom = state.ViewPort.Height - 170; scoreColor = new Color(87, 50, 19); songColor = new Color(128, 93, 25); }
public WorldMapController(GameEngine g, GameState gm, SpriteBatch sb, InputBuffer bf) { game = g; gameState = gm; worldView = new WorldMapView(sb); spriteBatch = sb; buffer = bf; MediaPlayer.IsRepeating = true; }
public void LoadContent(ContentManager cm) { state = game.Services.GetService(typeof(GameState)) as GameState; background = cm.Load<Texture2D>("Images\\MainMenu\\newtitle"); storyHover = cm.Load<Texture2D>("Images\\MainMenu\\storymode_hover"); freeHover = cm.Load<Texture2D>("Images\\MainMenu\\freemode_hover"); exitHover = cm.Load<Texture2D>("Images\\MainMenu\\exitmode_hover"); song = cm.Load<Song>("journey"); MediaPlayer.Play(song); MediaPlayer.IsRepeating = true; MediaPlayer.Volume = 0.3f; }
public DialogController(GameState gm, SpriteBatch sb, DialogModel dm, string cityName, ContentManager cm) { gameState = gm; spriteBatch = sb; Dialog = dm; contentManager = cm; names = new Queue<String>(); lines = new Queue<String>(); colors = new Dictionary<String,Color>(); faces = new Dictionary<String,Texture2D>(); cutscenes = new Dictionary<String, Texture2D>(); startStopCues = new Dictionary<String, String>(); Parse(); speaker = ""; speech = cityName; color = Color.Black; screen = new DialogView(sb); stopCue = ""; }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { spriteBatch = new SpriteBatch(GraphicsDevice); buffer = new InputBuffer(); gameState = new GameState(); gameState.LoadContent(Content); // hack try { input = new WiiController(this, gameState, buffer); } catch (WiimoteLib.WiimoteNotFoundException) { input = new MouseController(this, gameState, buffer); } Services.AddService(typeof(GameState), gameState); menuController = new MenuController(this, gameState, spriteBatch); menuController.Initialize(); levelController = new LevelSelectController(gameState, spriteBatch); levelController.Initialize(); playlevel = new PlayLevel(this, gameState, spriteBatch, buffer); playlevel.Initialize(); worldController = new WorldMapController(this, gameState, spriteBatch, buffer); worldController.Initialize(); gameState.world = worldController; pauseController = new PauseScreenController(this, spriteBatch); pauseController.Initialize(); Components.Add(new GamerServicesComponent(this)); Components.Add(new Components.SaveManager(this)); Components.Add(new BatonView(this, spriteBatch)); base.Initialize(); }
public PlayLevel(Game g, GameState gm, SpriteBatch sb, InputBuffer buf) : base(g) { gameState = gm; actionList = new LinkedList<Movement>(); drawSet = new HashSet<Movement>(); buffer = buf; spriteBatch = sb; DrawOrder = 0; comboOn = false; comboCount = -1; started = false; failed = false; ended = false; failCount = 0; volume = 5; scaledVol = (float)(0.524 * Math.Pow(Math.E, volume / 10) - 0.425); BrokenStrings = new SoundEffect[3]; }
public MouseController(Game game, GameState gm, InputBuffer b) : base(game, gm, b) { }
public InputController(Game game, GameState gm, InputBuffer b) : base(game) { buffer = b; gameState = gm; }
public MenuController(Game g, GameState gm, SpriteBatch sb) { game = g; gameState = gm; menuView = new MenuView(g, sb, this); }
public override void Initialize() { state = Game.Services.GetService(typeof(GameState)) as GameState; base.Initialize(); }