Battle Arena
1 Functions
custom-enemy
custom-armor
custom-weapon
custom-item
custom-bg
custom-avatar
battlearena-game
2 Battle Arena Assets
2.1 Avatars and Enemies
random-character-sprite
witch-sprite
caitsith-sprite
darkelf-sprite
wizard-sprite
monk-sprite
madscientist-sprite
lightelf-sprite
caitsith-sprite
darkknight-sprite
kavi-sprite
moderngirl-sprite
moogle-sprite
pirateboy-sprite
pirategirl-sprite
steampunkboy-sprite
steampunkgirl-sprite
2.2 Backgrounds
FOREST-BG
SNOW-BG
DESERT-BG
LAVA-BG
PINK-BG
7.5

Battle Arena

thoughtstem

 #lang battlearena package: battlearena

    1 Functions

    2 Battle Arena Assets

      2.1 Avatars and Enemies

      2.2 Backgrounds

1 Functions

procedure

(custom-enemy [#:amount-in-world amount-in-world    
  #:sprite sprite    
  #:ai ai    
  #:health health    
  #:shield shield    
  #:weapon weapon    
  #:death-particles death-particles    
  #:components first-component]    
  more-components ...)  entity?
  amount-in-world : positive? = 1
  sprite : (or/c sprite? (listof sprite?))
   = (row->sprite (random-character-row) #:delay 4)
  ai : ai-level? = 'easy
  health : positive? = 100
  shield : positive? = 100
  weapon : entity? = (custom-weapon)
  death-particles : entity? = (custom-particles)
  first-component : (or/c component-or-system? false? (listof false?))
   = #f
  more-components : (listof component-or-system?)
Returns a custom enemy, which will be placed in to the world automatically if it is passed into battlearena-game via the #:enemy-list parameter.

procedure

(custom-armor [#:name name    
  #:icon sprite    
  #:protects-from protects-from    
  #:change-damage change-damage    
  #:rarity rarity])  entity?
  name : string? = "Armor"
  sprite : (or/c sprite? (listof sprite?)) = chest-sprite
  protects-from : string? = "Bullet"
  change-damage : procedure? = identity
  rarity : rarity-level? = 'common
Returns a custom armor, which will be placed in to the world automatically if it is passed into battlearena-game via the #:item-list parameter.

procedure

(custom-weapon [#:name name    
  #:sprite sprite    
  #:color c    
  #:dart-sprite dart-sprite    
  #:speed speed    
  #:damage damage    
  #:range range    
  #:durability dur    
  #:dart dart    
  #:fire-mode fire-mode    
  #:fire-rate fire-rate    
  #:fire-key fire-key    
  #:fire-sound fire-sound    
  #:mouse-fire-button button    
  #:point-to-mouse? ptm?    
  #:rapid-fire? rf?    
  #:rarity rarity])  entity?
  name : string? = "Repeater"
  sprite : (or/c sprite? (listof sprite?)) = chest-sprite
  c : image-color? = 'green
  dart-sprite : (or/c sprite? (listof sprite?))
   = (rectangle 10 2 "solid" c)
  speed : number? = 10
  damage : number? = 10
  range : number? = 1000
  dur : number? = 10
  dart : entity? = 
(custom-dart #:sprite s
             #:speed spd
             #:damage dmg
             #:range rng
             #:durability dur)
  fire-mode : fire-mode? = 'normal
  fire-rate : number? = 3
  fire-key : symbol? = 'f
  fire-sound : (or/c rsound? procedure? #f '()) = LASER-SOUND
  button : (or/c 'left 'right false?) = 'left
  ptm? : boolean? = #t
  rf? : boolean? = #t
  rarity : rarity-level? = 'common
Returns a custom weapon, which will be placed in to the world automatically if it is passed into battlearena-game via the #:weapon-list parameter.

procedure

(custom-item [#:name name    
  #:icon sprite    
  #:on-use on-use    
  #:rarity rarity    
  #:respawn? respawn    
  #:components first-component]    
  more-components ...)  entity?
  name : string? = "Item"
  sprite : (or/c sprite? (listof sprite?)) = chest-sprite
  on-use : any/c = #f
  rarity : rarity-level? = 'common
  respawn : boolean? = #t
  first-component : component-or-system? = #f
  more-components : (listof component-or-system?)
Returns a custom item, which will be placed in to the world automatically if it is passed into battlearena-game via the #:item-list parameter.

procedure

(custom-bg [#:image bg-img    
  #:rows rows    
  #:columns columns    
  #:start-tile start-tile    
  #:hd? high-def?    
  #:components first-component]    
  more-components ...)  entity?
  bg-img : image? = (draw-plain-bg)
  rows : number? = 3
  columns : number? = 3
  start-tile : number? = 0
  high-def? : boolean? = #f
  first-component : (or/c component-or-system? (listof false?))
   = #f
  more-components : (listof component-or-system?)
Returns a custom background, which will be used automatically if it is passed into battlearena-game via the #:bg parameter.

procedure

(custom-avatar [#:sprite sprite    
  #:damage-processor damage-processor    
  #:position position    
  #:speed speed    
  #:key-mode key-mode    
  #:mouse-aim? mouse-aim    
  #:item-slots item-slots    
  #:health health    
  #:max-health max-health    
  #:shield shield    
  #:max-shield max-shield    
  #:components first-component]    
  rest ...)  entity?
  sprite : (or/c sprite? (listof sprite?))
   = (random-character-sprite)
  damage-processor : damage-processor?
   = 
(divert-damage #:filter-out '(friendly-team passive)
               #:hit-sound HIT-SOUND)
  position : posn? = (posn 100 100)
  speed : number? = 10
  key-mode : (or/c 'wasd 'arrow-keys) = 'wasd
  mouse-aim : boolean? = #t
  item-slots : number? = 2
  health : number? = 100
  max-health : number? = 100
  shield : number? = 100
  max-shield : number? = 100
  first-component : (or/c component-or-system? false? (listof false?))
   = #f
  rest : (listof component-or-system?)
Returns a custom avatar, which will be placed in to the world automatically if it is passed into battlearena-game via the #:avatar parameter.

procedure

(battlearena-game [#:headless headless 
  #:bg bg 
  #:avatar avatar 
  #:enemy-list enemy-list 
  #:weapon-list weapon-list 
  #:item-list item-list 
  #:score-prefix prefix 
  #:enable-world-objects? world-objects? 
  #:instructions instructions 
  #:other-entities other-entities] 
  rest ...) 
  game?
  headless : boolean? = #f
  bg : entity? = (custom-bg)
  avatar : (or/c entity? false?)
   = (custom-avatar #:sprite (circle 10 'solid 'red))
  enemy-list : (listof (or/c false? entity? procedure?)) = '()
  weapon-list : (listof (or/c entity? procedure?)) = '()
  item-list : (listof (or/c entity? procedure?)) = '()
  prefix : string? = "Enemies"
  world-objects? : boolean? = #f
  instructions : (or/c #f entity?) = #f
  other-entities : (or/c #f entity? (listof #f) (listof entity?))
   = #f
  rest : (listof (or/c #f entity? (listof #f) (listof entity?)))
The top-level function for the battlearena language. Can be run with no parameters to get a basic, default game.

2 Battle Arena Assets

2.1 Avatars and Enemies

procedure

(random-character-sprite)  animated-sprite?

image

value

witch-sprite : animated-sprite?

image

value

caitsith-sprite : animated-sprite?

image

value

darkelf-sprite : animated-sprite?

image

value

wizard-sprite : animated-sprite?

image

value

monk-sprite : animated-sprite?

image

value

madscientist-sprite : animated-sprite?

image

value

lightelf-sprite : animated-sprite?

image

value

caitsith-sprite : animated-sprite?

image

value

darkknight-sprite : animated-sprite?

image

value

kavi-sprite : animated-sprite?

image

value

moderngirl-sprite : animated-sprite?

image

value

moogle-sprite : animated-sprite?

image

value

pirateboy-sprite : animated-sprite?

image

value

pirategirl-sprite : animated-sprite?

image

value

steampunkboy-sprite : animated-sprite?

image

value

steampunkgirl-sprite : animated-sprite?

image

2.2 Backgrounds

value

FOREST-BG : image?

image

value

SNOW-BG : image?

image

value

DESERT-BG : image?

image

value

LAVA-BG : image?

image

value

PINK-BG : image?

image