public void CollidePlatform(Plattform plattform) { if (Hitbox().Intersects(plattform.Hitbox())) { direction *= -1; } }
private void Map() { for (int i = 0; i < strings.Count; i++) { for (int j = 0; j < strings[i].Length; j++) { if (strings[i][j] == 'P') { Player player = new Player_Jump(playerTex, new Vector2(j * 30, i * 30), 0, 0, new Rectangle(j * 30, i * 30, 30, 30), Window); ObjectList.Add(player); } if (strings[i][j] == 'x') { Plattform plattform = new Plattform(plattformTex, new Vector2(j * 30, i * 30), 0, 0); ObjectList.Add(plattform); } if (strings[i][j] == 'm') { movingPlattform = new MovingPlattform(playerTex, new Vector2(j * 30, i * 30), 0, 0); ObjectList.Add(movingPlattform); } } } }
private void Map() { for (int i = 0; i < strings.Count; i++) { for (int j = 0; j < strings[i].Length; j++) { if (strings[i][j] == 'x') { Plattform p = new Plattform(plattformtex, new Vector2(j * 30, i * 30), new Rectangle(j * 30, i * 30, 30, 30)); ObjectList.Add(p); } if (strings[i][j] == 'P') { Player P = new Player(playertex, new Vector2(j * 30, i * 30), new Rectangle(j * 30, i * 30, 30, 30)); ObjectList.Add(P); } } } }