Page 2 of 9
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 12:09 pm
by Davidobot
coffee wrote:Davidobot wrote:veethree wrote:This is good so far. I like the smooth player movement. If you plan on doing bigger levels i'd suggest using
tiled, it's a general purpose tile map editor. There's a lib that can import the files from tiled. You can get it
here.
Thanks but I prefer *for now* to make the levels manualy
I also think it's better for learning do your own engine than obey "tiled" rules (even that is a flexible engine).
I did quickly and dirtly a change to how your treat levels. I think its a better way. (you don't need to do that level checking and you auto load levels now). Sorry if I mess with something and didn't notice and of course it's only a quick sugestion. A lot can still be improved.
Thank you I will use your modifications.
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 12:14 pm
by Davidobot
Did anyone figure out why "decheck" is not being drawn?
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 12:21 pm
by coffee
Davidobot wrote:
Thank you I will use your modifications.
No problem. What's important is that you understand the modifications and why it's actually better now.
1 - You stop checking every frame loading level or even checking if a level is load.
2 - Now it "cleverly" add +1/-1 to level and don't have to detect each different level exit.
3 - You were treating/calling levels as game_scenes. you better re-implement game_scenes for "real" state changes. I accidentally remove that naming when introducing level var.
Did anyone figure out why "decheck" is not being drawn?
Did I do that?
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 12:25 pm
by Davidobot
coffee wrote:Davidobot wrote:
Did anyone figure out why "decheck" is not being drawn?
Did I do that?
No, read the changelist if anyone did it, it was me.
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 12:30 pm
by coffee
Davidobot wrote:
No, read the changelist if anyone did it, it was me.
As I said I could have messed with something. changelog don't mention "decheck". I will check it in your code.
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 12:32 pm
by Davidobot
Davidobot wrote:
Add stairs that lead you down a level( For some reason they are not printed)
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 12:40 pm
by coffee
Davidobot wrote:Davidobot wrote:
Add stairs that lead you down a level( For some reason they are not printed)
OMG you were doing 3 more cycles for printing. Do at least only one. (But you could do print in another way that not this one.)
Code: Select all
for y=1, #map do --draws the map
for x=1, #map[y] do
if map[y][x] == 1 then
love.graphics.draw(wall, x * 32 , y * 32)
end
if map[y][x] == 2 then
love.graphics.draw(checkpoint, x * 32 , y * 32 )
end
if map[y][x] == 3 then
love.graphics.draw(decheck, x * 32 , y * 32 )
end
end
end
I also did this
Code: Select all
checkpoint= love.graphics.newImage("graphics/stairs_up.png") --2 (on map)
decheck= love.graphics.newImage("graphics/stairs_down.png") --3 (on map)
and got a different tile for down stairs. All is working now.
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 12:43 pm
by Davidobot
coffee wrote:Davidobot wrote:Davidobot wrote:
Add stairs that lead you down a level( For some reason they are not printed)
OMG you were doing 3 more cycles for printing. Do at least only one. (But you could do print in another way that not this one.)
Code: Select all
for y=1, #map do --draws the map
for x=1, #map[y] do
if map[y][x] == 1 then
love.graphics.draw(wall, x * 32 , y * 32)
end
if map[y][x] == 2 then
love.graphics.draw(checkpoint, x * 32 , y * 32 )
end
if map[y][x] == 3 then
love.graphics.draw(decheck, x * 32 , y * 32 )
end
end
end
I also did this
Code: Select all
checkpoint= love.graphics.newImage("graphics/stairs_up.png") --2 (on map)
decheck= love.graphics.newImage("graphics/stairs_down.png") --3 (on map)
and got a different tile for down stairs. All is working now.
K, thx. I think it was caused because it was overwritten by something
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 1:40 pm
by coffee
Davidobot wrote:
K, thx. I think it was caused because it was overwritten by something
Ok, I think things are going well. Last advice. You should now work in "tile" aspect to don't do that ugly triple check in draw. So, you must work now in something that reroutes your map values to your tile gfx:
Code: Select all
for y=1, #map do --draws the map
for x=1, #map[y] do
if map[y][x] > 0 then love.graphics.draw(tile[map[y][x]], y * 32 , x * 32) end
end
end
and put at load
Code: Select all
tile[1] = wall
tile[2] = checkpoint
tile[3] = decheck
or
Code: Select all
tile ={ wall, checkpoint, decheck }
I hope you got this concept. It's vital.
Re: Dungeon Crawler
Posted: Wed Apr 04, 2012 2:20 pm
by coffee
Your new uploaded file is missing a "," after
You must check files before upload,
EDITED: You have a major level change problem (player can land in walled terrain) because you change level but don't let player move to the stairs. If you return true in both level checks all is much better that way.