Abstract
Asteroids, like ships, can be approximated to a circle for the purposes of collision detection. However, they should be irregular shapes, and each one should be unique. To achieve this we’ll make extensive use of the Math.random method to define the shape of our asteroids.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2017 Graeme Stuart
About this chapter
Cite this chapter
Stuart, G. (2017). Drawing an Asteroid. In: Introducing JavaScript Game Development . Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-3252-1_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-3252-1_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-3251-4
Online ISBN: 978-1-4842-3252-1
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books