// Methods /// <summary> /// Creates a new TrackSelect state. /// </summary> /// <param name="Host">Hosting game. Cannot be null.</param> /// <param name="Tracks"></param> /// <param name="Font"></param> public TrackSelectState(ActGame Host, List <Track> Tracks, SpriteFont Font) : base(Host) { if (Tracks == null || Tracks.Count <= 0) { throw new ArgumentNullException("Tracks", "Cannot be null nor empty."); } if (Font == null) { throw new ArgumentNullException("Font"); } this.Font = Font; this.Tracks = Tracks; TrackSelected = new int[noPlayers]; DiffSelected = new int[noPlayers]; diffSelectListPosition = new Vector2[noPlayers]; resultPosition = new Vector2[noPlayers]; selectionListPosition = new Vector2[noPlayers]; for (int i = 0; i < SelectionList.Length; ++i) { SelectionList[i] = new LinkedList <TrackSelection>(); } diffSelectListPosition[0] = new Vector2(80, 30); diffSelectListPosition[1] = new Vector2(520, 30); selectionListPosition[0] = new Vector2(80, 300); selectionListPosition[1] = new Vector2(520, 300); resultPosition[0] = new Vector2(100, 150); resultPosition[1] = new Vector2(300, 150); }
public ResultsState(ActGame Host, ScoreReport Left, ScoreReport Right, SpriteFont Font) : base(Host) { this.Left = Left; this.Right = Right; this.sysFont = Font; }
// Methods /// <summary> /// Creates a new TrackSelect state. /// </summary> /// <param name="Host">Hosting game. Cannot be null.</param> /// <param name="Tracks"></param> /// <param name="Font"></param> public TrackSelectState(ActGame Host, List<Track> Tracks, SpriteFont Font) : base(Host) { if (Tracks == null || Tracks.Count <= 0) throw new ArgumentNullException("Tracks", "Cannot be null nor empty."); if (Font == null) throw new ArgumentNullException("Font"); this.Font = Font; this.Tracks = Tracks; TrackSelected = new int[noPlayers]; DiffSelected = new int[noPlayers]; diffSelectListPosition = new Vector2[noPlayers]; resultPosition = new Vector2[noPlayers]; selectionListPosition = new Vector2[noPlayers]; for (int i = 0; i < SelectionList.Length; ++i) SelectionList[i] = new LinkedList<TrackSelection>(); diffSelectListPosition[0] = new Vector2(80, 30); diffSelectListPosition[1] = new Vector2(520, 30); selectionListPosition[0] = new Vector2(80, 300); selectionListPosition[1] = new Vector2(520, 300); resultPosition[0] = new Vector2(100, 150); resultPosition[1] = new Vector2(300, 150); }
public Fighter(ActGame game, Rectangle ValidRect, Bullet template, RegisterBulletFunc RegisterBullet) { this.ValidRect = ValidRect; this.game = game; this.template = template; this.RegisterBullet = RegisterBullet; }
/// <summary> /// Creates a new GameState object. /// </summary> /// <param name="Host">Hosting game. Cannot be null.</param> protected GameState(ActGame Host) { if (Host == null) { throw new ArgumentNullException("Host"); } this.Host = Host; }
/// <summary> /// Creates a new GameState object. /// </summary> /// <param name="Host">Hosting game. Cannot be null.</param> protected GameState(ActGame Host) { if (Host == null) throw new ArgumentNullException("Host"); this.Host = Host; }
public TitleState(ActGame Host, SpriteFont Font) : base(Host) { sysFont = Font; }
// Methods public PlayingState(ActGame Host, Configuration.IOConfig.KeyboardConfig.PlayerKeyConfig LeftControlConfig, Configuration.IOConfig.KeyboardConfig.PlayerKeyConfig RightControlConfig, LinkedList<TrackSelection>[] Selections) : base(Host) { FighterSpriteSheets = new SpriteSheet[noPlayers]; FighterSpriteSheets[atk] = Host.fighterSpriteSheet; FighterSpriteSheets[def] = Host.fighterSpriteSheet; InitialPositions = new Vector2[noPlayers]; InitialPositions[atk] = new Vector2(400, 400); InitialPositions[def] = new Vector2(400, 200); ValidRects = new Rectangle[noPlayers]; ValidRects[atk] = new Rectangle(250, 250, 300, 150); ValidRects[def] = new Rectangle(250, 50, 300, 150); bullet = new Bullet(); bullet.Sprite = Host.bulletSpriteSheet.FrameSprite(0); Fighters = new Fighter[noPlayers]; for (int i = 0; i < noPlayers; ++i) { Fighters[i] = new Fighter(Host, ValidRects[i], bullet, RegisterBullet); Fighters[i].Sprite = FighterSpriteSheets[i].FrameSprite(0); } Keyconfigs = new Configuration.IOConfig.KeyboardConfig.PlayerKeyConfig[noPlayers]; Keyconfigs[atk] = LeftControlConfig; Keyconfigs[def] = RightControlConfig; SetActivePlayer(PlayerIndex.One); Ps = new ParticleSystem(); Re = new RhythmEngine(Host.Config); Re.SelectionList = Selections; Re.LeftPlayer.VisibleRange = 2000; Re.RightPlayer.VisibleRange = 2000; Re.LeftPlayer.ShowDebug = false; Re.RightPlayer.ShowDebug = true; Rr = new RhythmRenderer(Re); Rr.Font = Host.sysFont; Rr.LeftDrawRect = new Rectangle(8, 8, 192, 350); Rr.RightDrawRect = new Rectangle(600, 8, 192, 350); LeftController = Host.LeftController; RightController = Host.RightController; // TODO: Debug AI //LeftController = new AiController(Host.Config.IO.Keyboard.Left.Rhythm.KeyCount, Fighters[atk], Re.players[atk]); RightController = new AiController(Host.Config.IO.Keyboard.Right.Rhythm.KeyCount, Fighters[def], Re.players[def]); Re.Lock(); Re.Play(); Particle particle = new Particle(Host.particle1SpriteSheet); GraphicsObject[] FighterGraphicObjs = new GraphicsObject[noPlayers]; for (int i = 0; i < noPlayers; ++i) { FighterGraphicObjs[i] = new GraphicsObject(Fighters[i]); } foreach (GraphicsObject obj in FighterGraphicObjs) { obj.CreateEmitter(new Vector2(0, 5), 0.15f, -MathHelper.PiOver2, MathHelper.PiOver4, 100, 250, 150, particle, true); obj.CreateEmitter(new Vector2(-5, 2), 0.15f, -0.6f * MathHelper.PiOver2, MathHelper.PiOver4 / 2.0f, 50, 250, 150, particle, true); obj.CreateEmitter(new Vector2(5, 2), 0.15f, -1.4f * MathHelper.PiOver2, MathHelper.PiOver4 / 2.0f, 50, 250, 150, particle, true); Ps.RegisterGraphicsObject(obj); } }
// Methods public PlayingState(ActGame Host, Configuration.IOConfig.KeyboardConfig.PlayerKeyConfig LeftControlConfig, Configuration.IOConfig.KeyboardConfig.PlayerKeyConfig RightControlConfig, LinkedList <TrackSelection>[] Selections) : base(Host) { FighterSpriteSheets = new SpriteSheet[noPlayers]; FighterSpriteSheets[atk] = Host.fighterSpriteSheet; FighterSpriteSheets[def] = Host.fighterSpriteSheet; InitialPositions = new Vector2[noPlayers]; InitialPositions[atk] = new Vector2(400, 400); InitialPositions[def] = new Vector2(400, 200); ValidRects = new Rectangle[noPlayers]; ValidRects[atk] = new Rectangle(250, 250, 300, 150); ValidRects[def] = new Rectangle(250, 50, 300, 150); bullet = new Bullet(); bullet.Sprite = Host.bulletSpriteSheet.FrameSprite(0); Fighters = new Fighter[noPlayers]; for (int i = 0; i < noPlayers; ++i) { Fighters[i] = new Fighter(Host, ValidRects[i], bullet, RegisterBullet); Fighters[i].Sprite = FighterSpriteSheets[i].FrameSprite(0); } Keyconfigs = new Configuration.IOConfig.KeyboardConfig.PlayerKeyConfig[noPlayers]; Keyconfigs[atk] = LeftControlConfig; Keyconfigs[def] = RightControlConfig; SetActivePlayer(PlayerIndex.One); Ps = new ParticleSystem(); Re = new RhythmEngine(Host.Config); Re.SelectionList = Selections; Re.LeftPlayer.VisibleRange = 2000; Re.RightPlayer.VisibleRange = 2000; Re.LeftPlayer.ShowDebug = false; Re.RightPlayer.ShowDebug = true; Rr = new RhythmRenderer(Re); Rr.Font = Host.sysFont; Rr.LeftDrawRect = new Rectangle(8, 8, 192, 350); Rr.RightDrawRect = new Rectangle(600, 8, 192, 350); LeftController = Host.LeftController; RightController = Host.RightController; // TODO: Debug AI //LeftController = new AiController(Host.Config.IO.Keyboard.Left.Rhythm.KeyCount, Fighters[atk], Re.players[atk]); RightController = new AiController(Host.Config.IO.Keyboard.Right.Rhythm.KeyCount, Fighters[def], Re.players[def]); Re.Lock(); Re.Play(); Particle particle = new Particle(Host.particle1SpriteSheet); GraphicsObject[] FighterGraphicObjs = new GraphicsObject[noPlayers]; for (int i = 0; i < noPlayers; ++i) { FighterGraphicObjs[i] = new GraphicsObject(Fighters[i]); } foreach (GraphicsObject obj in FighterGraphicObjs) { obj.CreateEmitter(new Vector2(0, 5), 0.15f, -MathHelper.PiOver2, MathHelper.PiOver4, 100, 250, 150, particle, true); obj.CreateEmitter(new Vector2(-5, 2), 0.15f, -0.6f * MathHelper.PiOver2, MathHelper.PiOver4 / 2.0f, 50, 250, 150, particle, true); obj.CreateEmitter(new Vector2(5, 2), 0.15f, -1.4f * MathHelper.PiOver2, MathHelper.PiOver4 / 2.0f, 50, 250, 150, particle, true); Ps.RegisterGraphicsObject(obj); } }