

You can play with this "scaling factor" to make the ball more or less responsive to a fling. You may want to scale up the speed a little bit because the speed of the fling is a little slower than how a golf ball would move. Essentially, set the GolfBall sprite’s speed and heading to match the speed and heading of the player’s fling gesture. The clock will fire continuously to control the movement of the ballįirst, use the GolfBall.Flung event handler to move the golf ball when it is flung. Z = 2 (this makes the sprite appear on top of sprites with lower numbers) This is the ball the player will fling to try to hit the Hole We’ll need our screen to have a defined height in order to set up the golf course properly.Īdd the following components in the Designer:īackgroundColor: Green (or whatever you like!) Screens that are set to scroll do not have a height. In the Screen Properties (shown in right-hand pane): Uncheck the checkbox labeled "Scrollable" so that the screen will not scroll when the app is running. Think of a title related to Mini Golf, or feel free to use the suggested title "Flingit Mini Golf", and type it into the Properties pane on the right side of the Designer. When the Design window opens notice that App Inventor automatically names the screen "Screen1", but you can set the Title of the screen, which will show up in the top bar of the app. Log into App Inventor and start a new project.

We'll build this app in stages, adding a little bit of the game at a time. Part I: Start a new app and make a ball that responds to fling events If you are not familiar with the basics, try stepping through some of the basic tutorials before continuing. This tutorial assumes you are familiar with the basics of App Inventor- using the Component Designer to build a user interface, and using the Blocks Editor to specify the app's behavior.

