Added SELECT and START buttons

Author Mitja Felicijan <mitja.felicijan@gmail.com> 2025-08-09 09:08:06 +0200
Committer Mitja Felicijan <mitja.felicijan@gmail.com> 2025-08-09 09:08:06 +0200
Commit f9fc0c1e8288cceec65db185a9a908b63a7c3d49 (patch)
-rw-r--r-- README.md 11
-rw-r--r-- stdlib/button.lua 3
-rw-r--r-- tests/test.lua 8
3 files changed, 18 insertions, 4 deletions
diff --git a/README.md b/README.md
1
**Bidi** is a tiny framework/fantasy console for developing small video games for
1
**Bidi** is a lightweight framework and fantasy console designed for creating
2
learning and recreation. It takes heavy inspiration from
2
tiny video games, perfect for learning and having fun.  It takes heavy
3
[LÖVE](https://www.love2d.org/), [Pico8](https://www.lexaloffle.com/pico-8.php)
3
inspiration from [LÖVE](https://www.love2d.org/),
4
and [Atari 2600](https://en.wikipedia.org/wiki/Atari_2600).
4
[Pico8](https://www.lexaloffle.com/pico-8.php) and [Atari
  
5
2600](https://en.wikipedia.org/wiki/Atari_2600).
5
  
6
  
6
You develop your games in Lua and you are only allowed to have one Lua file
7
You develop your games in Lua and you are only allowed to have one Lua file
7
where all your code lives. You can then load external assets like images and
8
where all your code lives. You can then load external assets like images and
...
91
| `button.B`         | `P`      | N/A  | N/A         | N/A      |
92
| `button.B`         | `P`      | N/A  | N/A         | N/A      |
92
| `button.X`         | `K`      | N/A  | N/A         | N/A      |
93
| `button.X`         | `K`      | N/A  | N/A         | N/A      |
93
| `button.Y`         | `O`      | N/A  | N/A         | N/A      |
94
| `button.Y`         | `O`      | N/A  | N/A         | N/A      |
  
95
| `button.SELECT`    | `Q`      | N/A  | N/A         | N/A      |
  
96
| `button.START`     | `E`      | N/A  | N/A         | N/A      |
94
                                                        
97
                                                        
95
### Default colors
98
### Default colors
96
  
99
  
...
diff --git a/stdlib/button.lua b/stdlib/button.lua
...
10
button.X         = 75  -- Key: K
10
button.X         = 75  -- Key: K
11
button.Y         = 79  -- Key: O
11
button.Y         = 79  -- Key: O
12
  
12
  
  
13
button.SELECT    = 81  -- Key: Q
  
14
button.START     = 69  -- Key: E
  
15
  
13
return button
16
return button
diff --git a/tests/test.lua b/tests/test.lua
...
63
		draw_text("Pad Right", 10, 100, 20, color.VIOLET)
63
		draw_text("Pad Right", 10, 100, 20, color.VIOLET)
64
	end
64
	end
65
  
65
  
  
66
	if button_down(button.SELECT) then
  
67
		draw_text("Select", 10, 130, 20, color.VIOLET)
  
68
	end
  
69
  
  
70
	if button_down(button.START) then
  
71
		draw_text("Start", 10, 160, 20, color.VIOLET)
  
72
	end
  
73
  
66
	if button_down(button.A) then
74
	if button_down(button.A) then
67
		draw_text("A", 150, 10, 20, color.VIOLET)
75
		draw_text("A", 150, 10, 20, color.VIOLET)
68
	end
76
	end
...