- [NEW] Actualitzat per a usar l'última versió de mini (v1.3.10)
This commit is contained in:
@@ -58,13 +58,13 @@ editor={
|
|||||||
|
|
||||||
toggle_front_layer=function()
|
toggle_front_layer=function()
|
||||||
if editor.editing_front_layer then
|
if editor.editing_front_layer then
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
editor.editing_front_layer=false;
|
editor.editing_front_layer=false;
|
||||||
else
|
else
|
||||||
if not mapa.front_layer then
|
if not mapa.front_layer then
|
||||||
mapa.front_layer=surf.new(mapa.w,mapa.h)
|
mapa.front_layer=surf.new(mapa.w,mapa.h)
|
||||||
editor.editing_front_layer=true
|
editor.editing_front_layer=true
|
||||||
map.set(mapa.front_layer)
|
map.surf(mapa.front_layer)
|
||||||
for y=0,mapa.h-1 do
|
for y=0,mapa.h-1 do
|
||||||
for x=0,mapa.w-1 do
|
for x=0,mapa.w-1 do
|
||||||
map.tile(x,y,0)
|
map.tile(x,y,0)
|
||||||
@@ -72,7 +72,7 @@ editor={
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
editor.editing_front_layer=true
|
editor.editing_front_layer=true
|
||||||
map.set(mapa.front_layer)
|
map.surf(mapa.front_layer)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
editor.paused=false
|
editor.paused=false
|
||||||
@@ -95,14 +95,14 @@ editor={
|
|||||||
mapa.surface=surf.new(mapa.w,mapa.h)
|
mapa.surface=surf.new(mapa.w,mapa.h)
|
||||||
for y=0,mapa.h-1 do
|
for y=0,mapa.h-1 do
|
||||||
for x=0,mapa.w-1 do
|
for x=0,mapa.w-1 do
|
||||||
map.set(old_surface)
|
map.surf(old_surface)
|
||||||
local value=map.tile(x,y)
|
local value=map.tile(x,y)
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
map.tile(x,y,value)
|
map.tile(x,y,value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
surf.free(old_surface)
|
surf.free(old_surface)
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
editor.paused=false
|
editor.paused=false
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@@ -175,19 +175,19 @@ editor={
|
|||||||
|
|
||||||
update=function()
|
update=function()
|
||||||
surf.cls()
|
surf.cls()
|
||||||
view.origin(editor.cam.x, editor.cam.y)
|
view.origin(-editor.cam.x, -editor.cam.y)
|
||||||
surf.source(tiles)
|
surf.source(tiles)
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
map.draw() --map(0,0,0,0,mapa.w, mapa.h)
|
map.draw() --map(0,0,0,0,mapa.w, mapa.h)
|
||||||
if mapa.front_layer then
|
if mapa.front_layer then
|
||||||
map.set(mapa.front_layer)
|
map.surf(mapa.front_layer)
|
||||||
map.draw() --map(0,0,0,0,mapa.w, mapa.h)
|
map.draw() --map(0,0,0,0,mapa.w, mapa.h)
|
||||||
end
|
end
|
||||||
if editor.editing_front_layer then
|
if editor.editing_front_layer then
|
||||||
map.set(mapa.front_layer)
|
map.surf(mapa.front_layer)
|
||||||
text("EDITING FRONT LAYER",12,2,10)
|
text("EDITING FRONT LAYER",12,2,10)
|
||||||
else
|
else
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
end
|
end
|
||||||
local mx,my=mouse.pos()
|
local mx,my=mouse.pos()
|
||||||
local tx,ty=(mx+editor.cam.x)>>3,(my+editor.cam.y)>>3
|
local tx,ty=(mx+editor.cam.x)>>3,(my+editor.cam.y)>>3
|
||||||
|
|||||||
@@ -144,9 +144,9 @@ game={
|
|||||||
|
|
||||||
draw=function()
|
draw=function()
|
||||||
surf.cls(6)
|
surf.cls(6)
|
||||||
view.origin(game.cam.x, game.cam.y)
|
view.origin(-game.cam.x, -game.cam.y)
|
||||||
surf.source(tiles)
|
surf.source(tiles)
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
map.draw()--map(0,0,0,0,mapa.w, mapa.h)
|
map.draw()--map(0,0,0,0,mapa.w, mapa.h)
|
||||||
switches.draw();
|
switches.draw();
|
||||||
surf.source(sprites)
|
surf.source(sprites)
|
||||||
@@ -164,10 +164,10 @@ game={
|
|||||||
end
|
end
|
||||||
if mapa.front_layer then
|
if mapa.front_layer then
|
||||||
surf.source(tiles)
|
surf.source(tiles)
|
||||||
map.set(mapa.front_layer)
|
map.surf(mapa.front_layer)
|
||||||
map.draw() -- map(0,0,0,0,mapa.w, mapa.h)
|
map.draw() -- map(0,0,0,0,mapa.w, mapa.h)
|
||||||
end
|
end
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
view.origin(0,0)
|
view.origin(0,0)
|
||||||
for i=0,15 do draw.rectf(20+i*4,0,4,4,i) end
|
for i=0,15 do draw.rectf(20+i*4,0,4,4,i) end
|
||||||
end,
|
end,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ mapa={
|
|||||||
mapa.w,mapa.h=w,h
|
mapa.w,mapa.h=w,h
|
||||||
if mapa.surface~=-1 then surf.free(mapa.surface) end
|
if mapa.surface~=-1 then surf.free(mapa.surface) end
|
||||||
mapa.surface=surf.new(w,h)
|
mapa.surface=surf.new(w,h)
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
for y=0,127 do
|
for y=0,127 do
|
||||||
for x=0,127 do
|
for x=0,127 do
|
||||||
map.tile(x,y,0)
|
map.tile(x,y,0)
|
||||||
@@ -39,7 +39,7 @@ mapa={
|
|||||||
|
|
||||||
if num_layers==2 then
|
if num_layers==2 then
|
||||||
mapa.front_layer=surf.new(mapa.w,mapa.h)
|
mapa.front_layer=surf.new(mapa.w,mapa.h)
|
||||||
map.set(mapa.front_layer)
|
map.surf(mapa.front_layer)
|
||||||
|
|
||||||
for y=0,mapa.h-1 do
|
for y=0,mapa.h-1 do
|
||||||
local line = io.read()
|
local line = io.read()
|
||||||
@@ -50,7 +50,7 @@ mapa={
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
io.close(file)
|
io.close(file)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
@@ -63,7 +63,7 @@ mapa={
|
|||||||
io.write(mapa.w.."\n")
|
io.write(mapa.w.."\n")
|
||||||
io.write(mapa.h.."\n")
|
io.write(mapa.h.."\n")
|
||||||
if mapa.front_layer then io.write("2\n") else io.write("1\n") end
|
if mapa.front_layer then io.write("2\n") else io.write("1\n") end
|
||||||
map.set(mapa.surface)
|
map.surf(mapa.surface)
|
||||||
for y=0,mapa.h-1 do
|
for y=0,mapa.h-1 do
|
||||||
for x=0,mapa.w-1 do
|
for x=0,mapa.w-1 do
|
||||||
io.write(map.tile(x,y)..",")
|
io.write(map.tile(x,y)..",")
|
||||||
@@ -71,7 +71,7 @@ mapa={
|
|||||||
io.write("\n")
|
io.write("\n")
|
||||||
end
|
end
|
||||||
if mapa.front_layer then
|
if mapa.front_layer then
|
||||||
map.set(mapa.front_layer)
|
map.surf(mapa.front_layer)
|
||||||
for y=0,mapa.h-1 do
|
for y=0,mapa.h-1 do
|
||||||
for x=0,mapa.w-1 do
|
for x=0,mapa.w-1 do
|
||||||
io.write(map.tile(x,y)..",")
|
io.write(map.tile(x,y)..",")
|
||||||
|
|||||||
Reference in New Issue
Block a user