How Can I Increase Speed Per Collision On A Certain Block? (paddle for example)

431 views
Skip to first unread message

Gremlin Won

unread,
Aug 10, 2015, 6:21:59 PM8/10/15
to mitappinv...@googlegroups.com
Hi all, New to MIT App inventor really but know the basics of Scratch.

When fiddling about with the "Pong" app i got bored quickly as I would never die as it was too easy. So I decided to see if I could make it harder per bounce on the paddle.
I successfully managed to make it harder using the "random integer" but it was very unreliable as sometimes your first bounce would take it to maximum speed.

My Question: How can I increase speed per collision on a certain block? (for MIT App Inventor 2)

What I want to do is increase the speed by "+1" each time it touches the paddle. I have not found a way to do this yet, has anyone got an answer to this? I assume it's just my new experience and not knowing how to after some searches had no luck finding an answer.

Thanks in advance to any help :)

Thomas

Italo

unread,
Aug 12, 2015, 2:59:14 AM8/12/15
to MIT App Inventor Forum
Everytime the ball touches the paddle set the ball speed to ball speed + 1

Gremlin Won

unread,
Aug 12, 2015, 6:36:54 AM8/12/15
to MIT App Inventor Forum
I will give it a try but I have done something similar to what you said and it only increased the ball speed the first time it touched and then never increased the speed again.

Italo

unread,
Aug 12, 2015, 9:31:25 AM8/12/15
to MIT App Inventor Forum
If you do this, the speed has to increase.


Hal Abelson

unread,
Aug 12, 2015, 9:33:58 AM8/12/15
to MIT App Inventor Forum
Is it possible that you are increasing the speed, but you have a large interval?    That is, each sprite has two quantities:

- the speed is the number of pixels the sprite moves per clock tick
- the interval is the number of milliseconds between clock ticks

If the speed is large, but the interval is also large, then the sprite will move a large distance between clock ticks, but the
change won't happen faster than the freqency of the clock ticks.

Gremlin Won

unread,
Aug 12, 2015, 12:50:43 PM8/12/15
to mitappinv...@googlegroups.com
Thanks, I can already see that's where I'm going wrong. that will work thanks for your help :)

Italo has fixed the problem.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages