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.
|
- ;; lobo: Logo Bolo
- ;; (c) Ben Kurtovic, 2011
-
- breed [tanks tank]
-
- tanks-own [
- acceleration
- friction
- is-accelerating?
- is-player?
- max-speed
- max-turn
- speed
- team
- ]
-
- to set-tank-vars [tank-team player-tank?]
- set acceleration 0.03
- set friction 0.0075
- set is-accelerating? false
- set is-player? player-tank?
- set max-speed 0.25
- set max-turn 24
- set speed 0
- set team tank-team
-
- set color get-tank-color
- set heading 0
- set shape "tank"
- set size 1.5
- end
-
- to do-tank-logic
- if is-accelerating? [
- accelerate acceleration
- ]
- fd speed
- decelerate friction
- end
-
- to accelerate [amount]
- set speed speed + amount
- if speed > max-speed [
- set speed max-speed
- ]
- end
-
- to decelerate [amount]
- set speed speed - amount
- if speed < 0 [
- set speed 0
- ]
- end
-
- to-report get-tank-color
- if is-player? [ report black ]
- if team = 0 [ report green ]
- report red
- end
|