My First Attempt

Show off your games, demos and other (playable) creations.
Post Reply
patrickmjones
Prole
Posts: 2
Joined: Sun Jun 24, 2012 3:30 am

My First Attempt

Post 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
Attachments
pjones-pong.love
Simple 2-player pong
(15.92 KiB) Downloaded 276 times
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: My First Attempt

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: My First Attempt

Post by Robin »

Welcome.

Something interesting happens when you hold spacebar during the time the ball flies off screen. ;)
Help us help you: attach a .love.
patrickmjones
Prole
Posts: 2
Joined: Sun Jun 24, 2012 3:30 am

Re: My First Attempt

Post by patrickmjones »

Thanks for your feedback coffee. And Robin, I will check that out - maybe something with the logic, thanks for trying it out!
User avatar
richapple
Citizen
Posts: 65
Joined: Sun Dec 25, 2011 10:25 am

Re: My First Attempt

Post 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
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: My First Attempt

Post 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!
User avatar
josefnpat
Inner party member
Posts: 955
Joined: Wed Oct 05, 2011 1:36 am
Location: your basement
Contact:

Re: My First Attempt

Post 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!
Missing Sentinel Software | Twitter

FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
coffee
Party member
Posts: 1206
Joined: Wed Nov 02, 2011 9:07 pm

Re: My First Attempt

Post 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.
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: My First Attempt

Post 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.
Help us help you: attach a .love.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests