summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2025-08-09 09:08:06 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2025-08-09 09:08:06 +0200
commitf9fc0c1e8288cceec65db185a9a908b63a7c3d49 (patch)
tree3140485bca4c23541023244281f292c5d27018ff
parent5dd739d7641314ac624a2cd950aaede040467092 (diff)
downloadbidi-f9fc0c1e8288cceec65db185a9a908b63a7c3d49.tar.gz
Added SELECT and START buttons
-rw-r--r--README.md11
-rw-r--r--stdlib/button.lua3
-rw-r--r--tests/test.lua8
3 files changed, 18 insertions, 4 deletions
diff --git a/README.md b/README.md
index b20b9ec..e197ac7 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,8 @@
-**Bidi** is a tiny framework/fantasy console for developing small video games for
-learning and recreation. It takes heavy inspiration from
-[LÖVE](https://www.love2d.org/), [Pico8](https://www.lexaloffle.com/pico-8.php)
-and [Atari 2600](https://en.wikipedia.org/wiki/Atari_2600).
+**Bidi** is a lightweight framework and fantasy console designed for creating
+tiny video games, perfect for learning and having fun. It takes heavy
+inspiration from [LÖVE](https://www.love2d.org/),
+[Pico8](https://www.lexaloffle.com/pico-8.php) and [Atari
+2600](https://en.wikipedia.org/wiki/Atari_2600).
You develop your games in Lua and you are only allowed to have one Lua file
where all your code lives. You can then load external assets like images and
@@ -91,6 +92,8 @@ close_window()
| `button.B` | `P` | N/A | N/A | N/A |
| `button.X` | `K` | N/A | N/A | N/A |
| `button.Y` | `O` | N/A | N/A | N/A |
+| `button.SELECT` | `Q` | N/A | N/A | N/A |
+| `button.START` | `E` | N/A | N/A | N/A |
### Default colors
diff --git a/stdlib/button.lua b/stdlib/button.lua
index 7a656e0..e8b6318 100644
--- a/stdlib/button.lua
+++ b/stdlib/button.lua
@@ -10,4 +10,7 @@ button.B = 80 -- Key: P
button.X = 75 -- Key: K
button.Y = 79 -- Key: O
+button.SELECT = 81 -- Key: Q
+button.START = 69 -- Key: E
+
return button
diff --git a/tests/test.lua b/tests/test.lua
index 644b54b..f85b644 100644
--- a/tests/test.lua
+++ b/tests/test.lua
@@ -63,6 +63,14 @@ function test_buttons()
draw_text("Pad Right", 10, 100, 20, color.VIOLET)
end
+ if button_down(button.SELECT) then
+ draw_text("Select", 10, 130, 20, color.VIOLET)
+ end
+
+ if button_down(button.START) then
+ draw_text("Start", 10, 160, 20, color.VIOLET)
+ end
+
if button_down(button.A) then
draw_text("A", 150, 10, 20, color.VIOLET)
end