diff --git a/README.md b/README.md index 7a497c8..294ff1e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ -# tamamo +# Mara 2: Tamamo's Fury -A game written in Zig for the [WASM-4](https://wasm4.org) fantasy console. +The sequel to +[Mara: Sh0rk of Justice](https://withinstudios.itch.io/mara-sh0rk-justice), +written to target [wasm4](https://wasm4.org). ## Building @@ -16,11 +18,15 @@ Then run it with: w4 run zig-out/lib/cart.wasm ``` -For more info about setting up WASM-4, see the [quickstart guide](https://wasm4.org/docs/getting-started/setup?code-lang=zig#quickstart). +For more info about setting up WASM-4, see the +[quickstart guide](https://wasm4.org/docs/getting-started/setup?code-lang=zig#quickstart). + +## Releasing the game + +```shell +./release.sh +``` ## Links - [Documentation](https://wasm4.org/docs): Learn more about WASM-4. -- [Snake Tutorial](https://wasm4.org/docs/tutorials/snake/goal): Learn how to build a complete game - with a step-by-step tutorial. -- [GitHub](https://github.com/aduros/wasm4): Submit an issue or PR. Contributions are welcome! diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..b76d190 --- /dev/null +++ b/TODO.md @@ -0,0 +1,45 @@ +# TODO + +- [ ] Tile map + - [ ] Write engine to render tiles to the screen + - [ ] Camera logic for maps bigger than the screen +- [ ] Player + - [x] Player movement + - [ ] Player collision + - [x] Player animation + - [ ] Player inventory +- [ ] Sprites + - [ ] Gate segment + - [ ] Rock + - [ ] Gem of power + - [ ] Goblet of justice + - [ ] Dagger of light +- [ ] Actors + - [ ] King + - [ ] Tamamo-no-Mae +- [ ] Maps + - [ ] Bla'futyo + - [ ] Kanar + - [ ] Shent + - [ ] Ishei Volcano +- Palette + - [ ] Bla'futyo + - [ ] Kanar + - [ ] Shent + - [ ] Ishei Volcano + - [ ] Title Screen/Credits +- [ ] Graphics + - [ ] Title Screen + - [ ] Tamamo-no-Mae evil smile + - [ ] Heart of the volcano +- [ ] Music + - [ ] Music engine + - [ ] Title screen + - [ ] Bla'futyo + - [ ] Kanar + - [ ] Shent + - [ ] Ishei Volcano +- [ ] Text boxes + - [ ] 9-patch frame + - [ ] Text box rendering + - [ ] Slide in/out animation diff --git a/dist/.gitignore b/dist/.gitignore index 19e1bce..d6b7ef3 100644 --- a/dist/.gitignore +++ b/dist/.gitignore @@ -1 +1,2 @@ -*.wasm +* +!.gitignore diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 0000000..59068e6 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,3 @@ +# Mara 2: Tamamo's Fury + +- [Story Details](./story.md) diff --git a/doc/story.md b/doc/story.md new file mode 100644 index 0000000..084a5c8 --- /dev/null +++ b/doc/story.md @@ -0,0 +1,26 @@ +# Story Details + +The island of Kirtash is at peace. The mage has been defeated before he could +threaten the peace of the world. Mara is on a peaceful walk on the beach and +passes near the killing stone that seals Tamamo-no-Mae, a chaotic evil spirit +that has the ability to control the hearts and minds of people, but prefers to +control rulers. As Mara is walking by it, she notices the stone is shattered and +the sealing katana is missing. She races towards Bla'futyo and seeks the gem of +power. + +Mara is a sh0rk that lives in the Falre'th sea near Bla'futyo. One day the stone +that sealed the evil Tamamo-no-Mae is shattered and Tamamo-no-Mae is released. +Tamamo-no-Mae is a fox demon that is able to control the hearts and minds of +people and prefers to sow chaos in the land. Mara's goal is to free the towns of +Bla'futyo, Kanar and Shent from the evil Tamamo-no-Mae and seal her into the +heart of the volcano in Ishei. + +Mara needs to gather the gem of power from Bla'futyo, the goblet of justice from +Kanar, and the dagger of light from Shent and use them to nullify +Tamamo-no-Mae's power. Then finally seal her into the heart of the volcano in +Ishei so that she can never escape again. + +This game is an adventure game where you walk around the minds of the leaders +and free them from Tamamo-no-Mae's influence. Tamamo-no-Mae locked them up in +the deep recesses of their minds and is controlling them to destroy the local +economy and the people. diff --git a/release.sh b/release.sh index 047018c..fd51a28 100755 --- a/release.sh +++ b/release.sh @@ -1,9 +1,19 @@ #!/usr/bin/env bash -set -e +set -ex mkdir -p dist rm -rf dist/* zig build -Drelease-small=true wasm-opt -Oz --zero-filled-memory --strip-producers --dce ./zig-out/lib/cart.wasm -o ./dist/tamamo.wasm -wasm-strip ./dist/tamamo.wasm \ No newline at end of file +wasm-strip ./dist/tamamo.wasm +w4 bundle \ + --windows ./dist/tamamo.exe \ + --mac ./dist/tamamo.macOS \ + --linux ./dist/tamamo.linux \ + --title "Mara 2" \ + --description "Tamamo-no-Mae's Fury" \ + --html ./dist/web \ + --timestamp \ + --html-disk-prefix "mara-2" \ + ./dist/tamamo.wasm \ No newline at end of file diff --git a/sprites/references/Tamamo.jpg b/sprites/references/Tamamo.jpg new file mode 100644 index 0000000..ef35bd9 Binary files /dev/null and b/sprites/references/Tamamo.jpg differ diff --git a/src/main.zig b/src/main.zig index 102d247..050a982 100644 --- a/src/main.zig +++ b/src/main.zig @@ -36,7 +36,12 @@ export fn update() void { w4.m.colors._0 = .p2; } - mara_speed = 0; + var old_speed = mara_speed; + + mara_speed -= 1; + if (mara_speed < 0) { + mara_speed = 0; + } if (gamepad.up) { mara_direction = Direction.Up; mara_speed = 2; @@ -95,6 +100,11 @@ export fn update() void { if (frame_count % 15 == 0 and mara_speed > 0) { mara_frame = !mara_frame; } + + if (old_speed != mara_speed) { + mara_frame = !mara_frame; + } + var frame: u32 = switch (mara_direction) { .Left => 4, .Right => 4, diff --git a/src/sh0rk.zig b/src/sh0rk.zig index e08ed68..fa370fd 100644 --- a/src/sh0rk.zig +++ b/src/sh0rk.zig @@ -39,6 +39,4 @@ pub const Direction = enum(u2) { Down, Left, Right, -}; - - +}; \ No newline at end of file