Page 1 of 1

My First Attempt

Posted: Sun Jun 24, 2012 3:41 am
by patrickmjones
Hello everyone. I went searching online for a simple 2d game engine, found Love, and made a simple pong game within the first hour which is pretty exciting. I have a programming background, but never touched LUA, Love, or game programming. I will be playing around with this and see what else I can do. I've attached the love file and invite the everyone's feedback.

Controls:
Left Player: "a" to move paddle up, "z" to move paddle down
Right Player: "up" to move paddle up, "down" to move paddle down
"spacebar" to serve/start

Re: My First Attempt

Posted: Sun Jun 24, 2012 6:34 am
by coffee
Hello and welcome. Besides working well a quick look in your code shows clean, organized and even commented code. You even do bounding box detection and not some hacky x/y detection. Very good for first (ever) coding! Would be very good that all first time LOVE coders wrote code at least with this quality. Congratulations.

Re: My First Attempt

Posted: Sun Jun 24, 2012 11:56 am
by Robin
Welcome.

Something interesting happens when you hold spacebar during the time the ball flies off screen. ;)

Re: My First Attempt

Posted: Sun Jun 24, 2012 7:16 pm
by patrickmjones
Thanks for your feedback coffee. And Robin, I will check that out - maybe something with the logic, thanks for trying it out!

Re: My First Attempt

Posted: Mon Jun 25, 2012 6:48 am
by richapple
I like it :nyu:
However, IMO it would be better with bigger letters as whenever you have to look at the score your eyes take some time to find them first

Re: My First Attempt

Posted: Mon Jun 25, 2012 3:48 pm
by Roland_Yonaba
Coffee's comment left me curious, then I took a look at the source. Indeed, Very nice, for someone starting Lua.
Though, your programming style tends to be kinda functionnal. You might want to look at OOP, it maybe interesting for larger projects.
Keep up the good work, anyway!

Re: My First Attempt

Posted: Mon Jun 25, 2012 4:31 pm
by josefnpat
Roland_Yonaba wrote:Coffee's comment left me curious, then I took a look at the source. Indeed, Very nice, for someone starting Lua.
Though, your programming style tends to be kinda functionnal. You might want to look at OOP, it maybe interesting for larger projects.
Keep up the good work, anyway!
Looking at what he does, he has quite a bit of OOP, ranging from the gameconfig object, to the classlike object structure for the paddle and his use of an object like ball. Although he isn't using things like ball.update(dt), considering the scope, I really don't think he needs to.

What might be more constructive is mentioning that more advanced OOP concepts in Lua isn't entirely straightforward. It's pretty much a "however you want to do it" kind of language.

The source code is straightforward, logical and well structured. I would be excited to have a college as adept as yourself, patrickmjones. I hope you stick around, and make more love games!

Re: My First Attempt

Posted: Mon Jun 25, 2012 5:32 pm
by coffee
Roland_Yonaba wrote:Coffee's comment left me curious, then I took a look at the source. Indeed, Very nice, for someone starting Lua.
Though, your programming style tends to be kinda functionnal. You might want to look at OOP, it maybe interesting for larger projects.
Keep up the good work, anyway!
A bit of the astonishment gone when I discovered (I think) his blog. (http://patrickmjones.com/blog/about/)
He could not have Lua or game background but for sure his net scripting knowledge give him the tools he need for put pieces well assembled. With or without Lua/game programming he sure did a good starter work.

Re: My First Attempt

Posted: Mon Jun 25, 2012 7:22 pm
by Robin
Roland_Yonaba wrote:Though, your programming style tends to be kinda functionnal.
Nothing against FP. Lua and FP are a great fit, and I don't see that being different for larger programs.