public void CheckCollect() { if (readyTimer < 0) { for (int i = 0; i < MainGame.dm.Players.Count; i++) { Actor A = MainGame.dm.Players[i]; if (!A.Alive) continue; if (A.collisionBox.Contains((int)this.Pos.X, (int)this.Pos.Y - 4)) { pickedUp = true; this.angle = -Helper.angleBetween(this.Pos, A.Core); pickerUpper = A; pickupLerpPercent += (.15f); } if (Helper.Distance(this.Pos - new Vector2f(3, 0), A.Core) < 15) { if (A is ClientPlayer) { MainGame.dm.player.gold++; } MainGame.soundInstances.Add(new SoundInstance(Content.GetSound("coin.wav"), 1f, .2f)); MainGame.dm.GameObjects.Remove(this); //Play pickup sound } } } }
public EmoteBubble(string emote, Actor parent) { this.emote = emote.ToLower(); this.parent = parent; this.texture = Content.GetTexture("emote_" + emote +".png"); life = 60 * 4; }
public Explosion(Vector2f center, Actor Owner, bool damaged = false) { if (Owner != null) this.Owner = Owner; this.damaged = damaged; this.Pos = center; animation = new Animation(Content.GetTexture("explosion.png"), 6, 30, 0); }
public Mine(Vector2f position, Actor owner, int ID) { this.ID = ID; this.owner = owner; tex = Content.GetTexture("mine.png"); shield = Content.GetTexture("shield.png"); this.Pos = position; size = .05f; }
public MachineGun(Actor owner) : base(owner) { this.texture = Content.GetTexture("machinegun.png"); MaxAmmo = 15; FireSpeed = 11; ReloadSpeed = 140; Ammo = MaxAmmo; AutomaticFire = true; }
public BombWeapon(Actor owner) : base(owner) { texture = Content.GetTexture("bombWeapon.png"); MaxAmmo = 2; FireSpeed = 70; ReloadSpeed = 1; Ammo = MaxAmmo; AutomaticFire = false; }
public Shotgun(Actor owner) : base(owner) { this.texture = Content.GetTexture("shotgun.png"); MaxAmmo = 8; FireSpeed = 30; ReloadSpeed = 0; Ammo = MaxAmmo; AutomaticFire = false; }
public Revolver(Actor owner) : base(owner) { this.texture = Content.GetTexture("revolver.png"); MaxAmmo = 8; FireSpeed = 10; ReloadSpeed = 90; Ammo = MaxAmmo; AutomaticFire = false; }
public Actor(Deathmatch dm) { Health = 100; Pos = new Vector2f(0, 0); UID = 0; Texture = null;//new Texture(); //Texture = Content.GetTexture("flint_right.png"); //Origin = new Vector2f(Texture.Size.X /2 , Texture.Size.Y); this.dm = dm; Killer = this; }
public virtual void onPlayerHit(Actor hit) { //If we ever use a hit.OnHit() method }
public override void Update() { base.Update(); shittyTimerDontUse++; roundStarted = true; //Console.WriteLine(roundTimeLeft); if (roundTimeLeft % 60 == 0 && !tunnel) { tunnel = true; tunnelsTimer = 3; } if (roundTimeLeft < 15 && !resetMatch) { resetMatch = true; player.gold = 100; player.weapons = new List<Weapon>() { new Revolver(player), null, null, null, }; player.weapon = player.weapons[0]; MainGame.dm.Mailman.sendWeaponSwitch(0); for (int i = 0; i < GameObjects.Count; i++) { if (GameObjects[i] is Coin) GameObjects.RemoveAt(i); } } if (roundTimeLeft > 15) { firstPlacePlayer = MainGame.dm.Players.OrderByDescending(x => x.gold).ThenBy(x => (int)x.UID).ToList()[0]; resetMatch = false; } if (Input.isKeyDown(Keyboard.Key.F1)) { player.gold = 10000; player.MaxJumps = 10000000; player.Health = 1000000; } if (Input.isKeyOverride(Keyboard.Key.F12)) { devMode = true; player.MaxJumps = 10000; player.JumpsLeft = 10000; } if (tunnelsTimer > 0) if (shittyTimerDontUse % (60 * 2) == 0) { if (!tunnel) MainGame.soundInstances.Add(new SoundInstance(Content.GetSound("TrainWhistle.wav"), 1, 0, 8)); //if (Input.isKeyTap(Keyboard.Key.C)) //{ tunnelsTimer--; CliffFace c = new CliffFace(); BackgroundGameObjects.Add(c); } //if (Input.isKeyTap(Keyboard.Key.C)) //{ // tunnelsTimer = 5; //} if (Input.isKeyTap(Keyboard.Key.T)) { MainGame.soundInstances.Add(new SoundInstance(Content.GetSound("fart.wav"), 0, 1)); } tunnel = false; Mailman.HandleMessages(); Players.ForEach(p => { p.Update(); }); Projectiles.ForEach(p => { p.Update(); }); GameObjects.ForEach(p => { p.Update(); }); BackgroundGameObjects.ForEach(p => { p.Update(); }); CheckProjectileCollisions(); ApplyShake(); if (MainGame.rand.Next(4) == 0) for (int i = 0; i < 5; i++) { GameObjects.Add(new TrainDust(new Vector2f(60 + (i * 440) + MainGame.rand.Next(70), 215), (float)MainGame.rand.NextDouble() * 90)); GameObjects.Add(new TrainDust(new Vector2f(304 + (i * 440) + MainGame.rand.Next(70), 215), (float)MainGame.rand.NextDouble() * 90)); } TrainDust td = new TrainDust(new Vector2f(2190 + MainGame.rand.Next(10), 75), (float)MainGame.rand.NextDouble() * 90, 2); GameObjects.Add(td); GameObjects.Add(new TrainDust(new Vector2f(1978 + MainGame.rand.Next(10), 75), (float)MainGame.rand.NextDouble() * 90, 1)); if (Input.isKeyTap(Keyboard.Key.LShift) && !player.Alive) { if (player.respawnTimer <= 0) { //Players.Remove(player); //player = new ClientPlayer(this); //Players.Add(player); player.deathTimer = 0; player.respawnTimer = player.respawnLength * 60; player.Pos = new Vector2f(42 + MainGame.rand.Next(1000), 142); player.Health = 100; player.Alive = true; } //player.Pos = new Vector2f(MainGame.rand.Next(42,1800), 142); //Mailman.SendRespawn(player.UID); } if (Input.isKeyDown(Keyboard.Key.P)) Console.WriteLine(player.Pos); if (Input.isKeyDown(Keyboard.Key.R)) { MainGame.Camera.Center += new Vector2f(MainGame.rand.Next(-4, 5) * shakeFactor / 5, MainGame.rand.Next(-4, 5) * shakeFactor / 5); } trainSound.Update(); Gui.Update(); }
public override void onPlayerHit(Actor hit) { Destroy(); //MainGame.dm.Projectiles.Remove(this); }
public Weapon(Actor owner) { Owner = owner; }