29 lines
567 B
Lua
29 lines
567 B
Lua
require("oct_utils")
|
|
require("termbox_defs")
|
|
|
|
card1 = oct_tb_sprite_new();
|
|
card2 = oct_tb_sprite_new();
|
|
dx = 1;
|
|
|
|
function oct_init()
|
|
card1["shape"] = load_termbox_sprite("card.txt");
|
|
card2["shape"] = load_termbox_sprite("card.txt");
|
|
card1["x"] = 50;
|
|
card1["y"] = 0;
|
|
card2["x"] = 50;
|
|
card2["y"] = 50;
|
|
return OCT_NOT_NEEDS_NETWORKING, OCT_NEEDS_TERMBOX;
|
|
end
|
|
|
|
function oct_loop(key)
|
|
if (key == TB_KEY_ARROW_RIGHT)
|
|
then
|
|
card1["x"] = card1["x"] + 1;
|
|
end
|
|
|
|
if (key == TB_KEY_ARROW_LEFT)
|
|
then
|
|
card1["x"] = card1["x"] - 1;
|
|
end
|
|
end
|