7.5
Adventure
1 Functions
(custom-sky | [ | #:night-sky-color color | | | | | | | #:length-of-day day-length | | | | | | | #:start-of-daytime day-start | | | | | | | #:end-of-daytime day-end | | | | | | | #:max-darkness max-darkness]) | | → | | sky? |
|
color : (or/c string? symbol?) = 'black |
day-length : number? = 2400 |
day-start : number? = #f |
day-end : number? = #f |
max-darkness : number? = 160 |
Creates a custom sky that can be used in the #:sky parameter
of adventure-game.
(custom-avatar | [ | #:sprite sprite | | | | | | | #:damage-processor damage-processor | | | | | | | #:position position | | | | | | | #:speed speed | | | | | | | #:key-mode key-mode | | | | | | | #:mouse-aim? mouse-aim | | | | | | | #:health health | | | | | | | #:max-health max-health | | | | | | | #:components first-component] | | | | | | | more-components ...) | | → | | entity? |
|
sprite : sprite? = (random-character-sprite) |
| damage-processor | | : | | damage-processor? | | | | = | | (filter-damage-by-tag #:filter-out '(friendly-team passive) | #:show-damage? #t | #:hit-sound HIT-SOUND) |
|
|
position : posn? = (posn 100 100) |
speed : number? = 10 |
key-mode : (or/c 'wasd 'arrow-keys) = 'arrow-keys |
mouse-aim : boolean? = #f |
health : number? = 100 |
max-health : number? = 100 |
first-component : component-or-system? = #f |
more-components : (listof component-or-system?) |
Returns a custom avatar, which will be placed in to the world
automatically if it is passed into adventure-game
via the #:avatar parameter.
(custom-weapon | [ | #:name name | | | | | | | #:sprite sprite | | | | | | | #:dart-sprite dart-sprite | | | | | | | #:speed speed | | | | | | | #:damage damage | | | | | | | #:range range | | | | | | | #: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 | | | | | | | #:on-store store-func | | | | | | | #:on-drop drop-func]) | | → | | entity? |
|
name : string? = "Repeater" |
sprite : (or/c sprite? (listof sprite?)) = chest-sprite |
| dart-sprite | | : | | (or/c sprite? (listof sprite?)) | | | | = | | (rectangle 10 2 "solid" "green") |
|
speed : number? = 10 |
damage : number? = 10 |
range : number? = 1000 |
| dart | | : | | entity? | | = | | (custom-dart #:sprite ds | #:speed spd | #:damage dmg | #:range rng) |
|
|
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?) = #f |
ptm? : boolean? = #f |
rf? : boolean? = #t |
rarity : rarity-level? = 'common |
store-func : procedure? = (do-nothing) |
drop-func : procedure? = (do-nothing) |
Returns a custom weapon, which will be placed in to the world
automatically if it is passed into adventure-game
via the #:weapon-list parameter.
(custom-enemy | [ | #:amount-in-world amount-in-world | | | | | | | #:position pos | | | | | | | #:tile tile | | | | | | | #:sprite sprite | | | | | | | #:ai ai | | | | | | | #:health health | | | | | | | #:weapon weapon | | | | | | | #:death-particles death-particles | | | | | | | #:night-only? night-only? | | | | | | | #:on-death death-function | | | | | | | #:loot-list loot-list | | | | | | | #:components first-component] | | | | | | | more-components ...) | | → | | entity? |
|
amount-in-world : positive? = 1 |
pos : (or/c posn? #f) = #f |
tile : (or/c number? #f) = #f |
| sprite | | : | | (or/c sprite? (listof sprite?)) | | | | = | | (first (shuffle (list slime-sprite bat-sprite snake-sprite))) |
|
ai : ai-level? = 'medium |
health : positive? = 100 |
| weapon | | : | | entity? | | = | | (custom-weapon #:name "Spitter" | #:dart (acid-dart)) |
|
|
death-particles : entity? = (custom-particles) |
night-only? : boolean? = #f |
death-function : procedure? = (do-nothing) |
loot-list : (listof (or/c entity? procedure?)) = '() |
first-component : component-or-system? = #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 adventure-game
via the #:enemy-list parameter.
(adventure-game | [ | #:headless headless | | | | | | | #:bg bg | | | | | | | #:avatar avatar | | | | | | | #:sky sky | | | | | | | #:intro-cutscene intro-cutscene | | | | | | | #:death-cutscene death-cutscene | | | | | | | #:npc-list npc-list | | | | | | | #:enemy-list enemy-list | | | | | | | #:coin-list coin-list | | | | | | | #:food-list food-list | | | | | | | #:crafter-list crafter-list | | | | | | | #:score-prefix prefix | | | | | | | #:enable-world-objects? world-objects? | | | | | | | #:weapon-list weapon-list | | | | | | | #:instructions instructions | | | | | | | #:other-entities other-entities] | | | | | | | rest ...) | | → | | game? |
|
headless : boolean? = #f |
bg : entity? = (plain-forest-bg) |
| avatar | | : | | (or/c entity? #f) | | | | = | | (custom-avatar #:sprite basic-sprite) |
|
sky : (or/c sky? #f) = (custom-sky) |
intro-cutscene : (or/c entity? #f) = #f |
death-cutscene : (or/c entity? #f) = #f |
npc-list : (listof (or/c entity? procedure?)) = '() |
enemy-list : (listof (or/c entity? procedure?)) = '() |
coin-list : (listof (or/c entity? procedure?)) = '() |
food-list : (listof (or/c entity? procedure?)) = '() |
crafter-list : (listof (or/c entity? procedure?)) = '() |
prefix : string? = "Gold" |
world-objects? : boolean? = #f |
weapon-list : (listof (or/c entity? procedure?)) = '() |
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 adventure-game language.
Can be run with no parameters to get a basic, default game.
(custom-crafter | [ | #:position position | | | | | | | #:tile tile | | | | | | | #:name name | | | | | | | #:sprite sprite | | | | | | | #:open-key open-key | | | | | | | #:open-sound open-sound | | | | | | | #:select-sound select-sound | | | | | | | #:recipe-list recipe-list | | | | | | | #:components first-component] | | | | | | | more-components ...) | | → | | entity? |
|
position : posn? = (posn 0 0) |
tile : number? = 0 |
name : string? = "Crafter" |
sprite : (or/c sprite? (listof sprite?)) = cauldron-sprite |
open-key : (or/c string? symbol?) = 'space |
| open-sound | | : | | (or/c rsound? procedure? '() #f) | | | | = | | OPEN-DIALOG-SOUND |
|
select-sound : (or/c rsound? procedure? '() #f) = BLIP-SOUND |
| recipe-list | | : | | (listof recipe?) | | | | = | | (list (recipe #:product (carrot-stew) | #:build-time 30)) |
|
|
first-component : component-or-system? = #f |
more-components : (listof component-or-system?) |
Returns a custom crafter, which will be placed in to the world
automatically if it is passed into adventure-game
via the #:crafter-list parameter.
(custom-npc | [ | #:sprite sprite | | | | | | | #:position position | | | | | | | #:name name | | | | | | | #:amount-in-world world-amt | | | | | | | #:tile tile | | | | | | | #:dialog dialog | | | | | | | #:mode mode | | | | | | | #:game-width game-width | | | | | | | #:speed speed | | | | | | | #:target target | | | | | | | #:sound sound | | | | | | | #:scale scale | | | | | | | #:quest-list quests | | | | | | | #:components first-component] | | | | | | | more-components ...) | | → | | entity? |
|
| sprite | | : | | (or/c sprite? (listof sprite?)) | | | | = | | (random-character-sprite) |
|
position : posn? = (posn 0 0) |
| name | | : | | string? | | | | = | | (first (shuffle (list "Adrian" "Alex" "Riley" | "Sydney" "Charlie" "Andy"))) |
|
|
world-amt : number? = 1 |
tile : number? = 0 |
dialog : dialog-str? = #f |
mode : (or/c 'still 'wander 'pace 'follow) = 'wander |
game-width : number? = 480 |
speed : number? = 2 |
target : string? = "player" |
sound : any/c = #t |
scale : number? = 1 |
quests : (listof component-or-system?) = '() |
first-component : component-or-system? = #f |
more-components : (listof component-or-system?) |
Returns a custom npc, which will be placed in to the world
automatically if it is passed into adventure-game
via the #:npc-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? = FOREST-BG |
rows : number? = 3 |
columns : number? = 3 |
start-tile : number? = 0 |
high-def? : boolean? = #f |
first-component : component-or-system? = #f |
more-components : (listof component-or-system?) |
Returns a custom background, which will be used
automatically if it is passed into adventure-game
via the #:bg parameter.
(custom-food | [ | #:name name | | | | | | | #:sprite sprite | | | | | | | #:tile tile | | | | | | | #:position position | | | | | | | #:amount-in-world amount-in-world | | | | | | | #:storable? storable? | | | | | | | #:consumable? consumable? | | | | | | | #:value value | | | | | | | #:heals-by heals-by | | | | | | | #:respawn? respawn? | | | | | | | #:on-pickup pickup-func | | | | | | | #:on-store store-func | | | | | | | #:on-drop drop-func | | | | | | | #:components first-component] | | | | | | | more-components ...) | | → | | entity? |
|
name : string? = "Carrot" |
sprite : (or/c sprite? (listof sprite?)) = carrot-sprite |
tile : number? = 0 |
position : posn? = (posn 0 0) |
amount-in-world : number? = 1 |
storable? : boolean? = #t |
consumable? : boolean? = #t |
value : (or/c number? #f) = #f |
heals-by : (or/c number? #f) = 10 |
respawn? : boolean? = #t |
pickup-func : procedure? = (do-nothing) |
store-func : procedure? = (do-nothing) |
drop-func : procedure? = (do-nothing) |
first-component : component-or-system? = #f |
more-components : (listof component-or-system?) |
Returns a custom food, which will be placed into the world
automatically if it is passed into adventure-game
via the #:food-list parameter.
(custom-product | [ | #:name name | | | | | | | #:sprite sprite | | | | | | | #:tile tile | | | | | | | #:position position | | | | | | | #:amount-in-world amount-in-world | | | | | | | #:storable? storable? | | | | | | | #:consumable? consumable? | | | | | | | #:value value | | | | | | | #:heals-by heals-by | | | | | | | #:respawn? respawn? | | | | | | | #:on-pickup pickup-func | | | | | | | #:on-store store-func | | | | | | | #:on-drop drop-func | | | | | | | #:components first-component] | | | | | | | more-components ...) | | → | | entity? |
|
name : string? = "Carrot Stew" |
sprite : (or/c sprite? (listof sprite?)) = carrotstew-sprite |
tile : number? = 0 |
position : posn? = (posn 0 0) |
amount-in-world : number? = 1 |
storable? : boolean? = #t |
consumable? : boolean? = #t |
value : (or/c number? #f) = #f |
heals-by : (or/c number? #f) = 10 |
respawn? : boolean? = #f |
pickup-func : procedure? = (do-nothing) |
store-func : procedure? = (do-nothing) |
drop-func : procedure? = (do-nothing) |
first-component : component-or-system? = #f |
more-components : (listof component-or-system?) |
Returns a custom product, which can be used to create a
recipe product if it is passed into recipe
via the #:product parameter.
(custom-coin | [ | #:entity entity | | | | | | | #:sprite sprite | | | | | | | #:position position | | | | | | | #:name name | | | | | | | #:tile tile | | | | | | | #:amount-in-world amount-in-world | | | | | | | #:value value | | | | | | | #:respawn? respawn | | | | | | | #:on-pickup pickup-function | | | | | | | #:cutscene cutscene | | | | | | | #:components first-component] | | | | | | | more-components ...) | | → | | entity? |
|
entity : entity? = (copper-coin) |
sprite : (or/c sprite? (listof sprite?) #f) = #f |
position : (or/c posn? #f) = #f |
name : (or/c string? #f) = #f |
tile : (or/c number? #f) = #f |
amount-in-world : number? = 10 |
value : number? = 10 |
respawn : boolean? = #t |
pickup-function : procedure? = (λ (g e) e) |
cutscene : (or/c entity? #f) = #f |
first-component : component-or-system? = #f |
more-components : (listof component-or-system?) |
Returns a custom coin, which will be placed into the world
automatically if it is passed into adventure-game
via the #:coin-list parameter.
(custom-item | [ | #:name name | | | | | | | #:sprite sprite | | | | | | | #:tile tile | | | | | | | #:position position | | | | | | | #:amount-in-world amount-in-world | | | | | | | #:storable? storable? | | | | | | | #:consumable? consumable? | | | | | | | #:value value | | | | | | | #:heals-by heals-by | | | | | | | #:respawn? respawn? | | | | | | | #:on-pickup pickup-func | | | | | | | #:on-store store-func | | | | | | | #:on-drop drop-func | | | | | | | #:components first-component] | | | | | | | more-components ...) | | → | | entity? |
|
name : string? = "Chest" |
sprite : (or/c sprite? (listof sprite?)) = chest-sprite |
tile : (or/c number? #f) = #f |
position : (or/c posn? #f) = #f |
amount-in-world : number? = 1 |
storable? : boolean? = #t |
consumable? : boolean? = #f |
value : (or/c number? #f) = 10 |
heals-by : (or/c number? #f) = #f |
respawn? : boolean? = #t |
pickup-func : procedure? = (do-nothing) |
store-func : procedure? = (do-nothing) |
drop-func : procedure? = (do-nothing) |
first-component : component-or-system? = #f |
more-components : (listof component-or-system?) |
Returns a custom item, which has a unique item id and can be
used in npc quests.
2 Adventure Game Assets
2.1 Avatars, Enemies and NPCs
(random-character-sprite) → animated-sprite?
|
witch-sprite : animated-sprite?
|
darkelf-sprite : animated-sprite?
|
wizard-sprite : animated-sprite?
|
pirate-sprite : animated-sprite?
|
monk-sprite : animated-sprite?
|
madscientist-sprite : animated-sprite?
|
lightelf-sprite : animated-sprite?
|
bat-sprite : animated-sprite?
|
cat-sprite : animated-sprite?
|
blackcat-sprite : animated-sprite?
|
whitecat-sprite : animated-sprite?
|
snake-sprite : animated-sprite?
|
slime-sprite : animated-sprite?
|
2.2 Food, Coin, and Crafting Items
apples-sprite : animated-sprite?
|
carrot-sprite : animated-sprite?
|
carrotstew-sprite : animated-sprite?
|
toastedmarshmallow-sprite : animated-sprite?
|
smores-sprite : animated-sprite?
|
fish-sprite : animated-sprite?
|
cookedfish-sprite : animated-sprite?
|
fishstew-sprite : animated-sprite?
|
cherry-sprite : animated-sprite?
|
steak-sprite : animated-sprite?
|
coppercoin-sprite : animated-sprite?
|
silvercoin-sprite : animated-sprite?
|
goldcoin-sprite : animated-sprite?
|
cauldron-sprite : animated-sprite?
|
campfire-sprite : animated-sprite?
|
woodtable-sprite : animated-sprite?
|
chest-sprite : animated-sprite?
|
bowl-sprite : animated-sprite?
|
2.3 Backgrounds
2.4 World Objects
candy-cane-tree : entity?
|
random-brown-rock : entity?
|
large-brown-rock : entity?
|
medium-brown-rock : entity?
|
small-brown-rock : entity?
|
random-gray-rock : entity?
|
large-gray-rock : entity?
|
medium-gray-rock : entity?
|
small-gray-rock : entity?
|