canvi de comp
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
ascii
|
ascii
|
||||||
.vscode/*
|
.vscode/*
|
||||||
*.dll
|
*.dll
|
||||||
|
wiki/*
|
||||||
|
|||||||
35
game.lua
35
game.lua
@@ -1,32 +1,17 @@
|
|||||||
cls()
|
|
||||||
function init()
|
function init()
|
||||||
x, y, dx, dy = 0, 0, 1, 1
|
setmode(0)
|
||||||
paper(COLOR_BLACK)
|
|
||||||
ink(COLOR_RED)
|
|
||||||
setchar(224, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function update()
|
function update()
|
||||||
setmode(2)
|
|
||||||
paper(COLOR_BLACK)
|
|
||||||
cls()
|
cls()
|
||||||
x = x + dx
|
locate(0,0)
|
||||||
y = y + dy
|
if mousebutton(1) then
|
||||||
if x == 19 or x == 0 then
|
print("Has pulsat el boto esquerre")
|
||||||
sound(440, 50)
|
elseif mousebutton(2) then
|
||||||
dx = -dx
|
print("Has pulsat el boto del mig")
|
||||||
|
elseif mousebutton(3) then
|
||||||
|
print("Has pulsat el boto dret")
|
||||||
|
else
|
||||||
|
print("No has pulsat cap boto")
|
||||||
end
|
end
|
||||||
if y == 14 or y == 0 then
|
|
||||||
sound(880, 50)
|
|
||||||
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
|
end
|
||||||
Reference in New Issue
Block a user