Mr. BallGuy 2!!!! ***V0.1.1 ALPHA***

Show off your games, demos and other (playable) creations.
User avatar
SneakySnake
Citizen
Posts: 94
Joined: Fri May 31, 2013 2:01 pm
Contact:

Re: Mr. BallGuy 2!!!! ***V0.1.1 ALPHA***

Post by SneakySnake »

For me, the game starts to become really slow when the score is higher than the highscore.
I wondered why, so I looked into the source code.

You are doing filesystem input/output every frame, which is not a good thing.

Code: Select all

function love.update(dt)
   ...
        
	if player.score > tonumber(player.highscore) then 
		player.highscore = player.score
		lf.write("highscores.lua", "player.highscore\n=\n" .. player.score)
		lf.read("highscores.lua")
	end
	lf.read("highscores.lua")
	lf.read("coin.lua")

   ...
It can be a major bottleneck, especially if the user doesn't have a really fast disk.
Ideally, you shouldn't do any filesystem operations in love.update(). It would be enough to update the high score when the player dies, for example.
User avatar
Eamonn
Party member
Posts: 550
Joined: Sat May 04, 2013 1:29 pm
Location: Ireland

Re: Mr. BallGuy 2!!!! ***V0.1.1 ALPHA***

Post by Eamonn »

SneakySnake wrote:For me, the game starts to become really slow when the score is higher than the highscore.
I wondered why, so I looked into the source code.

You are doing filesystem input/output every frame, which is not a good thing.

Code: Select all

function love.update(dt)
   ...
        
	if player.score > tonumber(player.highscore) then 
		player.highscore = player.score
		lf.write("highscores.lua", "player.highscore\n=\n" .. player.score)
		lf.read("highscores.lua")
	end
	lf.read("highscores.lua")
	lf.read("coin.lua")

   ...
It can be a major bottleneck, especially if the user doesn't have a really fast disk.
Ideally, you shouldn't do any filesystem operations in love.update(). It would be enough to update the high score when the player dies, for example.
Lol I thought I setup a done_once variable to handle this. Thanks!
"In those quiet moments, you come into my mind" - Liam Reilly
User avatar
qaisjp
Party member
Posts: 490
Joined: Tue Sep 04, 2012 10:49 am
Location: United Kingdom
Contact:

Re: Mr. BallGuy 2!!!! ***V0.1.1 ALPHA***

Post by qaisjp »

I'm not very impressed with this table-flippable !!!!!! version 2 !!!!!!.
I mean you haven't changed much, nothing new is introduced. The usage of versions in this game makes it look like its a pro game, but it's not half as good as a pro game. All I can say is that he has progressed from when he first joined.

Here is some advice: You've made your first game. You're impressed with yourself but everyone else who aren't your best friends thinks it is crap. Everyone's first game is a pile of rubbish. But you're learning. You'll improve periodically as everyone does. Try a new project. Your first project won't be a hit.
Lua is not an acronym.
User avatar
NightKawata
Party member
Posts: 294
Joined: Tue Jan 01, 2013 9:18 pm
Location: Cyberspace, Room 6502
Contact:

Re: Mr. BallGuy 2!!!! ***V0.1.1 ALPHA***

Post by NightKawata »

The first Mr. Ballguy was okay, especially for a first project.
This one, I don't like as much. It tries to be new but it doesn't feel fresh, more like an expansion to the first with a different perspective.
"I view Python for game usage about the same as going fishing with a stick of dynamite. It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -taylor
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests