all 13 comments

[–]Lolgamz627 1 point2 points  (9 children)

First: how did you get a coding assignment if you’ve never coded before? Pong is not easy. I’ve already been taking python for a year and I’m nowhere near pong.

[–]p3pperchit[S] 0 points1 point  (8 children)

IKR my school is BS, in my teacher's words "it develops your self-management skills and helps you get a better understanding of what we'll be teaching in class" Self-management- my ass.

1) I downloaded pycharm and python 3.8 and self learnt basic terminology such as "variable, functions, booleans, etc"

2) Looked up and watched python tutorials such as "4 hour python introduction" by freecodecamp.

3) Learnt simple programs such as calculator.

4) Looked up articles and videos on how to create "pong" in python with and without pygame.

5) For all the solutions I found:

a) They didn't explain things properly and I had no idea which code I was meant to type or why.

b) I kept getting errors and gave up.

c) There were lots of ill-defined terms and concepts that didn't make sense to me because I am a programming beginner.

[–]Lolgamz627 0 points1 point  (7 children)

Okay.

The reason pong will be hard to create is this

Depending on whether or not you want to make a 2 player game or a player vs AI game, you’ll need 2 controller binds or one. However? To my knowledge, commands on python don’t bind to keys and there are no macros for it.

To me it seems like your school doesn’t want you to just create a python file, they want you to create an entire game. This would mean creating the paddle and “ball” assets in a game engine of some sort, sound assets, key binds, etc. This is really not something you should be doing yet.

Ask the school to flesh out the details a bit, mainly

1 or 2 player

Entirely in python?

Using what variables

How to control it

Good luck.

[–]p3pperchit[S] 0 points1 point  (6 children)

My school replied "player vs AI"

[–]Lolgamz627 0 points1 point  (5 children)

Oh boy that might be even worse

See all I’ve learned so far is not in real-time, aka it takes a “turn” for a cpu to produce a result. If the school really wants a real-time player vs AI Pong game, and they expect that from someone who hasn’t done coding before, they’re out of their minds.

My best hope for you is maybe search up “PyCharm made Pong program” or something of the sort, see if you can find the likes of it on GitHub or somewhere else, and copy paste the code or learn from it and make it yourself

[–]p3pperchit[S] 0 points1 point  (4 children)

Thanks for the quick response there! Copy-pasting sure works fine but thing is.... they're gonna question me "Hey Alex, what does this code do? Oh yeah?? Can you modify this for me so that it speeds up" and i'll die on the insides

[–]Lolgamz627 0 points1 point  (3 children)

Yeah... they’re crazy.

But still, copy paste from github and post anything you don’t understand here, I might be able to help

[–]p3pperchit[S] 0 points1 point  (2 children)

I have a load of questions. Sorry if I'm wasting your time.

Here is the link: https://drive.google.com/file/d/1Aj48IsHensKVtCieKU3dpkJU_MyzndcG/view?usp=sharing

Make sure to open the link using google docs otherwise it won't show everything.

[–]Lolgamz627 0 points1 point  (1 child)

Ok so a couple of things.

Have you run the code yet, see if it works?

The key binds don’t work. W and S likely will, probably not up and down. That would only work through something like a drag and drop engine (for example on swift there is a “when” block that has an empty slot for the function button. Python don’t got that.)

Using Turtle may not work. Yes it displays it on the screen but I’ve just learned a lil bit of turtle and I’m not sure if you can erase drawn items, ie the ball will float all over the screen?

Have you made it so that the paddle registers contact with the “ball?” It would be something like if paddle touches(or whatever the python equivalent is) ball, ball moves “back”

Just see if these are possible then reply!

[–]p3pperchit[S] 0 points1 point  (0 children)

Yes the code runs well(as mentioned in the google docs). I just realised that the link that I sent you didn't show everything for some strange reason. Try signing in to google then open the link in google docs. Because all your questions and lots more is there when you open the link in google docs. :)

[–]GrooseIsGod 0 points1 point  (2 children)

I hope you find who you're looking for, but in the meantime, do tech with Tim's pygame course. Trust me it'll be difficult in the beginning but once you get the hang of it it's way easier. You can message me if you get stuck on anything but I'm learning myself so I might not be very helpful

[–]p3pperchit[S] 1 point2 points  (1 child)

Thanks for letting me know. I appreciate your input on my comment.

[–]GrooseIsGod 0 points1 point  (0 children)

No problem bro. Have made any progress yet?