Exemplo n.º 1
0
 public ProjHandler(SpriteBatch mainSpriteBatch, Camera2D mainCamera, Player mainPlayer, Level currentLevel)
 {
     spriteBatch = mainSpriteBatch;
     cam = mainCamera;
     player = mainPlayer;
     level = currentLevel;
 }
Exemplo n.º 2
0
 public void AddBullet(Player player)
 {
     if (player.Direction == 0)
         bullets1.Add(player.Position);
     else
         bullets2.Add(player.Position);
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
        /// <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");
        }