Repository navigation
Jamo 0.5.0
Jamo 0.5.0 is the game-maker's release. Sprites, particles, controllers, tidy code and a way to watch your program run: the things you reach for when you make a real game. Jamo still makes small, fast .exe files with nothing to install.
Get started
- Download jamo-0.5.0-windows.zip below, unzip it anywhere, and double-click install.cmd.
- Open a new terminal and type
jamo version. It should sayJamo 0.5.0. - Try the new game:
jamo run examples\star_guard.jamofrom inside the unzipped folder.
Already have an older Jamo? Just run the new install.cmd. Your own programs stay as they are.
For colors, red underlines, hover help and go to definition in VS Code, download jamo.vsix below. In VS Code, open the Extensions panel, click the ... menu at its top, and choose Install from VSIX.
What's new
Star Guard, a new example game
An arena shooter against waves of three kinds of alien drone. Play with keyboard and mouse, or with a controller. It's one file of about 350 lines, and it uses almost everything below. A bot played it 32 times to make sure the difficulty climbs fairly.
Functions with whole blocks inside
Functions written in place can now hold as many lines as you like, and you can put a named function inside another one:
func main()
var bonus = 10
func score_for(hits: int): int
var base = hits * 100
return base + bonus
end
print(score_for(3)) # 310
end
Sprites and animation (sprite.jamo)
Draw pixel art straight in your code, one row of text per line of pixels, then cut it into frames and animate it:
var ship = sheet(screen.image_from_text([
"...00...",
"..0110..",
".011110.",
"00111100"
], [white, blue]), 8, 4)
Frames can be scaled, turned and mirrored, and animations loop or play once.
Particles (particles.jamo)
Explosions, sparks, smoke and trails in one line: sparks.burst(x, y, 30, orange, 260.0, 0.7). Particles fall with gravity, slow down with drag, and fade as they age.
Controllers (gamepad.jamo)
Xbox-style controllers for up to 4 players: buttons, both sticks, triggers and rumble. A controller that isn't plugged in just reads as nothing pressed, so your game works either way.
Maybe, Pair and Triple (maybe.jamo)
Maybe<T> holds a value that might not be there, so "not found" is clear instead of a made-up -1. Pair and Triple let a function hand back more than one thing.
Numbers that look right
fixed(3.14159, 2) gives 3.14, and commas(1234567) gives 1,234,567. Perfect for scores and money.
jamo fmt: tidy code in one command
jamo fmt game.jamo fixes the indentation of the whole file. It never changes what the program does: the tidied program builds to the exact same .exe.
jamo run --trace: watch your program think
Shows each of your functions as it starts, indented by how deep the calls go. Great for finding out why something happens:
main
greet
shout
greet
shout
Built carefully
- 690 tests pass, including pixel checks of sprites in a real window and hand-worked numbers for particles and rounding.
- Every new feature is in both of Jamo's compilers, the C++ one and the one written in Jamo itself. They give byte-for-byte the same
.exe, and the Jamo one still builds itself the same every time. jamo fmtwas run on every example, library and test, and each tidied file builds to the same program.- Thousands of random programs were checked against Python, with no problems.
Good to know
- A function written in place gets a copy of the variables around it. To share a value that changes, keep it in a list or a struct. Jamo tells you so if you try to change one.
- Windows may still warn about a program it has never seen before. Click More info, then Run anyway.
The full list is in CHANGELOG.md.
