Skip to first unread message

estie bryk

unread,
Nov 24, 2016, 3:16:42 PM11/24/16
to MIT App Inventor Forum
I am teaching an App course using APP Inventor. My students are making a PONG game. One of the students encountered this error. The ball hits the paddle, but the block executed is that the bottom edge reached. I changed canvas height, changed the when paddle.dragged/set y to startY to set y to canvas height - paddle height so it stays on bottom.  I put in a text label to see which block gets executed (when ball.edge reached if edge= -1 then text="edge reached" and also when collided with other then text="collided with". As you can see from picture, ball collided, but text says "edge reached" and game over...

No difference if played on emulator or phone/tablet.

Any suggestions would be greatly appreciated.

I pl
Auto Generated Inline Image 1

Taifun

unread,
Nov 24, 2016, 3:25:13 PM11/24/16
to MIT App Inventor Forum
It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

Taifun

Trying to push the limits of App Inventor! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun. 

estie bryk

unread,
Nov 24, 2016, 7:39:45 PM11/24/16
to MIT App Inventor Forum
Good point. Sorry. I'm still new at this.
Here is most of the blocks:

Auto Generated Inline Image 1

Abraham Getzler

unread,
Nov 25, 2016, 1:25:59 PM11/25/16
to MIT App Inventor Forum
Maybe you need to raise the paddle away from the bottom edge more,
to give the paddle collision precedence over the edge bounce?

Try setting paddle Y lower by Ball1.Radius in the Ball1.Drag event?

ABG

estie bryk

unread,
Nov 26, 2016, 7:16:38 PM11/26/16
to MIT App Inventor Forum
Thank you. I tried it and it helped most of the time.
I set paddle.move to x= get currentX, y=canvas.height-paddle.height - ball.radius (so it is steady at @303 when canvas has height of 350)
When speed of ball gets too fast (above 50), then the event of edge reached is checked/called before ball collided event.
I have to look into what intervals the ball and paddle should be set to.
Thank you for your assistance.


Auto Generated Inline Image 1
Reply all
Reply to author
Forward
0 new messages