public StaticEntity(Rekt h, Vector2 v, Texture2D s, Vector2 o, Vector2 e, float r) { Hitbox = h; Velocity = v; Sprite = s; Origin = o; Offset = e; Rotation = r; }
public Track(int l, int x, int y, ArrayList <Tuple <float, float> > a) { Length = l; Hitbox = new Rekt(x, y, l * 34, 8); Angles = a; }
public Spawner(Rekt h, Texture2D s, Entity e) { Hitbox = h; output = e; Sprite = s; }
protected override void LoadContent() { SpriteBatch = new SpriteBatch(GraphicsDevice); Finish = new Rekt(2000, 500, 200, 300); #region KartSprites = new Texture2D[12]; KartSprites[0] = Content.Load <Texture2D>("minekart/minekart0a"); KartSprites[1] = Content.Load <Texture2D>("minekart/minekart0b"); KartSprites[2] = Content.Load <Texture2D>("minekart/minekart1a"); KartSprites[3] = Content.Load <Texture2D>("minekart/minekart1b"); KartSprites[4] = Content.Load <Texture2D>("minekart/minekart2a"); KartSprites[5] = Content.Load <Texture2D>("minekart/minekart2b"); KartSprites[6] = Content.Load <Texture2D>("minekart/minekart3a"); KartSprites[7] = Content.Load <Texture2D>("minekart/minekart3b"); KartSprites[8] = Content.Load <Texture2D>("minekart/minekart4"); KartSprites[9] = Content.Load <Texture2D>("minekart/minekart4"); KartSprites[10] = Content.Load <Texture2D>("minekart/minekart5a"); KartSprites[11] = Content.Load <Texture2D>("minekart/minekart5b"); // KartSprites[12] = Content.Load<Texture2D> ("minekart/minekart6a"); // KartSprites[13] = Content.Load<Texture2D> ("minekart/minekart6b"); // KartSprites[14] = Content.Load<Texture2D> ("minekart/minekart7a"); // KartSprites[15] = Content.Load<Texture2D> ("minekart/minekart7b"); WinText = new Texture2D[8]; WinText[0] = Content.Load <Texture2D>("wintext/player1wins"); WinText[1] = Content.Load <Texture2D>("wintext/player2wins"); WinText[2] = Content.Load <Texture2D>("wintext/player3wins"); WinText[3] = Content.Load <Texture2D>("wintext/player4wins"); WinText[4] = Content.Load <Texture2D>("wintext/player5wins"); WinText[5] = Content.Load <Texture2D>("wintext/player6wins"); WinText[6] = Content.Load <Texture2D>("wintext/player7wins"); WinText[7] = Content.Load <Texture2D>("wintext/player8wins"); #endregion Kart = new Player(PlayerHitBox, new Vector2(5, 0), new Texture2D[] { KartSprites[0], KartSprites[1] }, new Vector2(23, 12), 5, new Vector2(8, 12), 0); Players = new Player[8]; //Players[0] = Kart.Copy(); Enemies = new LinkedList <Entity>(); Animated = new LinkedList <DynamicEntity>(); Moving = new LinkedList <Entity>(); Tracks = new LinkedList <Track>(); Displaced = CameraPos - new Vector2(Kart.Hitbox.X, Kart.Hitbox.Y); // level stuff Tracks.AddLast(new Track(2000, 100, 400)); //Tracks.AddLast(new Track(50, 700, 600)); foreach (Entity e in Enemies) { Moving.AddLast(e); } // Static Hazards //Enemies.AddLast(new StaticEntity(new Rekt(100, 650, 3000, 100), Vector2.Zero, Content.Load<Texture2D>("null"), Vector2.Zero, Vector2.Zero)); Moving.AddLast(Kart); Animated.AddLast(Kart); track = Content.Load <Texture2D>("track"); dot = Content.Load <Texture2D>("dot"); }
public bool Intersect(Rekt other) { return(!(X + Width < other.X || other.X + other.Width < X || Y + Height < other.Y || other.Y + other.Height < Y)); }