Simulating gravity
Animation Engine makes simulating gravity in mobile apps an easy task. In this recipe, we will create an orange circular graphic and a button. The button will contain a LiveCode script that will animate the graphic to simulate a bouncing ball.
Getting ready
Before using this recipe, you will need to have the Animation Engine external downloaded and available on your development computer. See the Setting up Animation Engine recipe earlier in this chapter.
How to do it...
Follow the steps in this recipe to create objects and a script to simulate gravity in a mobile application:
- Open LiveCode.
- Create a new main stack.
- Open the
animationEngine
stack. With LiveCode already running, you can simply double-click on theanimationEngine.livecode
file. - Once you complete the previous steps, you will see the animationEngine window with a Use me! checkbox (see the following screenshot). Check that box.
- Drag an oval graphic to the stack's card, and set the following preferences:
- Name:
myBall...
- Name: