Flash MX 2004 and Physics-Based Motion
Duration 2 days
Objectives After completing this short course, you will be able to use a variety of mathematical calculations within Actionscript to perform a range of physics-based simulations, such as gravity, bounce, friction, spring motion etc. These functions can then be applied to animated navigation systems, menus and other interface enhancements. The course includes several worked examples which can will be used at the end of the course to build a simple game with animation, projectiles, collision detection and reaction.
Requirements Good working knowledge of the Flash MX environment and workspace; ability to animate with the timeline and use symbols, buttons, text and movie clips within Flash; entry-level knowledge of Actionscript, or basic programming knowledge in any other OOPs programming language.
Course Outline
Flash and Math - The Basics • The Math object in Flash • The Flash Co-ordinate System • Trigonometry in Flash • Math.sin(), Math.cos() and Math.sqrt() • Converting Degrees to Radians and back • Right-angle Triangles and Pythagorus
Basic Physics • Velocity and Acceleration • Newton's Law • Gravity • Friction • Spring Equation
Collision Detection • The hittest() Method in Flash • Using Math for Collision Detetction • Object Wall Detection • Rectangle Collision Dtection • Circle Collision Dtection
Collision Interactions and Reactions • Conservation of Momentum • Conservation of Kinetic Energy • Non-physical reactions • Snooker Table Physics
Going Further • Adding Forces together • Using Mass to get Accelleration • Inter-planetory Gravitational forces
|