コード例 #1
0
ファイル: GameRoot.cs プロジェクト: lgallucci/LouGames
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Art.Load(Content);

            // TODO: use this.Content to load your game content here
            ship        = new Ship(Art.Ship, ScaleToHighDPI(shipSize), ScaleToHighDPI(shipSize));
            ship.Height = 125; ship.Width = 100;

            swarm      = new ShipCollection(Art.Swarm, ScaleToHighDPI(swarmSize), ScaleToHighDPI(swarmSize));
            starsFront = new RollingSprite(Art.StarsFront, ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            starsBack  = new RollingSprite(Art.StarsBack, ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            lives      = new LivesPanel(Art.Ship, ScaleToHighDPI(.4f), ScaleToHighDPI(.4f));
        }
コード例 #2
0
ファイル: StarShooter.cs プロジェクト: lgallucci/LouGames
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            // TODO: use this.Content to load your game content here
            ship        = new Ship(Content.Load <Texture2D>("ship"), Content.Load <Texture2D>("lazer"), Content.Load <Texture2D>("swarm_explode"), ScaleToHighDPI(shipSize), ScaleToHighDPI(shipSize));
            ship.Height = 125; ship.Width = 100;

            swarm           = new ShipCollection(Content.Load <Texture2D>("swarm"), Content.Load <Texture2D>("lazer"), Content.Load <Texture2D>("swarm_explode"), ScaleToHighDPI(swarmSize), ScaleToHighDPI(swarmSize));
            starsFront      = new RollingSprite(Content.Load <Texture2D>("starsFront"), ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            starsBack       = new RollingSprite(Content.Load <Texture2D>("starsBack"), ScaleToHighDPI(1.1f), ScaleToHighDPI(1f), screenWidth, screenHeight);
            lives           = new LivesPanel(Content.Load <Texture2D>("ship"), ScaleToHighDPI(.4f), ScaleToHighDPI(.4f));
            scoreFont       = Content.Load <SpriteFont>("Score");
            stateFont       = Content.Load <SpriteFont>("GameState");
            stateFontMedium = Content.Load <SpriteFont>("GameStateMedium");
            gameOverTexture = Content.Load <Texture2D>("game-over");
        }
コード例 #3
0
ファイル: LivesPanel.cs プロジェクト: slavikgav/refugeegame
 void Awake()
 {
     pause    = false;
     instance = this;
 }
コード例 #4
0
 void Start()
 {
     current = this;
 }