Exemplo n.º 1
0
 public Weapon(GraphicsContext g, Collision c, Texture2D t)
 {
     graphics = g;
     collisions = c;
     s = new Sprite (g, t);
     s.Center = new Vector2(0.5f, 0.8f);
 }
Exemplo n.º 2
0
 public Machinegun(Vector3 pos, GraphicsContext g, Collision c)
     : base(g, c, new Texture2D("/Application/Assets/weapon3.png",false))
 {
     FireRate = 0.1f;//Bullets per Second
     ReloadRate = 4000;//Milliseconds
     Mag = 50;//Max rounds in magazine
     s.Position = pos;
 }
Exemplo n.º 3
0
 public Pistol(Vector3 pos, GraphicsContext g, Collision c)
     : base(g, c, new Texture2D("/Application/Assets/weapon1.png",false))
 {
     FireRate = 0;//Seconds per bullet
     ReloadRate = 1000;//Milliseconds
     Mag = 10;//Max rounds in magazine
     s.Position = pos;
 }
Exemplo n.º 4
0
 public Item3(GraphicsContext g, Collision c, Vector3 pos, Item3.Type i)
 {
     type = i;
     s = new Sprite(g, new Texture2D("/Application/Assets/weapon3.png", false));
     s.Position = pos;
     graphics = g;
     col = c;
     IsAlive = true;
 }
Exemplo n.º 5
0
 public Enemy1(GraphicsContext g, Collision c, Vector3 pos)
     : base(g, c, new Texture2D("/Application/Assets/player.png",false), pos)
 {
     Duration = 50;
     Size = 40;
     Frames = 8;
     MovementSpeed = 2;
     s.SetColor(new Vector4(1f, 0f, 0f, 1f));
 }
Exemplo n.º 6
0
 public Enemy(GraphicsContext g, Collision c, Texture2D t, Vector3 pos)
 {
     graphics = g;
     collisions = c;
     s = new Sprite(g,t);
     s.Center = new Vector2(0.5f, 0.5f);
     s.Position = pos;
     s.Width = 40;
     isAlive = true;
 }
Exemplo n.º 7
0
 public Item(GraphicsContext g, Collision c, Vector3 pos, Item.Type i, Vector4 uc)
 {
     type = i;
     s = new Sprite(g, new Texture2D("/Application/Assets/weaponbase.png", false));
     s.Position = pos;
     s.SetColor(uc);
     graphics = g;
     col = c;
     IsAlive = true;
 }
Exemplo n.º 8
0
 public Enemy3(GraphicsContext g, Collision c, Vector3 pos)
     : base(g, c, new Texture2D("/Application/Assets/player.png",false), pos)
 {
     Duration = 50;
     Size = 40;
     Frames = 8;
     MovementSpeed = 2;
     s.SetColor(new Vector4(0f, 0f, 1f, 1f));
     random = new Vector3(rand.Next(30, 930), rand.Next (30, 514),0);
 }
Exemplo n.º 9
0
 public Bullet(GraphicsContext g, Collision c, float rot, Vector3 pos)
 {
     graphics = g;
     collisions = c;
     Texture2D t = new Texture2D("/Application/Assets/bullet.png",false);
     s = new Sprite (g, t);
     s.SetColor(new Vector4(1,1,1,1));
     isAlive = true;
     velocity = 10;
     s.Position = pos;
     s.Rotation = rot;
     s.Center = new Vector2(0.5f, 0.5f);
 }
Exemplo n.º 10
0
 public static void Initialize()
 {
     // Set up the graphics system
     Random rand = new Random();
     graphics = new GraphicsContext ();
     clock = new Stopwatch();
     clock.Start();
     col = new Collision(graphics);
     p = new Player(graphics, col);
     col.p = p;
     col.elist.Add (new Enemy1(graphics, col, new Vector3(rand.Next (0,960),rand.Next (0,544),0)));
     col.ilist.Add(new Item(graphics, col, new Vector3(rand.Next(60,901), rand.Next(44,501), 0), Item.Type.Pistol, new Vector4(1,.5f,0,1)));
     col.ilist.Add(new Item(graphics, col, new Vector3(rand.Next(60,901), rand.Next(44,501), 0), Item.Type.Shotgun, new Vector4(0,1,0,1)));
     col.ilist.Add(new Item(graphics, col, new Vector3(rand.Next(60,901), rand.Next(44,501), 0), Item.Type.Machinegun,new Vector4(0,0,1,1)));
 }
Exemplo n.º 11
0
 public Player(GraphicsContext g, Collision c)
 {
     graphics = g;
     collisions = c;
     Texture2D tex = new Texture2D("/Application/Assets/player.png", false);
     s = new Sprite(g,tex);
     isAlive = true;
     movementSpeed = 5;
     rotSpeed = .05f;
     s.Position= new Vector3(25,25,0);
     duration = 50;
     size = 40;
     frames = 8;
     s.Width = size;
     s.Center= new Vector2(0.5f, 0.5f);
     s.Rotation = (float)Math.PI/2f;
     wlist = new List<Weapon>();
     health = 5;
 }
Exemplo n.º 12
0
 public PistolItem(GraphicsContext g, Collision c, Vector3 pos)
     : base(g, c, pos, new Texture2D("/Application/Assets/weapon1.png", false))
 {
 }