コード例 #1
0
ファイル: ProjHandler.cs プロジェクト: k0hlrabi/RGB
 public ProjHandler(SpriteBatch mainSpriteBatch, Camera2D mainCamera, Player mainPlayer, Level currentLevel)
 {
     spriteBatch = mainSpriteBatch;
     cam = mainCamera;
     player = mainPlayer;
     level = currentLevel;
 }
コード例 #2
0
ファイル: Bullet.cs プロジェクト: kwhalen89/XNA-game
 public void AddBullet(Player player)
 {
     if (player.Direction == 0)
         bullets1.Add(player.Position);
     else
         bullets2.Add(player.Position);
 }
コード例 #3
0
ファイル: Game1.cs プロジェクト: k0hlrabi/RGB
 protected override void Initialize()
 {
     //GlobalVariables= GraphicsDevice.Viewport.Width;
     windowHeight = GraphicsDevice.Viewport.Height;
     awesome.PlayerStartX = 0;
     awesome.PlayerStartY = -100;
     awesome.GameSpaceHeight = 2000;
     awesome.GameSpaceWidth = 10000;
     one = new Player(awesome.PlayerStartX,awesome.PlayerStartY, Content.Load<Texture2D>("spritesheet"),3);
     one.ReadyWeapons(spriteBatch, cam, awesome);
      cam = new Camera2D(GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
      cam.Zoom = .5f;
     // TODO: Add your initialization logic here
      isGameActive = true;
     base.Initialize();
 }
コード例 #4
0
ファイル: Game1.cs プロジェクト: d13nunes/KillThingsGame
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        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
            bulletText = Content.Load<Texture2D>("bullet");
            Animation playerAnimation = new Animation();
            Texture2D tank = Content.Load<Texture2D>("tank");
            playerAnimation.Initialize(tank,
                                           new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2),
                                           tank.Width,
                                           tank.Height,
                                           1,0,Color.White,1f,true);
            player = new Player();
            player.Initialize(new Vector2(graphics.GraphicsDevice.Viewport.Width / 2, graphics.GraphicsDevice.Viewport.Height / 2), tank, 10f);

            enemyText = Content.Load<Texture2D>("garfield");

            sf = Content.Load<SpriteFont>("gameFont");
        }