PONG game problem

radz

  • Posts: 13
im still don understand.can you show me example the code

Bhoopalan

  • Posts: 1019
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

Bhoopalan

  • Posts: 1019
The first code should be attached to paddle2:
The second one should be attached to ball.

Basically, you are using game attribute so that you will be able to use the attribute from anywhere. The value of game attribute can be carrier between actors or scenes and it would still remain the same.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

Bhoopalan

  • Posts: 1019
Can't think of why this shouldn't work until there is something that I still don't understand in the game.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

radz

  • Posts: 13
thank you bhoopalan now i can do like what i want.1 more question how to make a power up ,
•   Special powerup (god speed)
o   If a player shoots a power up their paddle speed will increase for 3 sec

Bhoopalan

  • Posts: 1019
I still don't understand that part. Shoot with what? Do you mean hit the powerup with the paddle or shoot it with ball?

If it is ball, you would once again need a game attribute. Create a boolean game attribute with name like <power hit>

Inside <when ball hits special power> event, set <power hit> to true. Beneath that, add <do after [3] seconds > block. Inside that block, set <power hit> to false.

No time to show screenshots now. I'll check again shortly if it didn't work. Please try as much as you can and let us know what it does.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

radz

  • Posts: 13

Bhoopalan

  • Posts: 1019
My bad. The boolean itself won't be necessary. Just inside <when a ball hits a powerup>
<set speednormal1 to [speednormal1 + 2]>
<do after [3] seconds>
<set speednormal1 to [speednormal1 - 2]>

Now when the time mixup with the speed reset behavior that I showed previously via screenshot, it may cause unnecessary confusion.
If I helped you at anytime, help me back build my twitter followers :)
https://twitter.com/imbhoopalan

radz

  • Posts: 13
which one is correct p1 or p2?and how to make that only paddle shot the ball get this effect