This is absolutely not a priority, It won't even be a great deal if I don't manage to get it work, but just in case someone can find the reason:
The 3d engine does not completely work with the game logic of Darkfrei and still uses mine to draw the levels borders of the map in 3d. Strangely it can render the objects with the new game logic, but not the borders.
Code: Select all
function drawbordermap(block,x,y,tileSize)
dream:draw(cube1, 10 , 10, 10,1,1) -- not working
-- map tile
if palette==1 then love.graphics.setColor(cs1border1)
elseif palette==2 then love.graphics.setColor(cs2border1)
elseif palette==3 then love.graphics.setColor(cs3border1)
elseif palette==4 then love.graphics.setColor(cs4border1)
elseif palette==5 then love.graphics.setColor(cs5border1)
elseif palette==6 then love.graphics.setColor(cs6border1)
end
if palette==7 then love.graphics.setColor(cs6border1)
love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
else
if not(palette==1) then
love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
--love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
end
--dream:draw(cube1, (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
end
if threeD==true then
--dream:draw(cube1, 1, 1,-60, 10,10,10)
end
if palette==1 then love.graphics.setColor(cs1border2)
elseif palette==2 then love.graphics.setColor(cs2border2)
elseif palette==3 then love.graphics.setColor(cs3border2)
elseif palette==4 then love.graphics.setColor(cs4border2)
elseif palette==5 then love.graphics.setColor(cs5border2)
elseif palette==6 then love.graphics.setColor(cs6border2)
end
if palette==7 then love.graphics.setColor(cs6border1)
love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
else
if not(palette==1) then
love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
--love.graphics.rectangle ('line', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
--elseif assets==2 and nLevel==1 then
--love.graphics.draw (level1style1, (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
end
end
end
That is the problematic function, when I uncomment the call to the 3d engine to draw the borders of the map in 3d, the following message appears:
Code: Select all
Error: 3DreamEngine/classes/scene.lua:48: attempt to perform arithmetic on local 'id' (a nil value)
stack traceback:
[string "boot.lua"]:777: in function '__add'
3DreamEngine/classes/scene.lua:48: in function 'add'
3DreamEngine/init.lua:371: in function 'draw'
game/logic/drawassets.lua:54: in function 'drawbordermap'
game/logic/push-blocks.lua:554: in function 'drawMap'
game/levels/changelevel.lua:1361: in function 'changelevel'
game/levelmenu.lua:480: in function 'leveldraw'
main.lua:388: in function 'draw'
[string "boot.lua"]:618: in function <[string "boot.lua"]:594>
[C]: in function 'xpcall'
To ilustrate the problem here is a screenshot:
What's happening in that screenshot is that the objects in 3d are rendered using the push-block logic of darkfrei, while the borders are rendered by my old and deprecated game logic. I can't make any call to 3dream from the drawborder function but it works perfectly from the function that render the objects, I don't understand why.
Any hint why this happens? The file can be found here:
https://codeberg.org/glitchapp/fish-fil ... assets.lua
Thanks