# Does anyone know how to?

#1

Here's a link to a game I found
https://appsto.re/ae/F8jev.i

I was wondering if anyone knows the coding or knows how to do this in hopscotch? Any help or idea would be appreciated:smile:

#2

That's a good idea to base off of!

I think it'd be easier making it 2P instead of having to make an AI..but it'd be hard to code because two fingers are working at the same time. I DON'T KNOW!

The goal things can be a line made from text and when the puck bumps it, the score for the other player increases.

Hope I helped at least a little bit!

#3

Thanks @CreativeCoder

#4

For the the opponents I could put last touch but what about the puck(that thing which the opponents throw to each other)

#5

You can do "when puck bumps (thing that you hit the puck with which I forgot the name of), move forward (an amount). You can also do that so it bounces off of the sides

#6

Thanks again @CreativeCoder

#7

Haha, no problem. Just ask if you need any other ideas!

#8

For the disc you hit the puck with repeat forever set x-y position to ipads x-y value when ipads touched.
Example, have one disc for a player a giant red ball. choose 3 smaller balls and have one in the midle front of big ball and the other two on left and right of middle ball.when a puck hits the left ball set angle 45degrees to left.when puck hits right ball set angle 45 degrees right when puck hits middle ball set angle straight. Make sure the smaller balls are under the big ball and slightly sticking out. set the smaller balls forever to the big balls x-y position but set the x or y with y+? or x+? to keep them at the right distance at front of big ball. As for cpu a.i. get 8 or 9 square emojis. Set them to 90% invisibility and place them next to each other to fill the cpu's side of board where it will move. Example- when puck bumps emoji 1 have a move command to go to emoji 1's area,possibly with setting angles and moving fowards. Have this command with each emoji when the puck bumps them as a way for the cpu to detect where the puck is
A lot of work would be needed to make it perfect.

#9

What i mean by set angles 45 degrees is for the pucks movement when bumping the players disc.

#10

#11

You're most welcome.

#12

Yeah @CreativeCoder it might be easier making it 2 Player You can maybe do it by using "When ___ (mallet/thing you hold) is pressed" for the code to make them work at the same time.

#13

You could have the cpu cheat setting its x-y position instantly behind the puck when bumping but the game would be too hard to play

#14

@t1_hopscotch and @Stradyvarious, that's what, I'm making it 2 player, 1 player mode would be twice the code and besides, I don't know how to make one player

#15

And thanks @t1_hopscotch, @Stradyvarious and @CreativeCoder

#16

you could have something like a joystick that move slightly but moves the disc quickly as a way to stop players hands colliding into eachother.

#17

#18

Good luck on this game! It sounds like it's going to be awesome. It would be cool if you could evolve this into a table tennis/ping pong game once you get the mechanics down.

(I changed my profile pic again btw because why not )

#19

Hi @t1_hopscotch, @CreativeCoder, @Stradyvarious, I published the game, it still needs some work but I'll give it an update as soon as possible, I gave you all credits, it's called CRAZY AIR HOCKEY
And thanks for all the wonderful help!