static void Main() { using (var game = new PlatformGame()) { game.Run(); } }
public GameWorld(PlatformGame game) { this.game = game; Players = new List <Player>(); Bullets = new List <Projectile>(); Walls = new List <StaticTile>(); Powerups = new List <Powerup>(); }
public GameWorld(PlatformGame game) { this.game = game; Players = new List<Player>(); Bullets = new List<Projectile>(); Walls = new List<StaticTile>(); Powerups = new List<Powerup>(); }
public Particle(PlatformGame game, Vector2 position, HorizontalDirection horizontalDirection) { //spriteSheetInstance = new CustomSpriteSheetInstance(game.GameDataLoader.BulletImpactSpriteSheet, 2); Position = position; HorizontalDirection = horizontalDirection; BoundingBox = new CustomBoundingBox(); UpdateBoundingBox(); }
public Projectile(PlatformGame game, string shooterName, Vector2 position, HorizontalDirection horizontalDirection) { this.game = game; Position = position; this.shooterName = shooterName; HorizontalDirection = horizontalDirection; BoundingBox = new CustomBoundingBox(); UpdateBoundingBox(); }
protected override void OnModelCreating(ModelBuilder modelBuilder) { modelBuilder.Entity <PlatformGame>() .HasKey(pg => pg.Guid); modelBuilder.Entity <PlatformGame>() .Property(p => p.Price) .HasColumnType("decimal(18,2)"); modelBuilder.Entity <PlatformGame>() .HasOne(pg => pg.Game) .WithMany(g => g.Platforms) .HasForeignKey(pg => pg.GameId); modelBuilder.Entity <PlatformGame>() .HasOne(pg => pg.Platform) .WithMany(p => p.Games) .HasForeignKey(pg => pg.PlatformId); modelBuilder.Entity <Game>() .HasKey(g => g.Guid); modelBuilder.Entity <Platform>() .HasKey(g => g.Guid); modelBuilder.Entity <Discount>() .HasKey(d => d.Guid); modelBuilder.Entity <Discount>() .HasOne(d => d.PlatformGame) .WithMany(pg => pg.Discounts) .HasForeignKey(pg => pg.PlatformGameId); modelBuilder.Entity <Discount>() .Property(p => p.Price) .HasColumnType("decimal(18,2)"); Game game = new Game(Guid.Parse("26f2a34c-7f9f-40e6-aeca-6a875ace5be9"), "Pavlov", "FPS Shooter"); Platform platform = new Platform(Guid.Parse("c4149c8f-b816-4c75-ae8d-94c9b7d18c9b"), "Oculus Quest", "Mobile"); PlatformGame platformGame = new PlatformGame(game.Guid, platform.Guid, new DateTime(2019, 09, 15), 99); modelBuilder.Entity <Game>() .HasData(game); modelBuilder.Entity <Platform>() .HasData(platform); modelBuilder.Entity <PlatformGame>() .HasData(platformGame); base.OnModelCreating(modelBuilder); }
public Player(PlatformGame game, string name, CustomSpriteSheetDefinition spriteSheetDefinition) { this.game = game; HorizontalDirection = HorizontalDirection.None; BoundingBox = new CustomBoundingBox(); Name = name; Score = new Score(); Team = new NeutralTeam(); spriteSheetInstance = new CustomSpriteSheetInstance(spriteSheetDefinition, 3); }
/// <summary> /// Constructor /// </summary> public DebugCommandUI(PlatformGame game, SpriteFont font) : base(game) { Font = font; SimpleGame = game; // Create white texture. WhiteTexture = new Texture2D(GraphicsDevice, 1, 1); WhiteTexture.SetData(new [] { Color.White }); Prompt = DefaultPrompt; // Add this instance as a service. Game.Services.AddService(typeof(IDebugCommandHost), this); // Draw the command UI on top of everything DrawOrder = int.MaxValue; // Adding default commands. // Help command displays registered command information. RegisterCommand("help", "Show Command helps", delegate { int maxLen = commandTable.Values.Select(cmd => cmd.command.Length).Concat(new[] { 0 }).Max(); string fmt = String.Format("{{0,-{0}}} {{1}}", maxLen); foreach (CommandInfo cmd in commandTable.Values) { Echo(String.Format(fmt, cmd.command, cmd.description)); } }); // Clear screen command RegisterCommand("cls", "Clear Screen", delegate { lines.Clear(); }); // Echo command RegisterCommand("echo", "Display Messages", (host, command, args) => Echo(command.Substring(5))); }
private PlatformGame RegisterGameWithPlatform(RegisterGame request, Game game) { var existing = _context.PlatformGames.SingleOrDefault(pg => pg.GameId == game.Id && pg.PlatformId == request.Platform); if (existing == null) { var platformGame = new PlatformGame() { GameId = game.Id, Code = request.Code, PlatformId = request.Platform, Registered = DateTime.UtcNow }; _context.Add(platformGame); return(platformGame); } return(existing); }
public PowerupPickedUpHandler(PlatformGame game) { _game = game; }
public GameDataLoader(PlatformGame game) { this.game = game; }
public Editor(PlatformGame platformGame) { game = platformGame; }
public CheckGameStateHandler(PlatformGame game) { _game = game; }
public SpawnPlayersHandler(PlatformGame game) { _game = game; }
public StartGameHandler(PlatformGame game) { _game = game; }
public GoreFactory(PlatformGame game) { _game = game; }
public ShootHandler(PlatformGame game) { _game = game; }
/// <summary> /// Constructor /// </summary> public DebugCommandUI(PlatformGame game, SpriteFont font) : base(game) { Font = font; SimpleGame = game; // Create white texture. WhiteTexture = new Texture2D(GraphicsDevice, 1, 1); WhiteTexture.SetData(new [] { Color.White }); Prompt = DefaultPrompt; // Add this instance as a service. Game.Services.AddService(typeof(IDebugCommandHost), this); // Draw the command UI on top of everything DrawOrder = int.MaxValue; // Adding default commands. // Help command displays registered command information. RegisterCommand("help", "Show Command helps", delegate { int maxLen = commandTable.Values.Select(cmd => cmd.command.Length).Concat(new[] {0}).Max(); string fmt = String.Format("{{0,-{0}}} {{1}}", maxLen); foreach (CommandInfo cmd in commandTable.Values) { Echo(String.Format(fmt, cmd.command, cmd.description)); } }); // Clear screen command RegisterCommand("cls", "Clear Screen", delegate { lines.Clear(); }); // Echo command RegisterCommand("echo", "Display Messages", (host, command, args) => Echo(command.Substring(5))); }