예제 #1
0
 static void Main()
 {
     using (var game = new PlatformGame())
     {
         game.Run();
     }
 }
예제 #2
0
 static void Main()
 {
     using (var game = new PlatformGame())
     {
         game.Run();
     }
 }
예제 #3
0
 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>();
 }
예제 #5
0
        public Particle(PlatformGame game, Vector2 position, HorizontalDirection horizontalDirection)
        {
            //spriteSheetInstance = new CustomSpriteSheetInstance(game.GameDataLoader.BulletImpactSpriteSheet, 2);

            Position = position;
            HorizontalDirection = horizontalDirection;

            BoundingBox = new CustomBoundingBox();
            UpdateBoundingBox();
        }
예제 #6
0
        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();
        }
        public Projectile(PlatformGame game, string shooterName, Vector2 position, HorizontalDirection horizontalDirection)
        {
            this.game = game;

            Position            = position;
            this.shooterName    = shooterName;
            HorizontalDirection = horizontalDirection;

            BoundingBox = new CustomBoundingBox();
            UpdateBoundingBox();
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }
예제 #11
0
        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);
        }
예제 #12
0
        /// <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)));
        }
예제 #13
0
        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;
 }
예제 #15
0
 public GameDataLoader(PlatformGame game)
 {
     this.game = game;
 }
예제 #16
0
 public Editor(PlatformGame platformGame)
 {
     game = platformGame;
 }
예제 #17
0
 public CheckGameStateHandler(PlatformGame game)
 {
     _game = game;
 }
 public GameDataLoader(PlatformGame game)
 {
     this.game = game;
 }
 public SpawnPlayersHandler(PlatformGame game)
 {
     _game = game;
 }
예제 #20
0
 public Editor(PlatformGame platformGame)
 {
     game = platformGame;
 }
예제 #21
0
 public StartGameHandler(PlatformGame game)
 {
     _game = game;
 }
예제 #22
0
 public GoreFactory(PlatformGame game)
 {
     _game = game;
 }
예제 #23
0
 public ShootHandler(PlatformGame game)
 {
     _game = game;
 }
예제 #24
0
        /// <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)));
        }