stuff
This commit is contained in:
parent
57409bb7d6
commit
b669f9d55e
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
game.js
|
||||||
|
game.html
|
|
@ -1,14 +1,14 @@
|
||||||
local coroutines={}
|
local coroutines={}
|
||||||
|
|
||||||
-- starts a coroutine and saves it for future reference
|
-- starts a coroutine and saves it for future reference
|
||||||
function startcoroutine(fn)
|
function startcoroutine(co)
|
||||||
assert(tostr(fn) == "[thread]") -- make sure that fn is a coroutine, the return value of cocreate()
|
assert(tostr(co) == "[thread]") -- make sure that co is a coroutine, the return value of cocreate()
|
||||||
add(coroutines, fn)
|
add(coroutines, co)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- stops the the coroutine
|
-- stops the the coroutine
|
||||||
function stopcoroutine(fn)
|
function stopcoroutine(co)
|
||||||
del(coroutines, fn)
|
del(coroutines, co)
|
||||||
end
|
end
|
||||||
|
|
||||||
function _coresolve()
|
function _coresolve()
|
||||||
|
|
|
@ -6,14 +6,15 @@ local mouse_y = 0
|
||||||
-- constants
|
-- constants
|
||||||
--
|
--
|
||||||
|
|
||||||
local BLUE = 1
|
local BLUE = 2
|
||||||
local YELLOW = 2
|
local YELLOW = 1
|
||||||
|
|
||||||
-- 🅾️ Z[C]N ❎ [X]VM
|
-- 🅾️ Z[C]N ❎ [X]VM
|
||||||
-- X and C have the same position on QWERTY and AZERTY
|
-- X and C have the same position on QWERTY and AZERTY
|
||||||
local LEFT,RIGHT,UP,DOWN,BTN_O,BTN_X = 0,1,2,3,4,5
|
local LEFT,RIGHT,UP,DOWN,BTN_O,BTN_X = 0,1,2,3,4,5
|
||||||
|
|
||||||
local patterns = {
|
local patterns = {
|
||||||
|
0b0000000000000000,
|
||||||
0b1000000000000000,
|
0b1000000000000000,
|
||||||
0b1000000000100000,
|
0b1000000000100000,
|
||||||
0b1010000000100000,
|
0b1010000000100000,
|
||||||
|
|
|
@ -3,14 +3,14 @@ function state_endgame()
|
||||||
local message = "웃웃 yay! 웃웃"
|
local message = "웃웃 yay! 웃웃"
|
||||||
local message_x = 0
|
local message_x = 0
|
||||||
|
|
||||||
local btn_back = make_button({x=1, y=118, h=7, text="🅾️/C bACK TO mENU", color=8,
|
|
||||||
on_click=function() go_to_menu() end,
|
|
||||||
on_hover=function(btn) btn.color = 7 end})
|
|
||||||
|
|
||||||
local function go_to_menu()
|
local function go_to_menu()
|
||||||
set_state(states.menu)
|
set_state(states.menu)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local btn_back = make_button({x=1, y=118, h=7, text="🅾️/C bACK TO mENU", color=8,
|
||||||
|
on_click=function() go_to_menu() end,
|
||||||
|
on_hover=function(btn) btn.color = 7 end})
|
||||||
|
|
||||||
local function _enter(_board)
|
local function _enter(_board)
|
||||||
board = _board
|
board = _board
|
||||||
message_x = (128 - print(message,0,-100))/2
|
message_x = (128 - print(message,0,-100))/2
|
||||||
|
|
|
@ -22,16 +22,15 @@ end
|
||||||
|
|
||||||
function spawn_tile_transition(x, y, w, h, from_tint, to_tint)
|
function spawn_tile_transition(x, y, w, h, from_tint, to_tint)
|
||||||
local p = #patterns
|
local p = #patterns
|
||||||
printh(patterns)
|
|
||||||
local from_color = get_main_color(from_tint)
|
local from_color = get_main_color(from_tint)
|
||||||
local to_color = get_main_color(to_tint)
|
local to_color = get_main_color(to_tint)
|
||||||
add(overlays, {
|
add(overlays, {
|
||||||
_draw = function(self)
|
_draw = function(self)
|
||||||
fillp()
|
fillp()
|
||||||
rectfill(x, y, x + w, y + h, from_color)
|
rectfill(x, y, x + w, y + h, from_color)
|
||||||
fillp(patterns[p]+0b0.1)
|
fillp(patterns[p\1]+0b0.1)
|
||||||
rectfill(x, y, x + w, y + h, to_color)
|
rectfill(x, y, x + w, y + h, to_color)
|
||||||
p -= 2
|
p -= 1
|
||||||
if p < 1 then
|
if p < 1 then
|
||||||
del(overlays, self)
|
del(overlays, self)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user