Skip to content

Instantly share code, notes, and snippets.

@oconn
Created July 17, 2016 16:34
Show Gist options
  • Select an option

  • Save oconn/e286363609445ca01ed17aaae5655f7e to your computer and use it in GitHub Desktop.

Select an option

Save oconn/e286363609445ca01ed17aaae5655f7e to your computer and use it in GitHub Desktop.
(ns battlebots.constants.arena)
(def arena-key {:open {:type "open"
:display " "
:transparent true}
:ai {:type "ai"
:display "@"
:transparent true
:energy 20}
:block {:type "block"
:display "X"
:transparent false
:energy 20}
:food {:type "food"
:display "+"
:transparent true}
:poison {:type "poison"
:display "-"
:transparent true}
:fog {:type "fog"
:display "?"
:transparent false}
:steel {:type "steel"
:display "&"
:transparent false}})
(def move-settings {:can-occupy #{:open
:food
:poison}
:effects {:open {}
:food {:energy #(+ % 10)}
:poision {:energy #(- % 5)}}})
(def shot-settings {:can-occupy #{:open
:ai
:block
:food
:poison
:fog
:shoot}
:hit-reward {:ai (fn [damage]
#(+ % (* 2 damage)))
:player (fn [damage]
#(+ % (* 2 damage)))
:block (fn [damage]
#(+ % damage))}
:destructible #{:ai
:block}
:distance 10})
;; Example Arena Configurations
;; food-freq, block-freq, and poison-freq represent percentages and will scale
;; with the arena dimensions
(def small-arena {:dimx 20
:dimy 20
:border {:tunnel false}
:ai-freq 3
:food-freq 10
:block-freq 10
:poison-freq 4})
(def large-arena {:dimx 50
:dimy 50
:border {:tunnel false}
:ai-freq 3
:food-freq 10
:block-freq 10
:poison-freq 3})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment