- [NEW] Més habitacions acabades
- [WIP] Comence amb les cutscenes
This commit is contained in:
1 parent
335d41ded3
commit
1f6fd47b6d
6 files changed
+29
-5
No files matched your search
Binary file not shown.
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
+29
-5
@@ -195,8 +195,10 @@ editor = {
|
||||
end
|
||||
end
|
||||
view.origin(0,0)
|
||||
draw.text(rooms.pos.x//20,1,96,28)
|
||||
draw.text(rooms.pos.y//13,5,96,28)
|
||||
local coords = (rooms.pos.x//20) .. "," .. (rooms.pos.y//13)
|
||||
draw.text(coords,2,98,1)
|
||||
draw.text(coords,1,97,28)
|
||||
--draw.text(rooms.pos.y//13,9,96,28)
|
||||
|
||||
if editor.msg_timeout > 0 then
|
||||
editor.msg_timeout = editor.msg_timeout - 1
|
||||
@@ -349,6 +351,11 @@ editor = {
|
||||
mapviewer = {
|
||||
surf = nil,
|
||||
pal = nil,
|
||||
mx = 0,
|
||||
my = 0,
|
||||
sx = 0,
|
||||
sy = 0,
|
||||
ants = 0xc936,
|
||||
|
||||
show = function()
|
||||
if editor.mapviewer.surf == nil then editor.mapviewer.surf = surf.new(160,104) end
|
||||
@@ -370,6 +377,13 @@ editor = {
|
||||
if editor.mapviewer.pal == nil then editor.mapviewer.pal = pal.load("maps/tiles_palette.gif") end
|
||||
pal.set(editor.mapviewer.pal)
|
||||
|
||||
editor.mapviewer.sx = (rooms.pos.x)--//20)*20
|
||||
editor.mapviewer.sy = (rooms.pos.y)--//13)*13
|
||||
editor.mapviewer.mx, editor.mapviewer.my = mouse.pos()
|
||||
if editor.mapviewer.mx>=0 and editor.mapviewer.mx<160 and editor.mapviewer.my>=0 and editor.mapviewer.my<104 then
|
||||
editor.mapviewer.sx, editor.mapviewer.sy = (editor.mapviewer.mx//20)*20, (editor.mapviewer.my//13)*13
|
||||
end
|
||||
|
||||
app.push(editor.mapviewer.update)
|
||||
end,
|
||||
|
||||
@@ -390,11 +404,21 @@ editor = {
|
||||
draw.rect(x, y, 20, 13, 68)
|
||||
|
||||
local mx,my = mouse.pos()
|
||||
mx,my = (mx//20)*20, (my//13)*13
|
||||
draw.rect(mx, my, 20, 13, 23)
|
||||
if editor.mapviewer.mx ~= mx or editor.mapviewer.my ~= my then
|
||||
editor.mapviewer.mx, editor.mapviewer.my = mx, my
|
||||
editor.mapviewer.sx, editor.mapviewer.sy = (mx//20)*20, (my//13)*13
|
||||
end
|
||||
draw.mode(draw.PATTERN)
|
||||
draw.pattern(editor.mapviewer.ants)
|
||||
draw.rect(editor.mapviewer.sx, editor.mapviewer.sy, 20, 13, 23)
|
||||
draw.mode(draw.NORMAL)
|
||||
if sys.chrono() > 0.125 then
|
||||
sys.chrono(0)
|
||||
editor.mapviewer.ants = (editor.mapviewer.ants<<12) | (editor.mapviewer.ants>>4)
|
||||
end
|
||||
|
||||
if mouse.press(mouse.LEFT) then
|
||||
rooms.pos.x, rooms.pos.y = mx, my
|
||||
rooms.pos.x, rooms.pos.y = (mx//20)*20, (my//13)*13
|
||||
editor.mapviewer.close()
|
||||
end
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user