Logo Bolo: a re-envisioning of the classic tank game by Stuart Cheshire in NetLogo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 line
772 B

  1. ;; lobo: Logo Bolo
  2. ;; (c) Ben Kurtovic, 2011
  3. breed [tanks tank]
  4. tanks-own [
  5. acceleration
  6. friction
  7. is-accelerating?
  8. is-player?
  9. max-speed
  10. max-turn
  11. speed
  12. team
  13. ]
  14. to set-tank-vars [tank-team player-tank?]
  15. set heading 0
  16. set acceleration 0.03
  17. set friction 0.0075
  18. set is-accelerating? false
  19. set is-player? player-tank?
  20. set max-speed 0.25
  21. set max-turn 24
  22. set speed 0
  23. set team tank-team
  24. set color get-tank-color
  25. end
  26. to do-tank-logic
  27. if is-accelerating? [
  28. set speed speed + acceleration
  29. if speed > max-speed [
  30. set speed max-speed
  31. ]
  32. ]
  33. fd speed
  34. set speed speed - friction
  35. if speed < 0 [
  36. set speed 0
  37. ]
  38. end
  39. to-report get-tank-color
  40. if is-player? [ report gray ]
  41. if team = 0 [ report green ]
  42. report red
  43. end