Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocci bird and Memory fixes #14

Merged
merged 52 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7fa6376
add title screen for rocci bird
bhansconnect Jan 13, 2024
86abe0b
cleanup animation handling
bhansconnect Jan 13, 2024
1bb7c65
refactor game state and add basic jump mechanic
bhansconnect Jan 13, 2024
ba7d0ff
roc format
bhansconnect Jan 13, 2024
08c6049
switch rocci-bird to the new sprite api
bhansconnect Jan 13, 2024
39cda90
update colors and add grass sprite
bhansconnect Jan 14, 2024
e9d3f7d
improve animation timing and format code
bhansconnect Jan 14, 2024
b0e6962
add pipe to title screen
bhansconnect Jan 14, 2024
10ec68e
setup explicit idle and flap animation
bhansconnect Jan 14, 2024
9647f59
add support for more input buttons
bhansconnect Jan 14, 2024
bb5a1f3
add pipe drawing helper
bhansconnect Jan 14, 2024
d211acc
add basic game over screen
bhansconnect Jan 14, 2024
950f29f
switch to smaller rocci sprite
bhansconnect Jan 15, 2024
dc96ba6
switch to direct ground sprite
bhansconnect Jan 15, 2024
fa95663
minor tuning
bhansconnect Jan 15, 2024
07e410c
add pipe movement
bhansconnect Jan 15, 2024
00d0ab0
add pipe generation
bhansconnect Jan 15, 2024
ea42399
add score
bhansconnect Jan 15, 2024
ae2a95a
limit flap frequency
bhansconnect Jan 15, 2024
ab9f4cf
force new input to flap
bhansconnect Jan 15, 2024
f2d3a5b
correct pipe generation time
bhansconnect Jan 15, 2024
0e73ba2
add collisions
bhansconnect Jan 15, 2024
3623ca4
make collision points more accurate base on frame
bhansconnect Jan 15, 2024
8eb900b
improve controls message
bhansconnect Jan 15, 2024
7236cbb
allow score to roll over back to zero
bhansconnect Jan 15, 2024
cfedb97
add flap sound
bhansconnect Jan 15, 2024
8b01da4
add death sound
bhansconnect Jan 15, 2024
8fdcca4
add point sound
bhansconnect Jan 15, 2024
a241f8a
clean up messaging to focus on clicking
bhansconnect Jan 15, 2024
27c6005
more randomness
bhansconnect Jan 15, 2024
aa03934
allow button2 for restart
bhansconnect Jan 15, 2024
e05fea8
split conditional for undestandability
bhansconnect Jan 15, 2024
abd475d
misc cleanup
bhansconnect Jan 15, 2024
c7c2794
remove pipe from title screen, allow off screen collisions, removing …
bhansconnect Jan 15, 2024
145b5e8
tune gravity and flap controls
bhansconnect Jan 15, 2024
fb0d72f
a bit more control cleanup
bhansconnect Jan 15, 2024
1fc740d
add plants to the title screen
bhansconnect Jan 15, 2024
7d13733
some section reordering
bhansconnect Jan 15, 2024
8d342d4
add comment on struct issue
bhansconnect Jan 15, 2024
722457e
make bug clearer to repro
bhansconnect Jan 15, 2024
ec46c5b
correct scoring location
bhansconnect Jan 15, 2024
8459de3
credit the art
bhansconnect Jan 15, 2024
496c1e5
make title screen plants random
bhansconnect Jan 16, 2024
b504d2e
make game over screen nicer
bhansconnect Jan 16, 2024
31c6e61
roc format
bhansconnect Jan 16, 2024
7dff407
partial fix for memory issues
bhansconnect Jan 16, 2024
13123ee
clean up memory allocator
bhansconnect Jan 16, 2024
b1e3734
add ground movement
bhansconnect Jan 16, 2024
bbecc99
make memory configurable and add error messages
bhansconnect Jan 16, 2024
74058d8
remove sprites from model to help avoid capture code gen explosion
bhansconnect Jan 16, 2024
6d53ad2
allow right button to restart game as well
bhansconnect Jan 16, 2024
c0e3b85
save and load a tiny bit of randomness
bhansconnect Jan 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
const roc_src = b.option([]const u8, "app", "the roc application to build");

// Full mem size is 58976, but we have to limit due to needing space for other data and code.
// This has to also leave room for all roc code and constants. That makes it hard to tune.
// Luckily, end users can set this manually when building.
const mem_size = b.option(u16, "mem-size", "the amount of space reserved for dynamic memory allocation") orelse 40960;

const roc_check = b.addSystemCommand(&[_][]const u8{ "roc", "check" });
const roc_lib = b.addSystemCommand(&[_][]const u8{ "roc", "build", "--target=wasm32", "--no-link", "--output", "zig-cache/app.o" });
// By setting this to true, we ensure zig always rebuilds the roc app since it can't tell if any transitive dependencies have changed.
Expand Down Expand Up @@ -39,6 +44,9 @@ pub fn build(b: *std.Build) !void {
.target = .{ .cpu_arch = .wasm32, .os_tag = .freestanding },
.optimize = optimize,
});
const options = b.addOptions();
options.addOption(usize, "mem_size", mem_size);
lib.addOptions("config", options);

lib.import_memory = true;
lib.initial_memory = 65536;
Expand Down
Loading