|
diff --git a/tests/test.lua b/tests/test.lua
|
| ... |
| 24 |
end |
24 |
end |
| 25 |
|
25 |
|
| 26 |
function get_random_color() |
26 |
function get_random_color() |
| 27 |
local keys = {} |
27 |
local keys = {} |
| 28 |
for k in pairs(color) do |
28 |
for k in pairs(color) do |
| 29 |
table.insert(keys, k) -- Collect all keys |
29 |
table.insert(keys, k) -- Collect all keys |
| 30 |
end |
30 |
end |
| 31 |
local randomKey = keys[math.random(1, #keys)] -- Select a random key |
31 |
local randomKey = keys[math.random(1, #keys)] -- Select a random key |
| 32 |
return color[randomKey] -- Return the corresponding color |
32 |
return color[randomKey] -- Return the corresponding color |
| 33 |
end |
33 |
end |
| 34 |
|
34 |
|
| 35 |
function test_json() |
35 |
function test_json() |
| ... |
| 62 |
if button_down(button.PAD_RIGHT) then |
62 |
if button_down(button.PAD_RIGHT) then |
| 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.A) then |
66 |
if button_down(button.A) then |
| 67 |
draw_text("A", 150, 10, 20, color.VIOLET) |
67 |
draw_text("A", 150, 10, 20, color.VIOLET) |
| 68 |
end |
68 |
end |
| ... |