public Fiende(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { this.gubbe = game.Player1; lever = true; drawLayer = 0.5f; }
public LavaEnemy(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { bild = spriteSheet.GetSubSprite(new Rectangle(249, 5, 20, 20)); hastighet = 1; movement = FiendeMovement.Follow; liv = 30; skada = 1; }
public LevelTest(Game1 game, Sprite spriteSheet, Random random1) : base() { spelObjektLista = new List<SpelObjekt>(); StoneTowerBoss f1 = new StoneTowerBoss(game, spriteSheet); f1.Position = new Vector2(300, 300); spelObjektLista.Add(f1); }
public Mina(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { bild = spriteSheet.GetSubSprite(new Rectangle(85, 4, 27, 22)); movement = FiendeMovement.Static; immobile = true; liv = 1; skada = 10; }
public StoneTower(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { bild = spriteSheet.GetSubSprite(new Rectangle(275, 7, 39, 39)); hastighet = 0; movement = FiendeMovement.Static; liv = 200; skada = 1; immobile = true; }
public Level2(Game1 game, Sprite spriteSheet, Random random1) : base() { spelObjektLista = new List<SpelObjekt>(); //Boss FirstBoss f1 = new FirstBoss(game, spriteSheet); f1.Position = new Vector2(random1.Next(870), random1.Next(670)); spelObjektLista.Add(f1); }
public FiendeTorn(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { bild = spriteSheet.GetSubSprite(new Rectangle(50, 0, 29, 29)); hastighet = 0; movement = FiendeMovement.Follow; liv = 100; skada = 1; immobile = true; }
public StoneTowerBoss(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { bild = spriteSheet.GetSubSprite(new Rectangle(394,4,70,70)); hastighet = 0; movement = FiendeMovement.Follow; liv = 2500; skada = 1; immobile = true; }
public LavaPool(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { this.game = game; this.spriteSheet = spriteSheet; bild = spriteSheet.GetSubSprite(new Rectangle(344, 3, 38, 35)); Position = new Vector2(-100, -100); hastighet = 0; liv = 1000; skada = 1; }
public StoneTowerBossStenBumling(Game1 game, Sprite spriteSheet, RunningState presentState) : base(game, spriteSheet) { this.game = game; this.spriteSheet = spriteSheet; bild = spriteSheet.GetSubSprite(new Rectangle(329, 36, 20, 20)); Position = new Vector2(-100, -100); hastighet = 2; liv = 1; skada = 30; }
public BigEnemyStone(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { this.game = game; this.spriteSheet = spriteSheet; bild = spriteSheet.GetSubSprite(new Rectangle(324, 21, 13, 13)); Position = new Vector2(-100, -100); hastighet = 3; liv = 1; skada = 20; }
public LavaSkott(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { this.game = game; this.spriteSheet = spriteSheet; bild = spriteSheet.GetSubSprite(new Rectangle(249, 28, 5, 5)); Position = new Vector2(-100, -100); hastighet = 4; liv = 1; skada = 1; }
public VanligtFiendeSkott(Game1 game, Sprite spriteSheet, RunningState presentState) : base(game, spriteSheet) { this.game = game; this.spriteSheet = spriteSheet; bild = spriteSheet.GetSubSprite(new Rectangle(40, 5, 5, 5)); Position = new Vector2(-100, -100); hastighet = 5; liv = 1; skada = 5; }
public StoneTowerBossSpawnSkott(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { this.game = game; this.spriteSheet = spriteSheet; bild = spriteSheet.GetSubSprite(new Rectangle(354, 42, 5, 5)); Position = new Vector2(-100, -100); hastighet = 10; liv = 1; skada = 1; }
public Level3(Game1 game, Sprite spriteSheet, Random random1) : base() { spelObjektLista = new List<SpelObjekt>(); for (int n = 0; n < 50; n++) { VanligFiende f1 = new VanligFiende(game, spriteSheet); f1.Position = new Vector2(random1.Next(870), random1.Next(670)); f1.SetRandomDirection(random1); spelObjektLista.Add(f1); } }
public StoneTowerBossSpawnedTower(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { this.game = game; this.spriteSheet = spriteSheet; bild = spriteSheet.GetSubSprite(new Rectangle(370, 48, 20, 20)); Position = new Vector2(-100, -100); movement = FiendeMovement.Follow; hastighet = 0; liv = 100; skada = 1; }
public Level6(Game1 game, Sprite spriteSheet, Random random1) : base() { spelObjektLista = new List<SpelObjekt>(); for (int n = 0; n < 20; n++) { LavaEnemy f1 = new LavaEnemy(game, spriteSheet); f1.Position = new Vector2(random1.Next(870), random1.Next(670)); f1.SetRandomDirection(random1); spelObjektLista.Add(f1); } }
public MinFiende(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { bild = spriteSheet.GetSubSprite(new Rectangle(117, 0, 18, 27)); hastighet = 1.5F; movement = FiendeMovement.Common; liv = 30; skada = 1; Random random = new Random(); riktning = new Vector2((float)(random.NextDouble() * 2 - 1), (float)(random.NextDouble() * 2 - 1)); riktning = GlobalFunctions.ScaleDirection(riktning); }
public BigStoneSkott(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { this.game = game; this.spriteSheet = spriteSheet; bild = spriteSheet.GetSubSprite(new Rectangle(324, 21, 13, 13)); position = new Vector2(-100, -100); hastighet = 2; liv = 10000; skada = 100; energiKostnad = 50; range = 400; oneTimeDamageLista = new List<SpelObjekt>(); }
public FirstBoss(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { //importera ny spriteSheet bild = spriteSheet.GetSubSprite(new Rectangle(142, 2, 32, 35)); hastighet = 2f; movement = FiendeMovement.Follow; liv = 750; skada = 1; Random random = new Random(); riktning = new Vector2((float)(random.NextDouble() * 2 - 1), (float)(random.NextDouble() * 2 - 1)); riktning = GlobalFunctions.ScaleDirection(riktning); }
public Level5(Game1 game, Sprite spriteSheet, Random random1) : base() { spelObjektLista = new List<SpelObjekt>(); StoneTower torn1 = new StoneTower(game, spriteSheet); torn1.Position = new Vector2(300, 300); spelObjektLista.Add(torn1); StoneTower torn2 = new StoneTower(game, spriteSheet); torn2.Position = new Vector2(700, 300); spelObjektLista.Add(torn2); StoneTower torn3 = new StoneTower(game, spriteSheet); torn3.Position = new Vector2(300, 500); spelObjektLista.Add(torn3); StoneTower torn4 = new StoneTower(game, spriteSheet); torn4.Position = new Vector2(700, 500); spelObjektLista.Add(torn4); }
public Level4(Game1 game, Sprite spriteSheet, Random random1) : base() { spelObjektLista = new List<SpelObjekt>(); for (int n = 0; n < 10; n++) { FiendeMyra myra = new FiendeMyra(game, spriteSheet); myra.Position = new Vector2(random1.Next(870), random1.Next(670)); myra.SetExternalRandom(random1); myra.SetRandomDirection(); spelObjektLista.Add(myra); } FiendeMyrEgg egg = new FiendeMyrEgg(game, spriteSheet); egg.Position = new Vector2(300, 300); spelObjektLista.Add(egg); }
public Level1(Game1 game, Sprite spriteSheet, Random random1) : base() { spelObjektLista = new List<SpelObjekt>(); //FiendeTorn FiendeTorn torn1 = new FiendeTorn(game, spriteSheet); torn1.Position = new Vector2(300, 300); spelObjektLista.Add(torn1); FiendeTorn torn2 = new FiendeTorn(game, spriteSheet); torn2.Position = new Vector2(700, 300); spelObjektLista.Add(torn2); FiendeTorn torn3 = new FiendeTorn(game, spriteSheet); torn3.Position = new Vector2(300, 500); spelObjektLista.Add(torn3); FiendeTorn torn4 = new FiendeTorn(game, spriteSheet); torn4.Position = new Vector2(700, 500); spelObjektLista.Add(torn4); //VanligFiende for (int n = 0; n < 10; n++) { VanligFiende f1 = new VanligFiende(game, spriteSheet); f1.Position = new Vector2(random1.Next(870), random1.Next(670)); spelObjektLista.Add(f1); } //MinGubbe Random random2 = new Random(); for (int n = 0; n < 5; n++) { MinFiende f1 = new MinFiende(game, spriteSheet); f1.Position = new Vector2(random2.Next(870), random2.Next(670)); spelObjektLista.Add(f1); } }
public Level2Knapp(Game1 game, Sprite spriteSheet, Vector2 position, Level level) : base(game, spriteSheet, position, level) { displaySprite = spriteSheet.GetSubSprite(new Rectangle(80, 80, 50, 30)); }
public void AddFrame(Sprite frame) { frames.Add(frame); }
public ExitKnapp(Game1 game, Sprite spriteSheet, Vector2 position) : base(spriteSheet, position) { this.game = game; displaySprite = spriteSheet.GetSubSprite(new Rectangle(0, 90, 80, 40)); }
public static bool VisiblePixelsColliding(Rectangle bounds1, Rectangle bounds2, Sprite sprite1, Sprite sprite2, Vector2 origin1, Vector2 origin2) { Rectangle intersectRect = IntersectRectangle(bounds1, bounds2); if (intersectRect == Rectangle.Empty) return false; int pixelCount = intersectRect.Width * intersectRect.Height; Color[] pixels1 = new Color[pixelCount]; Color[] pixels2 = new Color[pixelCount]; sprite1.Texture.GetData<Color>(0, Normalize(intersectRect, new Vector2(bounds1.X, bounds1.Y), Vector2.Zero, sprite1.SourceRectangle), pixels1, 0, pixelCount); sprite2.Texture.GetData<Color>(0, Normalize(intersectRect, new Vector2(bounds2.X, bounds2.Y), Vector2.Zero, sprite2.SourceRectangle), pixels2, 0, pixelCount); for (int i = 0; i < pixelCount; i++) { if (pixels1[i].A > ALPHA_THRESHOLD && pixels2[i].A > ALPHA_THRESHOLD) return true; } return false; }
public HowToPlayKnapp(Game1 game, Sprite spriteSheet, Vector2 position) : base(spriteSheet, position) { displaySprite = spriteSheet.GetSubSprite(new Rectangle(0, 130, 80, 40)); this.game = game; }
public SpelarSkott(Game1 game, Sprite spriteSheet) : base(game, spriteSheet) { }
public TestLevelKnapp(Game1 game, Sprite spriteSheet, Vector2 position, Level level) : base(game, spriteSheet, position, level) { displaySprite = spriteSheet.GetSubSprite(new Rectangle(80, 200, 50, 30)); this.game = game; }