Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (dir == Direction.NORTH)
- {
- if (!CheckCollision())
- {
- this.y -= moveSpeed;
- }
- else
- {
- this.y += 7;
- }
- }
- else if (dir == Direction.SOUTH)
- {
- if (!CheckCollision())
- {
- this.y += moveSpeed;
- }
- else
- {
- this.y -= 7;
- }
- }
- else if (dir == Direction.EAST)
- {
- if (!CheckCollision())
- {
- this.x += moveSpeed;
- }
- else
- {
- this.x -= 7;
- }
- }
- else if (dir == Direction.WEST)
- {
- if (!CheckCollision())
- {
- this.x -= moveSpeed;
- }
- else
- {
- this.x += 7;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment