The Owls Massacre [v0.003]

Show off your games, demos and other (playable) creations.
User avatar
Johannes
Prole
Posts: 18
Joined: Sat Jun 08, 2013 6:51 pm

Re: The Owls Massacre [v0.002]

Post by Johannes »

One suggestion here: your laser value is showing up as some fairly long and ugly value sometimes, like 6.8149999999999997, when really 6.8 would be fine.

A quick and easy way to fix this, when you're drawing the text to the screen, just wrap your player.laser code in math.floor(). Or if you want to be more fancy, you can add a round function like this:

Code: Select all

function round(num, idp)
	local mult = 10^(idp or 0)
	return math.floor(num * mult + 0.5) / mult
end
which will allow you to choose how many values after the decimal point you want to show. So the usage here would be:

Code: Select all

love.graphics.print("Laser:".. round(player.laser,2), 0, 0)

Also it's generally best not to have spaces in filenames, since those tend to be replaced by ugly "%20" when downloaded.

So for example when I downloaded your 'The Owls Massacre.love' file, it was downloaded as 'The%20Owls%20Massacre.love'. Spaces also makes things complicated when trying to run files from a command line, since there you need to add an escape character \.

Instead of spaces, I would suggest just getting used to using underscores, like 'The_Owls_Massacre.love'.That way it will always display correctly and you'll avoid any possible issues :)
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: The Owls Massacre [v0.002]

Post by bartbes »

Personally, I'd go for using string.format, since it's the right tool for the job. In this case it would be ("Laser: %.1f"):format(player.laser).
User avatar
Kingdaro
Party member
Posts: 395
Joined: Sun Jul 18, 2010 3:08 am

Re: The Owls Massacre [v0.002]

Post by Kingdaro »

bartbes wrote:Personally, I'd go for using string.format, since it's the right tool for the job. In this case it would be ("Laser: %.1f"):format(player.laser).
Eh. I prefer the syntax

Code: Select all

string.format("Laser: %.1f", player.laser)
It's a little longer, but cleaner in my opinion.
User avatar
Davidobot
Party member
Posts: 1226
Joined: Sat Mar 31, 2012 5:18 am
Location: Oxford, UK
Contact:

Re: The Owls Massacre [v0.002]

Post by Davidobot »

Thanks for all the suggestions! :awesome:
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
User avatar
Johannes
Prole
Posts: 18
Joined: Sat Jun 08, 2013 6:51 pm

Re: The Owls Massacre [v0.002]

Post by Johannes »

Kingdaro wrote:
bartbes wrote:Personally, I'd go for using string.format, since it's the right tool for the job. In this case it would be ("Laser: %.1f"):format(player.laser).
Eh. I prefer the syntax

Code: Select all

string.format("Laser: %.1f", player.laser)
It's a little longer, but cleaner in my opinion.
A cool. I'm a total LUA/Love newb so didn't know that you could write c-style string formatting with 'string.format'. Will use that in the future :)
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests