supervision of my first game(pong)

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
hokuto
Prole
Posts: 18
Joined: Thu Mar 30, 2023 4:17 pm

supervision of my first game(pong)

Post by hokuto »

Hello.
An idea occurred to me that I don't know if you would like. I want to make my first game with love2d but something simple and short, it would be the pong game with two phases and little else.

I have never made a complete game with love2d, I have only been learning and I will surely have problems and doubts in development.

So I thought about developing it and uploading what I'm programming from time to time, so that the people in the forum look at my code and tell me if I'm doing it right or if something needs to be corrected or everything changed. There will also be things that aren't I know how to do it and I will ask how to do it, it would be like a supervision of the project by the community to learn everything necessary for a complete game and have a base for those who come later.

I want to do everything in this thread, I don't know what you think about the idea, since I only do many things wrong.
User avatar
BrotSagtMist
Party member
Posts: 614
Joined: Fri Aug 06, 2021 10:30 pm

Re: supervision of my first game(pong)

Post by BrotSagtMist »

That is what a forum is for.
But you will likely spawn a ton of angry discussion about how stuff is made right.
For example when i look at your previous thread and its about oop, well this is pain. people who try using oop brought the pain upon themself and they deserve no help for it is a terrible code decision.

Also you are planing to make pong. I dont think that needs more than 40-50 lines. Thats not much to work with.
obey
hokuto
Prole
Posts: 18
Joined: Thu Mar 30, 2023 4:17 pm

Re: supervision of my first game(pong)

Post by hokuto »

BrotSagtMist wrote: Fri Apr 07, 2023 8:09 pm That is what a forum is for.
But you will likely spawn a ton of angry discussion about how stuff is made right.
For example when i look at your previous thread and its about oop, well this is pain. people who try using oop brought the pain upon themself and they deserve no help for it is a terrible code decision.

Also you are planing to make pong. I dont think that needs more than 40-50 lines. Thats not much to work with.
The decision to play pong is just to show code quickly in the forum and receive guidance, I just want to learn how to structure the code correctly and learn everything a game has to have.

I don't understand your answer that people using oop is a terrible decision and they don't deserve to be helped. In the other thread I commented that if there was a better way to do things they would show me and no one responded.

So I'll take this opportunity for you to show me a better way to do things, I was just trying to emulate oop because I come from processing and I don't know any other way to do it, but if there is another better way I'll be delighted if you show it to me, I just want to learn .

I would also like you to tell me where I can download examples that help me to learn on my own, they should be examples that teach me to do things correctly.
User avatar
darkfrei
Party member
Posts: 1181
Joined: Sat Feb 08, 2020 11:09 pm

Re: supervision of my first game(pong)

Post by darkfrei »

hokuto wrote: Sat Apr 08, 2023 1:55 pm I just want to learn .

I would also like you to tell me where I can download examples that help me to learn on my own, they should be examples that teach me to do things correctly.
You can write your code and ask the optimization for it.

See also:
https://github.com/love2d-community/LOV ... e-Browser/
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
knorke
Party member
Posts: 239
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: supervision of my first game(pong)

Post by knorke »

If you post your code and ask for feedback then someone will surely reply.

After reading your code in the other thread I suggest to use english names for variables and functions.
That makes it more readable for everyone.

Personally I would not worry too much about doing things "correctly".
Usually there are multiple correct ways.
The best code is code that is finished, so that you have a completed game.
For small game projects it does not matter that much to write good/clean code. Even if you write terrible spaghetti code it will be somewhat manageable because the project is small. Even if your code is horrible inefficient it will likely still be good enough to draw two Pong paddles and a ball at 60 FPS.
User avatar
Bigfoot71
Party member
Posts: 287
Joined: Fri Mar 11, 2022 11:07 am

Re: supervision of my first game(pong)

Post by Bigfoot71 »

I will make an analogy with cooking, there is not a single right way to make spaghetti, everyone will have their recipe, one will surely be better than the other, and as long as you haven't put three tons of salt for fear that it won't be salty enough, it will remain nourishing, and that's the most important thing.

Code is like cooking, the most important thing is that it's edible, as knorke said. Don't stress over these considerations when you haven't even really started yet. Imagine questioning yourself for 3 hours on how to break eggs to make an omelette, wanting to be efficient, you end up doing the exact opposite.

Do things, share them, ask questions, and you will get answers ^^

And I will even add that the best spahetti recipe in the world approved by everyone will always find a detractor in good faith or not, so well, that should help put things into perspective :)
My avatar code for the curious :D V1, V2, V3.
User avatar
BrotSagtMist
Party member
Posts: 614
Joined: Fri Aug 06, 2021 10:30 pm

Re: supervision of my first game(pong)

Post by BrotSagtMist »

hokuto wrote: Sat Apr 08, 2023 1:55 pm I don't understand your answer that people using oop is a terrible decision and they don't deserve to be helped. In the other thread I commented that if there was a better way to do things they would show me and no one responded.
I honestly cant answer because i have not the slightest idea why this style of coding is used in the first place.
Its like a deliberate attempt to make something easy very horrible just for the sake of copying some terrible syntax that sounds fancy.
My point here is that a large chunk of problems described in this forum or in the lua channel is just about people trying to fix their weird oop code that they cant even explain why they use it in the first place if asked.
And yea thats a lost case, i wont respond to them. If you dont understand why you do something, dont do it.

Edit: Okey i did look at your code from the other thread to find better words of what i mean:
And basically you add extra lines to the main code just to run single lines from side files. Its all over the place with extra layers of complexity for calling it. I mean you have problems with it itself already, thats telling.
obey
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: supervision of my first game(pong)

Post by pgimeno »

hokuto wrote: Sat Apr 08, 2023 1:55 pm I don't understand your answer that people using oop is a terrible decision and they don't deserve to be helped. In the other thread I commented that if there was a better way to do things they would show me and no one responded.
I wouldn't pay much attention to that kind of flamebait.
hokuto
Prole
Posts: 18
Joined: Thu Mar 30, 2023 4:17 pm

Re: supervision of my first game(pong)

Post by hokuto »

I have the first code example, right now I have the title screen and the game screen.

I would like them to look at it and tell me what needs to be improved or changed, I would also like to know how to make pressing enter go from the title screen to the game screen because I don't know how to do it.
Attachments
pong.zip
game code
(1.23 KiB) Downloaded 67 times
User avatar
BrotSagtMist
Party member
Posts: 614
Joined: Fri Aug 06, 2021 10:30 pm

Re: supervision of my first game(pong)

Post by BrotSagtMist »

pgimeno wrote: Sun Apr 09, 2023 1:57 pm I wouldn't pay much attention to that kind of flamebait.
Flamebait my ass, he asked for opinion, no?
And my opinion is that you should not waste your time trying to make code running that should not be in you game at the first place.

If i had to replicate the file above i would end up with something like this:
main.lua.zip
(417 Bytes) Downloaded 66 times
Not saying this is the sate of art, dont let anyone tell you how it has to look in the end as long as it works.
But you just dropped
hokuto wrote: Sun Apr 09, 2023 3:17 pm I would also like to know how to make pressing enter go from the title screen to the game screen because I don't know how to do it.
And this problem would not even exist if you would not try to wrap your gamestates into a weird object list.
You can just change where a name is pointing to at any point.
Lets say you want to implement pause in the future, what you are preparing up to here is writing a ton of lines for a new gamestate as opposed to just deleting love.update. So why do all this work?
obey
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 63 guests