You've probably heard of this game. Does Picross ring a bell? Or more obscurely, CubeMania, that homebrew game for the PSP.
Well, this is pretty much that.
What makes this special, at least for me, is that this game was made from scratch without knowledge in how to make these types of games. If there's one thing I'm (sort of) good at, it's reverse-engineering games. Even if just small, basic games.
That's enough about me. Why not give it a shot? It's free! And if you have any feedback, awesome!
Note: I made this on a small lil' laptop and for some reason it ran pretty slow at times (game freezing,input lag, etc.), so I'm not sure if it's just me or the game. If anyone can figure it out for me, I'll highly appreciate it.
Edit: v1.1 comes with the following changes:
- changed the way the game checked if you won to account for multiple solutions
- small optimizations
- font changes
- grid size indicator
- other small stuff
SquareZ
Re: SquareZ
1. love.graphics.setNewFont can be bottleneck here. Check warning (yellow background) on its Wiki page. You should create all fonts in love.load and use love.graphics.setFont later on.
2. love.graphics.getWidth / love.graphics.getHeight don't need to be called from love.update. Use love.resize event.
And use love.mousemoved event to get mx & my (exists since LÖVE v. 0.9.2).
3. love.graphics.setBackgroundColor(bgColor) can also be called only once from love.load.
To summarize all this info - move all unnesessary stuff from love.draw & love.update to other events.
4.You don't need setBorder at all. Again, love.graphics.setLineWidth goes to love.load and change loop in love.draw to:
EDIT: I'm wrong here.
5. Study and make use of canvases. This way you don't need to redraw each cell (until resize occures).
EDIT: I can also recommend never use "magic numbers" like 800, 600 right in the code. Use variables with meaningful names. It applies to any programming language.
2. love.graphics.getWidth / love.graphics.getHeight don't need to be called from love.update. Use love.resize event.
And use love.mousemoved event to get mx & my (exists since LÖVE v. 0.9.2).
3. love.graphics.setBackgroundColor(bgColor) can also be called only once from love.load.
To summarize all this info - move all unnesessary stuff from love.draw & love.update to other events.
4.
EDIT: I'm wrong here.
Code: Select all
for i=1,gridSize do
for j=1,gridSize do
if player[i][j] == 1 then love.graphics.setColor(tileColor)
else love.graphics.setColor(bgColor)
end
x, y, w, h = gx+(i-1)*(gs/gridSize),gy+(j-1)*(gs/gridSize),gs/gridSize,gs/gridSize
love.graphics.rectangle("fill", x, y, w, h)
love.graphics.setColor(txtColor)
love.graphics.rectangle("line", x, y, w, h)
end
end
EDIT: I can also recommend never use "magic numbers" like 800, 600 right in the code. Use variables with meaningful names. It applies to any programming language.
Re: SquareZ
For some reason I expected a zombie survival game with cubes
A small issue I found: When you open the help with F1 and press escape the game will close after your press 'OK' on the help panel.
A small issue I found: When you open the help with F1 and press escape the game will close after your press 'OK' on the help panel.
Re: SquareZ
I don't think I'm able to fix that as love.window.showMessageBox() is a built-in function.rmcode wrote:For some reason I expected a zombie survival game with cubes
A small issue I found: When you open the help with F1 and press escape the game will close after your press 'OK' on the help panel.
1. For some stupid reason, I wasn't aware of love.graphics.setFont(). Thanks for reminding me.arampl wrote:1. love.graphics.setNewFont can be bottleneck here. Check warning (yellow background) on its Wiki page. You should create all fonts in love.load and use love.graphics.setFont later on.
2. love.graphics.getWidth / love.graphics.getHeight don't need to be called from love.update. Use love.resize event.
And use love.mousemoved event to get mx & my (exists since LÖVE v. 0.9.2).
3. love.graphics.setBackgroundColor(bgColor) can also be called only once from love.load.
To summarize all this info - move all unnesessary stuff from love.draw & love.update to other events.
4.You don't need setBorder at all. Again, love.graphics.setLineWidth goes to love.loadand change loop in love.draw to:
EDIT: I'm wrong here.5. Study and make use of canvases. This way you don't need to redraw each cell (until resize occures).Code: Select all
for i=1,gridSize do for j=1,gridSize do if player[i][j] == 1 then love.graphics.setColor(tileColor) else love.graphics.setColor(bgColor) end x, y, w, h = gx+(i-1)*(gs/gridSize),gy+(j-1)*(gs/gridSize),gs/gridSize,gs/gridSize love.graphics.rectangle("fill", x, y, w, h) love.graphics.setColor(txtColor) love.graphics.rectangle("line", x, y, w, h) end end
EDIT: I can also recommend never use "magic numbers" like 800, 600 right in the code. Use variables with meaningful names. It applies to any programming language.
2. Actually, love.resize() is only called when love.window.setMode() is set to an unsupported width/height. So I have to leave it as is, unfortunately.
3 & 4. More stupid mistakes of mine. Thanks again.
5. I won't implement a canvas for this little project as it would involve reworking a lot (especially since I have no idea how to use canvases yet). I'd rather wait until my next project so that I may learn it properly.
The changes have been made and the attached game has been updated. Thanks for trying it!
Re: SquareZ
How do you play?
When I press F1, it crashes:
When I press F1, it crashes:
Code: Select all
Error
main.lua:106 attempt to call field 'showMessageBox' (a nil value)
Traceback
main.lua: 106 in function <main.lua:97>
[C]: in function 'xpcall'
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: SquareZ
Use 0.9.2, since the message box was added in that release of löve.pel wrote:main.lua:106 attempt to call field 'showMessageBox' (a nil value)
Edit: Tested and worksforme on win7... dunno then.
Last edited by zorg on Fri Sep 11, 2015 12:48 pm, edited 1 time in total.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: SquareZ
I am. 0.9.2 for OS X Yosemite.Use 0.9.2, since the message box was added in that release of löve.
Re: SquareZ
Well, I just tested it on a Mac laptop with the mac build which can be found here: http://xyore.itch.io/squarezpel wrote:I am. 0.9.2 for OS X Yosemite.Use 0.9.2, since the message box was added in that release of löve.
Feel free to try that one.
Who is online
Users browsing this forum: Amazon [Bot] and 2 guests