Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- List<Tile> t = LVLDT.Tiles[1];
- foreach (Tile b in t)
- {
- Rectangle r = new Rectangle(b.X, b.Y, 32, 32);
- Rectangle p = new Rectangle(PX + 3, PY, 26, 32);
- if (r.Intersects(p))
- {
- Collision = true;
- }
- }
- if (!Collision)
- {
- KeyboardState kstate = Keyboard.GetState();
- if (kstate.IsKeyDown(Keys.W)) { PY -= 4; }
- if (kstate.IsKeyDown(Keys.A)) { PX -= 4; }
- if (kstate.IsKeyDown(Keys.S)) { PY += 4; }
- if (kstate.IsKeyDown(Keys.D)) { PX += 4; }
- }
- Collision=false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement