Logo Bolo: a re-envisioning of the classic tank game by Stuart Cheshire in NetLogo
Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
|
- ;; 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
|