Page 5 of 9

Re: Dungeon Crawler [SAVING DONE]

Posted: Fri Apr 06, 2012 5:20 pm
by Davidobot
coffee wrote:
Banoticus wrote:SAVING IS (MISSION ACCOMPLISHED)
LOADING IS NOT (MISSION FAILED)
if you press L it "blues"...
Just don't load the first time. So, start game go to a level. Exit. Start again. Press l

Re: Dungeon Crawler [SAVING DONE]

Posted: Fri Apr 06, 2012 5:23 pm
by Banoticus
coffee wrote:
Banoticus wrote:SAVING IS (MISSION ACCOMPLISHED)
LOADING IS NOT (MISSION FAILED)
if you press L it "blues"...
really it works fine for me i play until level 2 quit and then open it up again and press l and voila level 2. ;)
are you sure you re using the new version
:ehem:

Re: Dungeon Crawler [SAVING DONE]

Posted: Fri Apr 06, 2012 5:25 pm
by coffee
Davidobot wrote:
coffee wrote:
Banoticus wrote:SAVING IS (MISSION ACCOMPLISHED)
LOADING IS NOT (MISSION FAILED)
if you press L it "blues"...
Just don't load the first time. So, start game go to a level. Exit. Start again. Press l
Well, things don't work that way. "Use L to load." So I did. You enabled "Loading" without a safe precautioning when file isnt created. Not my fault but yours. Just fix it because the solution is simple. But don't even tell me it's my fault. lol. :)

Re: Dungeon Crawler [SAVING DONE]

Posted: Fri Apr 06, 2012 5:42 pm
by coffee
Banoticus wrote: really it works fine for me i play until level 2 quit and then open it up again and press l and voila level 2. ;)
are you sure you re using the new version
:ehem:
Hello, welcome to the project. The problem is that you after create the code you forgot to test it and think in all possibilities. You were working always with a file created in your directory but forgot what would happen if one is not there. Just use https://love2d.org/wiki/love.filesystem.exists and disable load option if a file isn't present. Users can't guess that they shouldn't press load when playing for the first time right?

Re: Dungeon Crawler [SAVING DONE]

Posted: Fri Apr 06, 2012 6:40 pm
by Davidobot
coffee wrote:
Banoticus wrote: really it works fine for me i play until level 2 quit and then open it up again and press l and voila level 2. ;)
are you sure you re using the new version
:ehem:
Hello, welcome to the project. The problem is that you after create the code you forgot to test it and think in all possibilities. You were working always with a file created in your directory but forgot what would happen if one is not there. Just use https://love2d.org/wiki/love.filesystem.exists and disable load option if a file isn't present. Users can't guess that they shouldn't press load when playing for the first time right?
I'll be sure to fix that in v0.0007 ;)

Re: Dungeon Crawler [SAVING DONE]

Posted: Fri Apr 06, 2012 10:30 pm
by kesac
Hey, just tried it out. The movement is very smooth, especially when I'm trying to go around corners really quickly. The one thing I really want to be able to do though is just hold down one of the arrow keys to move continuously. Repeatedly tapping an arrow key to go straight for multiple squares is just so tiring! Anyway good stuff, I look forward to future releases.

Re: Dungeon Crawler [SAVING DONE]

Posted: Sat Apr 07, 2012 5:20 am
by Davidobot
kesac wrote:Hey, just tried it out. The movement is very smooth, especially when I'm trying to go around corners really quickly. The one thing I really want to be able to do though is just hold down one of the arrow keys to move continuously. Repeatedly tapping an arrow key to go straight for multiple squares is just so tiring! Anyway good stuff, I look forward to future releases.
Noted, will be added in the near future.

Re: Dungeon Crawler [SAVING DONE]

Posted: Sat Apr 07, 2012 5:37 am
by Banoticus
Davidobot wrote:
coffee wrote:
Banoticus wrote: really it works fine for me i play until level 2 quit and then open it up again and press l and voila level 2. ;)
are you sure you re using the new version
:ehem:
Hello, welcome to the project. The problem is that you after create the code you forgot to test it and think in all possibilities. You were working always with a file created in your directory but forgot what would happen if one is not there. Just use https://love2d.org/wiki/love.filesystem.exists and disable load option if a file isn't present. Users can't guess that they shouldn't press load when playing for the first time right?
I'll be sure to fix that in v0.0007 ;)

Thanks for the advice, I should have considered that. :awesome:

Re: Dungeon Crawler [SAVING DONE]

Posted: Sat Apr 07, 2012 2:27 pm
by Banoticus
I am trying to add a death system: when you die or are killed the screen turns black and the words GAME OVER appear. Can anybody tell me how this is done.
:huh: :cool:

Re: Dungeon Crawler [SAVING DONE]

Posted: Sat Apr 07, 2012 7:41 pm
by jradich
Banoticus wrote:I am trying to add a death system: when you die or are killed the screen turns black and the words GAME OVER appear. Can anybody tell me how this is done.
:huh: :cool:
How about something like:

Code: Select all

player = { --Assigns stuff to player. 1(exept for background) is true, 0 is false
        grid_x = 256,
        grid_y = 256,
        act_x = 200,
        act_y = 200,
        speed = 10,
	direction = 1,
	health = 100,
	sword = 1,
	shield = 0,
        death=false
	level=1
}
       deathtext=' GAME OVER'
In love.update(dt), you could put something like

Code: Select all

if player.health==0 then
     player.death=true
end
You cancel a bunch of other stuff with player.death, too.
the love.draw would be:

Code: Select all

function love.draw()
  if not player.death then
	love.graphics.print("This is the help for this game.\nUse the arrow keys the control the player.\nUse L to load. You save when you exit the game.\nAlpha v.0.0007\n\n\n\nDebugging Info:\nFPS:"..fps.."\nRandom:"..monster.."\nMonsters(True/False):"..mon.."\nHealth:"..player.health.."\nSword(True/False):"..player.sword.."", 500, 30) --help
		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
				if map[y][x] == 0 then
					love.graphics.draw(flor, x * 32 , y * 32 )
				end
				if map[y][x] == 4 then
					love.graphics.draw(chest, x * 32 , y * 32 )
				end
				if map[y][x] == 5 then
					love.graphics.draw(boss_1, x * 32 , y * 32 )
				end
			end
		end
		if player.direction==1 then --prints the direction of player
			love.graphics.draw(guy_u, player.act_x, player.act_y)
		elseif player.direction==2 then
			love.graphics.draw(guy_d, player.act_x, player.act_y)
		elseif player.direction==3 then
			love.graphics.draw(guy_l, player.act_x, player.act_y)
		elseif player.direction==4 then
			love.graphics.draw(guy_r, player.act_x, player.act_y)
		end
	end
	if player.death then
		love.graphics.print(deathtext,100,300)
	end
end