Need help with Pong

requests

#1

Hi
I am new to Hopscotch.
I am a grade school teacher planning for this new year.
I want to do Pong with the kids, but I am having trouble doing it myself…
Can anyone please share/help with a Pong game?
Thanks!


#2

Hey @eyal.grossman, and welcome to the forums! I found this project that may help:

It’s a little old but it should still be useful for bits of code.


#3

Hello! If you need help, type @Kitty4U at any time. I’m always here anyway. About pong, I made a scratch project on it. Here are my tips:
-Use the “when bump” block carefully. It can lag the iPad.
-Dont be afraid to ask me for help or search for projects on the community tab! That’s what we’re for!
-variables can be tricky at first! Watch some tutorials or scroll through here for help.

That’s it! Good luck. Tag me anytime.


#4

Hi! Try experimenting with “when [X] bumps [X]” rules, and “set angle” blocks. These will help with random angle generation and bouncing when the ball touches the platform.
I think that you may enjoy working on and figuring these things out yourself, as that is part of the fun of coding, but I am always here if you need help – just tag me @WynterDiamond.


#5

Here is a pretty simple version. It can be modified to look better and be more complex, is is just the game itself.


#6

Is this their first time using hopscotch? If it is, You may want to try an easier project before you try to make Pong.


#7

Hello! I have a project for this with an easy code! Just tell me if you want a link to it.


#8

Thank you all!
Going to try this ASAP!!


#9

i want a link, please!


#10

Okay, sure! The code is pretty easy to follow, I think, but let me know if you don’t understand something!


However, there is one thing that you need to know. The code in the project is wrong in one way. The computer (“the auto moving platform”) can’t technically lose, but if you want, I could program it like that and fix it, or you could just add a code in my game that turns the computer into a second player that is coded the same as the player in the game right now.

I hope that this can help you a little bit, at least!


#11

Hello! I have now fixed my Pong game a little! I made it faster and I also made a simple AI for the computer that can lose, however, it is not the best, but it will be easy to understand for your students! Just tell me if you want the code :slight_smile:


#12

Thank you all!
I want the code, please :slight_smile:


#13

Okay, sure! Change the code in the computer’s platform a little bit.
Change the code in the first “When the game starts” - rule.
Make a new value called Y - position.
And change the code to this:

Then, add a new rule in the project called “When the game starts” and add this code:


This is a simple code for an easy AI, but it is not the best.