Пример #1
0
 public ProjHandler(SpriteBatch mainSpriteBatch, Camera2D mainCamera, Player mainPlayer, Level currentLevel)
 {
     spriteBatch = mainSpriteBatch;
     cam = mainCamera;
     player = mainPlayer;
     level = currentLevel;
 }
Пример #2
0
 // you Must Ready the ProjHandler; mostly because the ProjHandler will use a spritebatch and has its own check for intersections
 public void ReadyWeapons(SpriteBatch a,Camera2D b, Level c)
 {
     readyToFire = true;
     playerWeapons = new ProjHandler(a, b, this, c);
     def = new projectile((float).1, Color.Green, pos, PlayerTexture, 0, 0);
     playerWeapons.addProjectile(def);
 }
Пример #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();
 }