Logo Bolo: a re-envisioning of the classic tank game by Stuart Cheshire in NetLogo
Du kan inte välja fler än 25 ämnen
Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
|
- ;; lobo: Logo Bolo
- ;; (c) Ben Kurtovic, 2011
-
- breed [bullets bullet]
-
- bullets-own [
- max-travel-distance
- shooter
- speed
- travel-distance
- ]
-
- to do-bullet-logic
- fd speed
- set travel-distance travel-distance + speed
- if travel-distance > max-travel-distance [
- die
- ]
-
- let mxcor xcor
- let mycor ycor
- let is-close-enough false
- let target min-one-of (turtles-here with [breed = tanks]) [distancexy mxcor mycor]
- if target != nobody [
- ask target [
- if distancexy mxcor mycor < 0.65 [
- set is-close-enough true
- shot-at myself
- ]
- ]
- ]
- if is-close-enough [
- die
- ]
- end
|