Page 2 of 2

Re: crossfire

Posted: Tue Dec 01, 2015 2:35 am
by Beelz
CanadianGamer wrote:Thank you for your feedback if you could point me towards a good tutorial for the highscore idea it would be much appreciated
This is a snippet I snagged from... somewhere. Can't remember where, but here you go. Just call this function at the end of the round.

Code: Select all

function highScore(newScore)
	saveDir = love.filesystem.getSaveDirectory()
	saveFile = "highscore.txt"
	saveFileExists = love.filesystem.exists(saveFile)
	if saveFileExists then
		localHighScore = love.filesystem.read(saveFile)
		localHighScore = tonumber(localHighScore)
	else
		localHighScore = 0
	end

	if newScore > localHighScore then
		localHighScore = newScore
	end

	love.filesystem.write(saveFile, localHighScore)
	return localHighScore
end

Re: crossfire

Posted: Tue Dec 01, 2015 2:51 am
by CanadianGamer
ok now I've added both game music and game over music what do you think

Re: crossfire

Posted: Tue Dec 01, 2015 2:56 am
by CanadianGamer
Beelz wrote:
CanadianGamer wrote:Thank you for your feedback if you could point me towards a good tutorial for the highscore idea it would be much appreciated
This is a snippet I snagged from... somewhere. Can't remember where, but here you go. Just call this function at the end of the round.

Code: Select all

function highScore(newScore)
	saveDir = love.filesystem.getSaveDirectory()
	saveFile = "highscore.txt"
	saveFileExists = love.filesystem.exists(saveFile)
	if saveFileExists then
		localHighScore = love.filesystem.read(saveFile)
		localHighScore = tonumber(localHighScore)
	else
		localHighScore = 0
	end

	if newScore > localHighScore then
		localHighScore = newScore
	end

	love.filesystem.write(saveFile, localHighScore)
	return localHighScore
end

thank you

Re: crossfire

Posted: Tue Dec 01, 2015 11:33 pm
by CanadianGamer
just released a version that has a highscore part in it i hope you enjoy