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
My First Attempt
-
- Prole
- Posts: 2
- Joined: Sun Jun 24, 2012 3:30 am
My First Attempt
- Attachments
-
- pjones-pong.love
- Simple 2-player pong
- (15.92 KiB) Downloaded 276 times
Re: My First Attempt
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.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: My First Attempt
Welcome.
Something interesting happens when you hold spacebar during the time the ball flies off screen.
Something interesting happens when you hold spacebar during the time the ball flies off screen.
Help us help you: attach a .love.
-
- Prole
- Posts: 2
- Joined: Sun Jun 24, 2012 3:30 am
Re: My First Attempt
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
I like it
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
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
- Roland_Yonaba
- Inner party member
- Posts: 1563
- Joined: Tue Jun 21, 2011 6:08 pm
- Location: Ouagadougou (Burkina Faso)
- Contact:
Re: My First Attempt
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!
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!
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: My First Attempt
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.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!
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
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
Re: My First Attempt
A bit of the astonishment gone when I discovered (I think) his blog. (http://patrickmjones.com/blog/about/)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!
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.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: My First Attempt
Nothing against FP. Lua and FP are a great fit, and I don't see that being different for larger programs.Roland_Yonaba wrote:Though, your programming style tends to be kinda functionnal.
Help us help you: attach a .love.
Who is online
Users browsing this forum: Google [Bot] and 1 guest