コード例 #1
0
ファイル: Game1.cs プロジェクト: boomOr/2DTopDownShootEmAll
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            //this.graphics.PreferredBackBufferHeight = 900;
            //this.graphics.PreferredBackBufferWidth = 1600;
            //this.graphics.IsFullScreen = true;

            //Dimensionen vom Spiel festlegen(Bildschirmgroesse):
            statsGame.dimensions = new int[] { this.graphics.PreferredBackBufferWidth, this.graphics.PreferredBackBufferHeight };
            statsGame.ViewRectangle = new Rectangle(0, 0, statsGame.dimensions[0], statsGame.dimensions[1]);

            //Gameplaywerte mit Dimensions relativieren:
            statsGame.PlayerSpeed = statsGame.dimensions[0] / 250;

            //Umgebung erzeugen:
            env = new enviroment();
            env.initialize();
            NPCStats.mobSize = statsGame.lineSize;

            //Spieler erzeugen:
            player = new Player(env);
            env.PlayerRegister(player);

            //Fps:
            fps = new FpsMonitor();

            //HUD:
            hud = new HUD(env);
        }
コード例 #2
0
 public void setPlayer(Player player)
 {
     this.player = player;
 }
コード例 #3
0
 public void PlayerRegister(Player player)
 {
     this.player = player;
 }