7.5
Battle Arena
1 Functions
| (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.
| (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.
| (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.
| (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.
| (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.
| (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.
| (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
(random-character-sprite) → animated-sprite?
|
witch-sprite : animated-sprite?
|
caitsith-sprite : animated-sprite?
|
darkelf-sprite : animated-sprite?
|
wizard-sprite : animated-sprite?
|
monk-sprite : animated-sprite?
|
madscientist-sprite : animated-sprite?
|
lightelf-sprite : animated-sprite?
|
caitsith-sprite : animated-sprite?
|
darkknight-sprite : animated-sprite?
|
kavi-sprite : animated-sprite?
|
moderngirl-sprite : animated-sprite?
|
moogle-sprite : animated-sprite?
|
pirateboy-sprite : animated-sprite?
|
pirategirl-sprite : animated-sprite?
|
steampunkboy-sprite : animated-sprite?
|
steampunkgirl-sprite : animated-sprite?
|
2.2 Backgrounds