[CHANGED] 'setmode' renamed to 'mode'
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
function init()
|
||||
setmode(1)
|
||||
mode(1)
|
||||
reset()
|
||||
end
|
||||
|
||||
|
||||
38
demos/defender.lua
Normal file
38
demos/defender.lua
Normal file
@@ -0,0 +1,38 @@
|
||||
function init()
|
||||
mode(1)
|
||||
|
||||
mountains = {}
|
||||
local val = 2
|
||||
for i=0,99 do
|
||||
val = mid(1,val+rnd(3)-1,4)
|
||||
mountains[i] = val
|
||||
end
|
||||
|
||||
ox=0
|
||||
end
|
||||
|
||||
function update()
|
||||
cls()
|
||||
draw_mountains()
|
||||
|
||||
if btn(KEY_RIGHT) then ox=(ox+1)%100 end
|
||||
if btn(KEY_LEFT) then ox=(ox-1)%100 end
|
||||
end
|
||||
|
||||
function draw_mountains()
|
||||
color(COLOR_RED,COLOR_BLACK)
|
||||
for i=0,39 do
|
||||
local x=(ox+i)%100
|
||||
for j=29-mountains[x],29 do
|
||||
local chr="\143"
|
||||
if j==29-mountains[x] then
|
||||
if mountains[(x+1)%100] > mountains[x] then
|
||||
print("\214",i,j-1) --chr="\214"
|
||||
elseif mountains[(x+1)%100] < mountains[x] then
|
||||
chr="\215"
|
||||
end
|
||||
end
|
||||
print(chr,i,j)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -6,7 +6,7 @@
|
||||
--]]
|
||||
|
||||
function init()
|
||||
setmode(1) -- fiquem el mode multicolor de 40x30 caracters
|
||||
mode(1) -- fiquem el mode multicolor de 40x30 caracters
|
||||
color(0,0) -- tinta i fondo a negre
|
||||
cls() -- borrem pantalla
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function init()
|
||||
setmode(1)
|
||||
mode(1)
|
||||
setchar(94, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
|
||||
piano = { "_____", "\143\143\143\154\154", " ", "\143\143\143\154\154", "^^^^^", "_____",
|
||||
"\143\143\143\154\154", " ", "\143\143\143\154\154", " ", "\143\143\143\154\154", "^^^^^" }
|
||||
|
||||
@@ -111,7 +111,7 @@ void print(int x, int y, const char* text, Uint8 color) {
|
||||
--]]
|
||||
|
||||
function init()
|
||||
setmode(1)
|
||||
mode(1)
|
||||
current_piece = starting[rnd(7)+1]
|
||||
next_piece = starting[rnd(7)+1]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user