Guest User

Untitled

a guest
Nov 8th, 2015
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. constants
  2. w = 300
  3. angle = 90 works; angle = 130 doesn't work
  4.  
  5. Wall 1:
  6. a = angle
  7. start_x = 400
  8. start_y = 400
  9. center_x = start_x + (w/2) * cos(a)
  10. center_y = start_y + (w/2) * sin(a)
  11. end_x = start_x + w * cos(a)
  12. end_y = start_y + w * sin(a)
  13. => Draw wall at (center_x,center_y) with angle a
  14.  
  15. Wall 2:
  16. a = a + angle
  17. start_x = end_x
  18. start_y = end_y
  19. center_x = start_x + (w/2) * cos(a)
  20. center_y = start_y + (w/2) * sin(a)
  21. end_x = start_x + w * cos(a)
  22. end_y = start_y + w * sin(a)
  23. => Draw wall at (center_x,center_y) with angle a
  24.  
  25. Wall 3:
  26. a = a + angle
  27. start_x = end_x
  28. start_y = end_y
  29. center_x = start_x + (w/2) * cos(a)
  30. center_y = start_y + (w/2) * sin(a)
  31. end_x = start_x + w * cos(a)
  32. end_y = start_y + w * sin(a)
  33. => Draw wall at (center_x,center_y) with angle a
Advertisement
Add Comment
Please, Sign In to add comment