Yoshiii999

My browser / operating system: Windows NT 10.0, Chrome 80.0.3987.162, No Flash version detected


Hi! My browser is Microsoft edge chromium version 80.0.361.109 (official build) (64-bit). My operating system is Windows 10 version 1909. When I was designing a version of pong, (pong is an arcade game, and you can play it by going to Bing search and typing “pong”) and every time I try my code, (with the code in a forever block), it does my instructions once. 1 time. Every time I try it.
when green flag clicked
forever
play sound [sewing machine v]
won't work
end

define won't work
say [won't work]

Minescratcher367

Do you have any stop blocks, like these?
stop [ v]

Yoshiii999

No. Have you played pong? My problem is that the forever loops aren't working.

Yoshiii999

It does it once.
when green flag clicked
forever
set y to (mouse y)
if <touching [ball v] ?> then
broadcast [Bounce v]

end
end

Yoshiii999

Check it out at: https://scratch.mit.edu/projects/383296577/editor/

MathSnail

Maybe try the “play sound until done” block instead?

Yoshiii999

I was showing the blocks on top on purpose.

Yoshiii999

Not in my actual code. Check it at my link above.

yoyoyoyeah

Math snail is right when I was playing the project when I looked at the code and did that it worked.
when green flag clicked



when green flag clicked
forever
play sound [Sewing Machaine] until done
end

Yoshiii999

I told you! Go to my link in my other comments. If you can't find it, go here:https://scratch.mit.edu/projects/383296577/editor/ Here is a preview of my actual code:
when green flag clicked
forever

set y to (mouse y)
if <touching [Ball v] ?> then
broadcast [Bounce2 v]

end

Yoshiii999

For the non-computer.

Yoshiii999

It never works! Below is a preview of my first draft for the computer. It does it once!
when green flag clicked
set [Random position v] to [0]
forever
change [Random position v] by (pick random (-100) to (1))
end
when green flag clicked
set y to (Random position)
forever
if <touching [Ball v] ?> then
broadcast [Bounce v]

end
end

Yoshiii999

And then I fixed it so that it got more time, but then the ball kept stopping the game. Then I fixed that, but my code is for the computer is making stay where it is the last time and now the project does nothing.



when green flag clicked
forever
change [Random position v] by (pick random (1) to (100))

end

when green flag clicked
set Y to (-50)
forever
change y by (random position)
if <touching [ ball v]> then
broadcast [bounce v]
end
end

Yoshiii999

The ball's code:


when green flag clicked
go to x [-5 v] y [-8 v]
point towards [paddle2 v]
repeat until << (x position) > [-168]> or <(x position) > [-153]>
move (5) steps
if on edge, bounce
end
stop [all v]

when I receive [Bounce v]
point towards [paddle v]

when I receive [Bounce2 v]
point towards [paddle2 v]

Yoshiii999

Now my code doesn't work. At all. Proof that the code isn't being highlighted.



when green flag clicked
forever
say [will not work! v]
broadcast [won't work help now! v]
end

when I receive [won't work; help now! v]
fix problem

define fix problem
say [I fixed it! v]

I wish there was something that could stop Pong FROM GLITCHING!



<p> Please help please help please help </p>

Yoshiii999

And now on another project the question became “why are these projects not working?” I told something to specifically do something, and it doesn't do it.


when green flag clicked
help user: Yoshiii999.

define help user: Yoshiii999.
Play sound [I will help you. v]
say [I will help you]

Yoshiii999

I have everything fixed in pong, except for the computer.

Little-Finger

Yoshiii999 wrote:

My browser / operating system: Windows NT 10.0, Chrome 80.0.3987.162, No Flash version detected


Hi! My browser is Microsoft edge chromium version 80.0.361.109 (official build) (64-bit). My operating system is Windows 10 version 1909. When I was designing a version of pong, (pong is an arcade game, and you can play it by going to Bing search and typing “pong”) and every time I try my code, (with the code in a forever block), it does my instructions once. 1 time. Every time I try it.
when green flag clicked
forever
play sound [sewing machine v]
end
(won't work)

define won't work
say [won't work]
I had the same glitch once but it didn't repeat once, it didn't repeat

donotforgetmycode

I just tried your project and it works perfectly

Yoshiii999

Maybe a “stop all” block makes it glitch? My project got because of that.