28 lines
519 B
Lua
28 lines
519 B
Lua
function init()
|
|
x, y, dx, dy = 0, 0, 1, 1
|
|
paper(COLOR_BLACK)
|
|
ink(COLOR_RED)
|
|
setchar(224, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18)
|
|
end
|
|
|
|
function update()
|
|
paper(COLOR_BLACK)
|
|
cls()
|
|
x = x + dx
|
|
y = y + dy
|
|
if x == 39 or x == 0 then
|
|
dx = -dx
|
|
end
|
|
if y == 29 or y == 0 then
|
|
dy = -dy
|
|
end
|
|
locate(2, 2)
|
|
paper(COLOR_GREEN)
|
|
ink(COLOR_BLACK)
|
|
print("HOLA!")
|
|
|
|
--locate(x, y)
|
|
ink(COLOR_RED)
|
|
paper(COLOR_YELLOW)
|
|
print("\224", x, y)
|
|
end |