Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Adobe Animate 2023

You're reading from   Mastering Adobe Animate 2023 A comprehensive guide to designing modern, animated, and interactive content using Animate

Arrow left icon
Product type Paperback
Published in Feb 2023
Publisher Packt
ISBN-13 9781837636266
Length 438 pages
Edition 3rd Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Joseph Labrecque Joseph Labrecque
Author Profile Icon Joseph Labrecque
Joseph Labrecque
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Part 1: Getting Up to Speed
2. Chapter 1: Exploring Adobe Animate FREE CHAPTER 3. Chapter 2: Creating and Animating Shapes 4. Chapter 3: Animating with Symbols, Classic Tweens, and Motion Tweens 5. Part 2: Animating with Diverse Techniques
6. Chapter 4: Enhancing Animations Using Advanced Layers Mode 7. Chapter 5: Setting Up Characters Using Layer Parenting 8. Chapter 6: Physical Motion with Inverse Kinematics 9. Chapter 7: Creating and Manipulating Warped Objects 10. Chapter 8: Modern Rigging Techniques 11. Part 3: Exploring Additional Capabilities
12. Chapter 9: Making Interactive Art with Creative Coding Techniques 13. Chapter 10: Developing Web-Based Games 14. Chapter 11: Producing Virtual Reality Content 15. Chapter 12: Building Apps for Desktop and Mobile 16. Chapter 13: Extending Adobe Animate 17. Index 18. Other Books You May Enjoy

Programming the Game with JavaScript

As we mentioned in the previous section, Preparing the game timeline, stage, and library, since we are targeting the native web with an HTML5 Canvas document, we’ll be programming our game with JavaScript. Most code in Animate is bound directly to specific keyframes and is executed when the playhead reaches that frame.

As we start building the code for our game, recall that certain objects exist on the stage already and have been given instance names to allow us to manipulate them. In addition to this, there is a set of objects that only exist within the library and have been given Linkage IDs, which will allow us to create instances of these symbols and sound files at runtime.

The first step in our programming journey is to establish a set of global variables in our game. We’ll do this next since many other bits of code will rely on these variables.

Creating Global Variables

Document types that support JavaScript, including...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime