From d450a0d155671171bf5b5df307abfa40da06f684 Mon Sep 17 00:00:00 2001 From: Jakub Date: Sun, 17 May 2026 20:52:13 +0800 Subject: [PATCH] Basic main menu and README --- .dir-locals.el | 2 + README.org | 75 +++++++++++++ all.options | 1 + modules/ui.scm | 198 +++++++++++++++++++++++++++++++++++ res/fonts/Felipa-Regular.ttf | Bin 0 -> 38040 bytes res/fonts/OFL.txt | 94 +++++++++++++++++ src/bitter-duel.scm | 15 +++ src/main-menu.scm | 64 +++++++++++ 8 files changed, 449 insertions(+) create mode 100644 .dir-locals.el create mode 100644 README.org create mode 100644 all.options create mode 100644 modules/ui.scm create mode 100644 res/fonts/Felipa-Regular.ttf create mode 100644 res/fonts/OFL.txt create mode 100644 src/bitter-duel.scm create mode 100644 src/main-menu.scm diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 0000000..6061899 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,2 @@ +((nil . ((geiser-default-implementation . chicken) + (geiser-active-implementations . (chicken))))) diff --git a/README.org b/README.org new file mode 100644 index 0000000..2feafaa --- /dev/null +++ b/README.org @@ -0,0 +1,75 @@ +#+title: Bitter Duel + +This is a really simple tactics game for the [[https://itch.io/jam/spring-lisp-game-jam-2026][2026 Spring Lisp Game Jam]]. + +It is made in Chicken Scheme, using my own game framework [[https://git.cyan.sh/BirDt/imugi][Imugi]]. + +* Build + +First install Chicken 5, then install Imugi using the instructions in its repo. You will also need to ~chicken-install csm~ for easier building. + +Once both of those dependencies are installed, run: +#+begin_src shell + mkdir build && cd build + csm -program bitter-duel .. + ./bitter-duel +#+end_src + +* Design & Gameplay + +In Bitter Duel, you control a single character on a 5 by 5 grid. There is a single opponent facing off against you. + +Each character has a stance and hand position, and can move, attack, or assume a stance on their turn. +Each character has 3 health. + +** Stances +Stances are initial striking positions, and provide some intrinsic bonus offense and defense on the turn that the stance is assumed. + +After attacking or moving, your stance is broken until you next assume it. + +There are 4 stances: +- High (Up-Left/Up-Right) + - The High stance has a higher defense (70) against High and (60) Stab attacks, but low defense against Low attacks (30). + - The High stance adds additional offense to your High attacks (80). +- Low (Down-Left/Down-Right) + - The Low stance has higher defense (70) against Low and (60) Stab attacks, but low defense against High attacks (30). + - The low stance adds additional offense to your Low attacks (70). +- Side (Mid-Left/Mid-Right) + - The Side stance has higher defense (70) against swing attacks, but low defense (30) against High and Low attacks. + - The Side stance adds additional offense to your Swing attacks (70) + +** Hand Position +Your hand position adds defense against attacks coming from that direction (60) and dictates what next attacks you can perform. + +The hand positions are: +- Up-left: + - Defense against top and right attacks. +- Up-right + - Defense against top and left attacks. +- Mid-right + - Defense against mid and left attacks. +- Mid-left + - Defense against mid and right attacks. +- Down-left + - Defense against bottom and right attacks. +- Down-right + - Defense against bottom and left attacks. + +** Attacks +Each of the hand positions is also a type of attack. You may perform an attack from the 3 positions near the hand position. +For example, Up-Left can attack from Up-Left, Up-Right, or Mid-Left. +After an attack, your hand position changes to the opposite of the attack. So Up-Left becomes Down-Right. + +** Attacking and Turns +Both players lock in their actions, then the turn is resolved like so: +1. Handle any stance changes +2. Handle any movement. +3. Resolve attacks. + +To resolve an attack, get the offense of the attack and defense for that attack from the defender. +Subtract Defense from Offense, divide by 10, and add 5. Call this the "target number". +Roll a number between 1 and 10. If the roll is lower than the target number, the attack goes through and the defender takes a hit. +Characters always attack and defend from the hand position they start in at the beginning of the turn. + +* Credits +- https://sethbb.itch.io/32rogues diff --git a/all.options b/all.options new file mode 100644 index 0000000..a6db636 --- /dev/null +++ b/all.options @@ -0,0 +1 @@ +-static -L /usr/local/lib/libraylib.a -L -lX11 -L -lXrandr -L -lXi -L -lXcursor -L -lXinerama -L -lXext -L -lGL -L -lm -L -lpthread -L -ldl -L -lrt \ No newline at end of file diff --git a/modules/ui.scm b/modules/ui.scm new file mode 100644 index 0000000..1168642 --- /dev/null +++ b/modules/ui.scm @@ -0,0 +1,198 @@ +(module (bd ui) () +(import scheme + (chicken base) + (chicken module) + raylib + (imugi core) + (imugi math) + (imugi drawing) + (imugi resource) + (imugi input) + (srfi 1) + (srfi 4) + (srfi 99)) + +(define base-font (font "../res/fonts/Felipa-Regular.ttf")) + +(define-record-type