George Titus

unread,
Sep 25, 2018, 4:56:06 AM9/25/18
to MIT App Inventor Forum
I've completed and made additions to the Mini Golf Tutorial and it works great. Just one issue: When starting the game and the screen initializes, the arrow, and Tee sprites do not line up as the code suggests, only after resetting a new game (newgamebutton) twice, does the sprites eventually line up as expected. What could be wrong?

SteveJG

unread,
Sep 25, 2018, 8:26:59 AM9/25/18
to MIT App Inventor Forum
You have done this tutorial Mini Golf: Fling, TouchUp, TouchDown Gestures for App Inventor 2

Mini Golf is an addictive little game app that demonstrates how to use the Fling, TouchUp and TouchDown gestures on Sprites. Hold down the positioning arrows to move the ball to the desired position on the tee, then Tee Off by flinging the ball toward the hole. After a hole is scored, the screen randomly sets up a new hole, providing a unique challenge every time. This tutorial is for App Inventor 2.     apparently successfully   and you 'made additions'.  The additions could be the problem.


It may be that when you made the 'additions' you inadvertently changed the starting positions of the sprites  or  you may have changed the position of the Canvas.   We do not know because you have not shared an image of your blocks or shown an image of how the spirtes initially line up versus how they are supposed to line up.


A guess is that your initial sprite positions as set in the Designer are aligned as you see at Project start and you need to adjust those coordinates.


Regards,

Steve

SteveJG

unread,
Sep 26, 2018, 9:02:36 AM9/26/18
to MIT App Inventor Forum
If you are still having problems, consider setting the initial ImageSprite locations using Canvas screen coordinates and post your result here in the Forum please.

This article explains Canvas coordinates ...  
Set your initial sprite coordinates in the Screen1.Initialize block and I think you might solve your problem.
Reply all
Reply to author
Forward
0 new messages