Package Source: battlearena
Need a reminder how to install a package? Check out this video tutorial.
Code a basic Battle Arena game.
(battlearena-game)
Code a game with an avatar.
(battlearena-game
#:avatar (basic-avatar))
Code a game with an avatar that has a custom sprite.
(battlearena-game
#:avatar (basic-avatar
#:sprite pirateboy-sprite))
Code a game with a fast-moving sprite.
(define (my-avatar)
(basic-avatar #:sprite pirategirl-sprite
#:speed 20))
(battlearena-game
#:avatar (my-avatar))
Code a game with a fast-moving sprite, a large backpack, and double the health and shield values.
(define (my-avatar)
(basic-avatar #:sprite pirateboy-sprite
#:speed 20
#:item-slots 5
#:health 200
#:shield 200
#:max-health 200
#:max-shield 200))
(battlearena-game
#:avatar (my-avatar))
Code a game with that has a custom background.
(battlearena-game
#:bg (basic-bg))
Code a game with that has a lava background.
(battlearena-game
#:bg (basic-bg
#:image LAVA-BG))
Code a game with that has a lava background and a 2 by 2 grid.
(define (my-bg)
(basic-bg #:image LAVA-BG
#:rows 2
#:columns 2))
(battlearena-game
#:bg (my-bg))
Code a game with that has a high definition lava background, 2 by 2 grid, and starts on tile 3.
(define (my-bg)
(basic-bg #:image LAVA-BG
#:rows 2
#:columns 2
#:start-tile 3
#:hd? #t))
(battlearena-game #:bg (my-bg))
Code a game with a "Damage Boost" item that temporarily increases the damage of your weapon. Customize the icon.
(battlearena-game
#:weapon-list (list (repeater))
#:item-list (list
(basic-item
#:name "Damage Boost"
#:icon (make-icon "DB" 'orangered)
#:on-use (change-damage-by
1000
#:for 200))))
Code a game with a temporary "Speed Boost" item with a custom icon.
(battlearena-game
#:item-list (list
(basic-item
#:name "Speed Boost"
#:icon (make-icon "SB" 'yellow)
#:on-use (multiply-speed-by
2
#:for 200))))
Code a game with that has both a Damage and a Speed Boost defined items.
(define (damage-boost)
(basic-item #:name "Damage Boost"
#:icon (make-icon "DB" 'orangered)
#:on-use (change-damage-by 1000 #:for 200)
#:rarity 'epic))
(define (speed-boost)
(basic-item #:name "Speed Boost"
#:icon (make-icon "SB" 'yellow)
#:on-use (multiply-speed-by 2 #:for 200)
#:rarity 'uncommon))
(battlearena-game
#:item-list (list (damage-boost)
(speed-boost)))
Code a game with that has a custom weapon that deploys a dagger tower.
(battlearena-game
#:weapon-list (list (dagger-tower)))
Code a game with that has a custom weapon that deploys a fast, spread shooting dagger tower.
(battlearena-game
#:weapon-list (list (dagger-tower
#:speed 10
#:fire-mode 'spread)))
Code a game with that has a custom weapon that deploys a fast, spread shooting dagger tower with a custom dagger.
(battlearena-game
#:weapon-list (list (dagger-tower
#:fire-sound LASER-SOUND
#:damage 200
#:speed 10
#:fire-mode 'spread)))
Code a game with an enemy.
(battlearena-game
#:enemy-list (list
(basic-enemy)))
Code a game with 10 random enemies
(battlearena-game
#:enemy-list (list
(curry basic-enemy
#:amount-in-world 10)))
Code a game with several enemies that have moderate intelligence.
(define (my-enemy)
(basic-enemy #:sprite darkknight-sprite
#:ai 'medium
#:amount-in-world 5))
(battlearena-game
#:enemy-list (list
(my-enemy)))
Code a game with 8 enemies: 5 weak with low intelligence, and 3 strong with moderate intelligence. Choose your own sprites.
(define (easy-enemy)
(basic-enemy #:ai 'easy
#:sprite wizard-sprite
#:health 50
#:amount-in-world 5))
(define (medium-enemy)
(basic-enemy #:ai 'medium
#:sprite darkknight-sprite
#:health 200
#:amount-in-world 3))
(battlearena-game
#:enemy-list (list
(easy-enemy)
(medium-enemy)))
Code a game with 5 high intelligence enemies that have a weapon that does 50 damage.
(define (hard-enemy)
(basic-enemy #:ai 'hard
#:sprite pirategirl-sprite
#:amount-in-world 5
#:weapon (repeater
#:damage 50)))
(battlearena-game
#:avatar (basic-avatar)
#:enemy-list (list (hard-enemy)))
Code a game with an enemy that uses a sword.
(battlearena-game
#:enemy-list (list (basic-enemy
#:weapon (sword))))
Code a game with that has an enemy, give it a custom weapon and customize it.
(define (my-weapon)
(sword #:damage 40))
(battlearena-game
#:enemy-list (list (basic-enemy
#:weapon (my-weapon))))
Code a game with an enemy that uses a weak and slow repeater that shoots short-ranged darts.
(define (my-weapon)
(repeater
#:name "Light Repeater"
#:damage 5
#:speed 1
#:range 200))
(battlearena-game
#:enemy-list (list (basic-enemy
#:weapon (my-weapon))))
Code a game with that has fire magic in it.
(battlearena-game
#:weapon-list (list (fire-magic)))
Code a game with fire magic that does 20 damage.
(define (my-weapon)
(fire-magic
#:name "Heavy Fire Magic"
#:damage 20))
(battlearena-game
#:weapon-list (list
(my-weapon)))
Code a game with a powerful, fast fire magic that has a high rarity.
(define (my-weapon)
(fire-magic #:damage 20
#:speed 10
#:rarity 'epic))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with a legendary fire magic with a customized sprite, damage, speed, and range.
(define (my-weapon)
(fire-magic
#:name "Fire Magic"
#:icon (make-icon "FM" 'red)
#:color 'green
#:damage 20
#:speed 10
#:range 50
#:rarity 'legendary))
(battlearena-game
#:weapon-list (list
(my-weapon)))
Code a game with a "Force Field" item.
(battlearena-game
#:item-list (list (basic-item #:name "Force Field"
#:on-use (spawn (force-field)))))
Code a game with a "Force Field" item that lasts for a long time. Customize the icon.
(battlearena-game
#:item-list (list (basic-item #:name "Force Field"
#:icon (make-icon "FF")
#:on-use (spawn (force-field #:duration 1000)))))
Code a game with a "Force Field" item that has a custom icon. Customize the duration and allow the player to shoot out of it.
(define (force-field-item)
(basic-item #:name "Force Field"
#:icon (make-icon "FF")
#:on-use (spawn (force-field #:allow-friendly-dart? #t
#:duration 3000))))
(battlearena-game
#:item-list (list (force-field-item)))
Code a game with a "Health Power-up" item that increases your health. Customize the icon and make it respawnable.
(battlearena-game
#:item-list (list
(basic-item
#:name "Health Power-up"
#:icon (make-icon "HP" 'green 'white)
#:on-use (change-health-by 50)
#:respawn? #t)))
Code a game with a "Max Health Power-up" item that sets your health to 100. Customize the icon and the rarity.
(battlearena-game
#:item-list (list (basic-item #:name "Max Health Power-up"
#:icon (make-icon "MHP" 'green 'white)
#:on-use (set-health-to 100)
#:rarity 'epic)))
Code a game with 2 health items: the first one should increase your health, the second one should fully restore your health. Make custom icons for both.
(define (health-powerup)
(basic-item #:name "Health Power-up"
#:icon (make-icon "HP")
#:on-use (change-health-by 50)))
(define (max-health-powerup)
(basic-item #:name "Max Health Power-up"
#:icon (make-icon "MHP")
#:on-use (set-health-to 100)))
(battlearena-game
#:item-list (list (health-powerup)
(max-health-powerup)))
Code a basic Battle Arena game.
(battlearena-game)
Code a game with a weapon that fires homing darts.
(battlearena-game
#:weapon-list (list (repeater #:name "Homing Repeater"
#:icon (make-icon "HR")
#:fire-mode 'homing)))
Code a game with a powerful, slow repeater that shoots homing darts. Customize the name and the icon.
(battlearena-game
#:weapon-list (list (repeater #:name "Homing Repeater"
#:icon (make-icon "HR")
#:fire-mode 'homing
#:damage 50
#:speed 5)))
Code a game with a rare weapon that fires homing darts with customized sprite, damage, speed, and range.
(define (homing-repeater)
(repeater #:name "Homing Repeater"
#:icon (make-icon "HR")
#:fire-mode 'homing
#:rarity 'rare
#:sprite (rectangle 10 2 'solid 'pink)
#:damage 50
#:speed 8
#:range 40))
(battlearena-game
#:weapon-list (list (homing-repeater)))
Code a game with that has ice magic in it.
(battlearena-game
#:weapon-list (list (ice-magic)))
Code a game with that has ice magic with 20 damage.
(define (my-weapon)
(ice-magic #:name "Heavy Ice Magic"
#:damage 20))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with that has an 'epic ice magic with 20 damage and 10 speed.
(define (my-weapon)
(ice-magic #:name "Ice Magic"
#:sprite (make-icon "FM" 'red)
#:damage 20
#:speed 10
#:rarity 'epic))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with that has a 'legendary ice magic with a customized sprite, damage, speed, and range.
(define (my-weapon)
(ice-magic #:name "Ice Magic"
#:icon (make-icon "FM" 'red)
#:color 'green
#:damage 20
#:speed 10
#:range 50
#:rarity 'legendary))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with that has a custom weapon that deploys a lava pit.
(battlearena-game
#:weapon-list (list (lava-pit)))
Code a game with that has a custom weapon that deploys a lava pit with custom damage and size.
(battlearena-game
#:weapon-list (list (lava-pit
#:damage 25
#:size 2)))
Code a game with that has a custom weapon that deploys a lava pit with custom damage, size, sprite, and range.
(define (my-lava-pit)
(lava-pit #:damage 25
#:size 2
#:sprite (circle 10 'solid 'black)
#:icon (make-icon "LAVA" 'red 'white)))
(battlearena-game
#:weapon-list (list (my-lava-pit)))
Code a game with a forest background that has world objects.
(battlearena-game
#:bg (basic-bg #:image FOREST-BG)
#:enable-world-objects? #t)
Code a game with a forest background filled with high definition trees.
(battlearena-game
#:bg (basic-bg #:image FOREST-BG)
#:other-entities (make-world-objects round-tree
pine-tree
#:hd? #t))
Code a game with a pink background that has two randomly-colored types of trees in high definition.
(battlearena-game
#:bg (basic-bg
#:image PINK-BG)
#:other-entities (make-world-objects
candy-cane-tree
snow-pine-tree
#:hd? #t
#:random-color? #t))
Code a game with 3 world objects with customized position, tile, size, and/or hue.
(battlearena-game
#:other-entities
(pine-tree
(posn 100 200)
#:tile 0)
(wood-house
(posn 100 200)
#:tile 1
#:size 0.5)
(brick-house
(posn 100 200)
#:tile 2
#:hue
(random 360)))
Code a game with that has a light magic weapon.
(battlearena-game
#:weapon-list (list (ring-of-fire #:name "Light Magic"
#:icon (make-icon "LM")
#:damage 20
#:rarity 'common)))
Code a game with that has a heavy magic weapon.
(battlearena-game
#:weapon-list (list (ring-of-fire #:name "Heavy Magic"
#:icon (make-icon "HM")
#:sprite (scale 2 flame-sprite)
#:damage 200
#:rarity 'epic)))
Code a game with that has a light and a heavy magic weapon. Balance them relative to each other.
(define (heavy-magic)
(ring-of-fire #:name "Heavy Magic"
#:icon (make-icon "HM")
#:sprite (scale 2 flame-sprite)
#:damage 200
#:rarity 'epic))
(define (light-magic)
(ring-of-fire #:name "Light Magic"
#:icon (make-icon "LM")
#:damage 20
#:duration 20
#:rarity 'common))
(battlearena-game
#:weapon-list (list (heavy-magic)
(light-magic)))
Code a game with that has a 'common light melee weapon with 10 damage.
(battlearena-game
#:weapon-list (list (sword #:name "Light Sword"
#:sprite (make-icon "LS")
#:damage 10
#:rarity 'common)))
Code a game with that has an 'epic heavy melee weapon with 200 damage.
(battlearena-game
#:weapon-list (list (sword #:name "Heavy Sword"
#:icon (make-icon "HS")
#:sprite (scale 2 swinging-sword-sprite)
#:damage 200
#:rarity 'epic)))
Code a game with that has a light and a heavy melee weapon. Balance them relative to each other.
(define (heavy-sword)
(sword #:name "Heavy Sword"
#:icon (make-icon "HS")
#:sprite (scale 2 swinging-sword-sprite)
#:damage 200
#:rarity 'epic))
(define (light-sword)
(sword #:name "Light Sword"
#:icon (make-icon "LS")
#:damage 10
#:rarity 'common))
(battlearena-game
#:weapon-list (list (heavy-sword)
(light-sword)))
Code a game with that has a paint thrower in it.
(battlearena-game
#:weapon-list (list (paint-thrower)))
Code a game with that has a paint thrower with 20 damage.
(define (my-weapon)
(paint-thrower #:name "Heavy Paint Thrower"
#:damage 20))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with that has an 'epic paint thrower with 20 damage and 10 speed.
(define (my-weapon)
(paint-thrower #:name "Paint Thrower"
#:sprite (make-icon "PT" 'blue)
#:damage 20
#:speed 10
#:rarity 'epic))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with that has a 'legendary paint thrower with a customized sprite, damage, speed, and range.
(define (my-weapon)
(paint-thrower #:name "Paint Thrower"
#:icon (make-icon "PT" 'blue)
#:color 'green
#:damage 20
#:speed 10
#:range 50
#:rarity 'legendary))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with that has armor called Repeater Armor.
(battlearena-game
#:item-list (list (basic-armor #:name "Repeater Armor"
#:icon (make-icon "RA"))))
Code a game with that has working Repeater Armor.
(battlearena-game
#:item-list (list (basic-armor #:name "Repeater Armor"
#:icon (make-icon "RA")
#:protects-from "Repeater"
#:change-damage (divide-by 2)
#:rarity 'rare)))
Code a game with that has 10 enemies with a repeater and armor for your avatar that will protect against that repeater!
(battlearena-game
#:enemy-list (list (basic-enemy #:amount-in-world 10
#:weapon (repeater)))
#:item-list (list (basic-armor #:name "Repeater Armor"
#:icon (make-icon "RA")
#:protects-from "Repeater"
#:change-damage (divide-by 2)
#:rarity 'rare)))
Code a game with that has a light repeater weapon.
(battlearena-game
#:weapon-list (list (repeater #:name "Light Repeater"
#:sprite paint-sprite
#:damage 20
#:speed 30
#:range 50
#:rarity 'common)))
Code a game with that has a heavy repeater weapon.
(battlearena-game
#:weapon-list (list (repeater #:name "Heavy Repeater"
#:sprite (scale 2 paint-sprite)
#:damage 500
#:speed 10
#:range 50
#:rarity 'uncommon)))
Code a game with that has a light and a heavy repeater weapon. Balance them relative to each other.
(define (heavy-weapon)
(repeater #:name "Heavy Repeater"
#:icon (make-icon "HR")
#:rarity 'rare
#:sprite (scale 2 paint-sprite)
#:damage 500
#:speed 10
#:range 50))
(define (light-weapon)
(repeater #:name "Light Repeater"
#:icon (make-icon "LR")
#:rarity 'common
#:sprite paint-sprite
#:damage 20
#:speed 30
#:range 50))
(battlearena-game
#:weapon-list (list (heavy-weapon)
(light-weapon)))
Code a game with that has a weapon that deploys a Repeater Tower.
(battlearena-game
#:weapon-list (list (repeater-tower)))
Code a game with a tower that quickly shoots fast-moving darts.
(battlearena-game
#:weapon-list (list (repeater-tower
#:speed 20
#:fire-rate 10)))
Code a game with a tower that shoots extremely powerful, fast-moving, long-ranged darts at a very slow rate.
(battlearena-game
#:weapon-list (list (repeater-tower
#:speed 15
#:damage 1000
#:range 500
#:fire-rate 0.1)))
Code a game with that has a custom weapon that deploys a Rocket Tower.
(battlearena-game
#:weapon-list (list (rocket-tower)))
Code a game with that has a custom weapon that deploys a slow shooting, homing Rocket Tower.
(battlearena-game
#:weapon-list (list (rocket-tower
#:speed 2
#:fire-mode 'homing)))
Code a game with that has a custom weapon that deploys a slow shooting, homing Rocket Tower that shoots a custom rocket.
(battlearena-game
#:weapon-list (list (rocket-tower
#:range 200
#:damage 1000
#:speed 2
#:fire-mode 'homing)))
Code a game with that has an item that increases your shield by 50.
(battlearena-game
#:item-list (list (basic-item
#:name "Shield Power-up"
#:icon (make-icon "SP" 'blue 'white)
#:on-use (change-shield-by 50))))
Code a game with a "Max Shield Power-up" item that sets your shield to 100. Customize the icon.
(battlearena-game
#:item-list (list
(basic-item
#:name "Max Shield Power-up"
#:icon (make-icon "MSP" 'blue 'white)
#:on-use (set-shield-to 100))))
Code a game with that has both a Shield and Max Shield defined items.
(define (shield-powerup)
(basic-item #:name "Shield Power-up"
#:icon (make-icon "SP" 'blue 'white)
#:on-use (change-shield-by 50)
#:rarity 'uncommon
#:respawn? #t))
(define (max-shield)
(basic-item #:name "Max Shield Power-up"
#:icon (make-icon "MSP" 'blue 'white)
#:on-use (set-shield-to 100)
#:rarity 'epic))
(battlearena-game
#:item-list (list (shield-powerup)
(max-shield)))
Code a game with a weapon that fires only once per click.
(battlearena-game
#:weapon-list (list
(repeater #:name "Single Shot"
#:icon (make-icon "SS")
#:rapid-fire? #f)))
Code a game with a powerful, fast repeater that shoots a single dart with short range. Customize the icon and the name.
(define (my-weapon)
(repeater #:name "Single Shot"
#:icon (make-icon "SS")
#:rapid-fire? #f
#:damage 20
#:speed 20
#:range 5))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with a 'rare single-shot weapon that fires a dart with customized sprite, damage, speed, and range.
(define (single-shot)
(repeater #:name "Single Shot"
#:icon (make-icon "SS")
#:sprite (rectangle 10 2 'solid 'cyan)
#:damage 40
#:speed 20
#:range 50
#:rapid-fire? #f
#:rarity 'rare))
(battlearena-game
#:weapon-list (list (single-shot)))
Code a game with a "Grow Power-up" item that makes you bigger. Customize the icon.
(battlearena-game
#:item-list (list
(basic-item
#:name "Grow Power-up"
#:icon (make-icon "BIG" 'red 'white)
#:on-use (scale-sprite
2
#:for 100))))
Code a game with an item that makes you shrink, name it and customize the icon.
(battlearena-game
#:item-list (list (basic-item #:name "Shrink Power-up"
#:icon (make-icon "SML" 'blue 'white)
#:on-use (scale-sprite 0.5 #:for 100))))
Code a game with both grow powerups and shrink powerups.
(define (grow-powerup)
(basic-item #:name "Grow Power-up"
#:icon (make-icon "BIG" 'red 'white)
#:on-use (scale-sprite 2 #:for 100)
#:rarity 'common))
(define (shrink-powerup)
(basic-item #:name "Shrink Power-up"
#:icon (make-icon "SML" 'blue 'white)
#:on-use (scale-sprite 0.5 #:for 100)
#:rarity 'rare))
(battlearena-game
#:item-list (list (grow-powerup)
(shrink-powerup)))
Code a game with that has a spear.
(battlearena-game
#:weapon-list (list (spear)))
Code a game with a strong spear. Customize the name.
(battlearena-game
#:weapon-list (list (spear #:name "Heavy Spear"
#:damage 50)))
Code a game with an epic rarity spear that does 50 damage.
(define (my-spear)
(spear
#:name "Heavy Spear"
#:damage 50
#:rarity 'epic))
(battlearena-game
#:weapon-list (list
(my-spear)))
Code a game with that has a 'blue 'legendary spear with 100 damage, 20 speed, and 10 range.
(define (my-spear)
(spear #:name "Spear"
#:icon (make-icon "LS" 'blue)
#:color 'blue
#:damage 100
#:speed 20
#:range 10
#:rarity 'legendary))
(battlearena-game
#:weapon-list (list (my-spear)))
Code a game with a spear tower.
(battlearena-game
#:weapon-list (list (spear-tower)))
Code a game with a tower that shoots fast, long-ranged spears.
(battlearena-game
#:weapon-list (list (spear-tower
#:speed 10
#:range 50)))
Code a game with a tower that shoots fast, powerful, gold-colored spears with a long range.
(battlearena-game
#:weapon-list (list (spear-tower
#:sprite (set-sprite-color 'gold spear-sprite)
#:damage 100
#:speed 10
#:range 50)))
Code a game with a spike mine.
(battlearena-game
#:weapon-list (list (spike-mine)))
Code a game with a spike mine that uses fast, long-ranged darts.
(battlearena-game
#:weapon-list (list (spike-mine
#:speed 10
#:range 50)))
Code a game with that has a weapon that deploys a spike mine with a large range and speed, high damage, and custom sprite.
(battlearena-game
#:weapon-list (list (spike-mine
#:sprite (set-sprite-color 'red spike-mine-sprite)
#:damage 100
#:range 100)))
Code a game with a spread-shot weapon.
(battlearena-game
#:weapon-list (list (repeater #:name "Spread Shot"
#:icon (make-icon "SPR")
#:fire-mode 'spread)))
Code a game with a powerful, fast repeater that shoots multiple darts. Customize the name and the icon.
(define (my-weapon)
(repeater #:name "Spread Shot"
#:icon (make-icon "SPR")
#:fire-mode 'spread
#:damage 20
#:speed 15))
(battlearena-game
#:weapon-list (list (my-weapon)))
Code a game with a 'rare spread-shot weapon that fires darts with customized sprite, damage, durability, and speed.
(define (spread-shot)
(repeater #:name "Spread Shot"
#:icon (make-icon "SPR")
#:fire-mode 'spread
#:sprite (rectangle 10 2 'solid 'orange)
#:rarity 'rare
#:damage 20
#:speed 15))
(battlearena-game
#:weapon-list (list (spread-shot)))
Code a game with that has a sword.
(battlearena-game
#:weapon-list (list (sword)))
Code a game with a sword that does 50 damage.
(battlearena-game
#:weapon-list (list
(sword
#:name "Heavy Sword"
#:damage 50)))
Code a game with that has an 'epic sword that does 50 damage.
(define (my-sword)
(sword #:name "Heavy Sword"
#:damage 50
#:rarity 'epic))
(battlearena-game
#:weapon-list (list (my-sword)))
Code a game with that has a 'gold 'legendary sword with 100 damage and 100 duration.
(define (my-sword)
(sword #:name "Sword"
#:icon (make-icon "LS" 'gold)
#:color 'gold
#:damage 100
#:duration 100
#:rarity 'legendary))
(battlearena-game
#:weapon-list (list (my-sword)))
Code a game with that has armor called Sword Armor.
(battlearena-game
#:item-list (list (basic-armor #:name "Sword Armor"
#:icon (make-icon "SA"))))
Code a game with that has working Sword Armor.
(battlearena-game
#:item-list (list (basic-armor #:name "Sword Armor"
#:icon (make-icon "SA")
#:protects-from "Sword"
#:change-damage (subtract-by 30)
#:rarity 'rare)))
Code a game with that has 10 enemies with a sword and armor for your avatar that will protect against that sword!
(battlearena-game
#:enemy-list (list (basic-enemy #:amount-in-world 10
#:weapon (sword)))
#:item-list (list (basic-armor #:name "Sword Armor"
#:icon (make-icon "RA")
#:protects-from "Sword"
#:change-damage (divide-by 2)
#:rarity 'rare)))
????
(battlearena-game
#:enemy-list (list (basic-enemy #:amount-in-world 20))
#:weapon-list (list (basic-weapon
#:dart (builder-dart #:entity
(wall)))))