Skip to content

Commit

Permalink
Merge pull request #3 from tgk/main
Browse files Browse the repository at this point in the history
Add support for grayscale grid
  • Loading branch information
tyleretters authored Aug 21, 2021
2 parents 9442f08 + aa7fdeb commit 48c6da6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/_grid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ end

function _grid:led_signals()
local level = page.active_page == 3 and menu.selected_item == 1 and 10 or 2
if parameters.is_grayscale_on then level = 15 end
for k,v in pairs(keeper.signals) do
if v.generation <= counters.music_generation then
g:led(v.x, v.y, level)
Expand Down Expand Up @@ -224,8 +225,10 @@ function _grid:led_signal_and_cell_collision()
end

function _grid:led_cells()
local level = 5
if parameters.is_grayscale_on then level = 15 end
for k,v in pairs(keeper.cells) do
g:led(v.x, v.y, 5)
g:led(v.x, v.y, level)
end
end

Expand Down
4 changes: 4 additions & 0 deletions lib/parameters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ function parameters.init()
params:add_option("splash_screen", "SPLASH SCREEN", {"ENABLED", "DISABLED"})
params:set_action("splash_screen", function(index) parameters.is_splash_screen_on = index == 1 and true or false end)

parameters.is_grayscale_on = false
params:add_option("grayscale", "GRAYSCALE", {"ENABLED", "DISABLED"})
params:set_action("grayscale", function(index) parameters.is_grayscale_on = index == 1 and true or false end)

params:add_separator("")
params:add_separator("KUDZU MANAGEMENT")

Expand Down

0 comments on commit 48c6da6

Please sign in to comment.