Don’t miss it—Apress Access is only $99 for the holiday season! Subscribe now >>

Building a 2D Game Physics Engine

Using HTML5 and JavaScript

Authors: Tanaya, M., Chen, H.M., Pavleas, J., Sung, K.

Download source code
  • A unique and practical all-in-one resource on 2D game physics
  • Features easy to read and follow content and utilizes a learn-by-doing approach
  • Allows you to integrate with existing game engines
see more benefits

Buy this book

eBook $19.99
price for USA (gross)
  • ISBN 978-1-4842-2583-7
  • Digitally watermarked, DRM-free
  • Included format: PDF, EPUB
  • ebooks can be used on all reading devices
  • Immediate eBook download after purchase
Softcover $29.99
price for USA
  • ISBN 978-1-4842-2582-0
  • Free shipping for individuals worldwide
  • Usually dispatched within 3 to 5 business days.
About this book

Build your very own 2D physics-based game engine simulation system for rigid body dynamics. Beginning from scratch, in this book you will cover the implementation technologies, HTML5 and JavaScript; assemble a simple and yet complete fundamental mathematics support library; define basic rigid body behaviors; detect and resolve rigid body collisions; and simulate collision responses after the collisions.
In this way, by the end of Building a 2D Game Physics Engine, you will have an in‐depth understanding of the specific concepts and events, implementation details, and actual source code of a physics game engine that is suitable for building 2D games or templates for any 2D games you can create and can be played across the Internet via popular web‐browsers.

What You'll Learn

  • Gain an understanding of 2D game engine physics and how to utilize it in your own games
  • Describe the basic behaviors of rigid bodies
  • Detect collisions between rigid bodies
  • Resolve interpretations after rigid body collisions
  • Model and implement rigid body impulse responses


Who This Book Is For
Game enthusiasts, hobbyists, and anyone who is interested in building their own 2D physics game engines but is unsure of how to begin.

About the authors

Michael Tanaya is an international graduate student from Indonesia in the Computer Science and Software Engineering program at the University of Washington Bothell (UWB). He received his Bachelor of Computer Science in 2014 from the University of Minnesota at Twin Cities. During his time as an undergraduate he took interests in computer games and web application development. In his free time, he enjoys playing competitive video games, designing and developing video games with Unity™ and Cocos2D™. Currently Michael is working with Professor Kelvin Sung on developing a system that integrates virtual and augmented reality technologies in creating a multimedia environment for active hands-on learning. He will be graduating in Spring 2017.
Huaming Chen is an international graduate student from China in the Computer Science and Software Engineering program at the University of Washington Bothell (UWB). He received dual undergraduate degrees, in Computer Science and Economics, from Xiamen University in 2015. During his time as an undergraduate, he was interested in data mining and video game design. His projects include a large number of website groups that related to each other and a software system that recommend useful information based on those website groups. He also developed a mobile game using Unity. Currently Hua Ming is working on a project that focuses on designing video games that simplify vision therapy. He will be graduating in Spring 2017.
Jebediah Pavleas is a software engineer that received his Master of Science in Computer Science and Software Engineering from the University of Washington Bothell (UWB) in 2016 as well as a Bachelor of Science in 2012 where he was the recipient of the Chancellor’s Medal for his class. In 2015 he interned at Microsoft Research where he worked on improving the safety and usability of an eye gaze wheelchair. During his time as a student he took a great interest in both computer graphics and games. His projects included an interactive math application that utilizes Microsoft’s Kinect sensor to teach algebra, a 2D role-playing game designed to teach students introductory programming concepts, and a website where students can compete in various mini-games to control checkpoints around campus. Relating to these projects, he co-authored publications in IEEE Computers and The Journal of Computing Sciences in Colleges. He enjoys designing, building, and playing games of all kinds as well as adapting technology for improved accessibility. Jebediah is also the primary author of Learn 2D Game Development with C#, Apress, December 2013 and co-author of Build Your Own 2D Game Engine and Create Great Web Games, Apress, October 2015.
Kelvin Sung is a professor with the Computing and Software Systems division at University of Washington Bothell (UWB). He received his Ph.D. in Computer Science from the University of Illinois at Urbana-Champaign. Kelvin's background is in computer graphics, hardware, and machine architecture. He came to UWB from Alias|Wavefront (now part of Autodesk), where he played a key role in designing and implementing the Maya Renderer, an Academy Award-winning image generation system. Funded by Microsoft Research and the National Science Foundation, Kelvin’s recent work focused on the intersection of video game mechanics, solutions to real-world problems, and mobile technologies. Together with his students, Kelvin has co-authored three recent books: one in computer graphics (Essentials of Interactive Computer Graphics: Concepts and Implementations, A.K. Peters, 2008), and the others in 2D game engines (Learn 2D Game Development with C#, Apress, December 2013; and Build Your Own 2D Game Engine and Create Great Web Games, Apress, October 2015).

Reviews

“The heart of the book concerns several aspects of the physics and implementation of collision detection, and not only will this get you to some working code, but should give you enough to take away and try in other languages, without being propped up by libraries. The final demo project, and pointers to further exploration, should see you ready to build your own games.” (The MagPi, Issue 58, June, 2017)

Table of contents (5 chapters)

  • Introduction to 2D Game Physics Engine Development

    Tanaya, Michael (et al.)

    Pages 1-14

  • Implementing the 2D Physics Engine Core

    Tanaya, Michael (et al.)

    Pages 15-36

  • Incorporating Collision Detection

    Tanaya, Michael (et al.)

    Pages 37-69

  • Completing the Physics Engine and Rigid Shape Component

    Tanaya, Michael (et al.)

    Pages 71-103

  • Summarizing the Physics Engine

    Tanaya, Michael (et al.)

    Pages 105-112

Buy this book

eBook $19.99
price for USA (gross)
  • ISBN 978-1-4842-2583-7
  • Digitally watermarked, DRM-free
  • Included format: PDF, EPUB
  • ebooks can be used on all reading devices
  • Immediate eBook download after purchase
Softcover $29.99
price for USA
  • ISBN 978-1-4842-2582-0
  • Free shipping for individuals worldwide
  • Usually dispatched within 3 to 5 business days.

Services for this book

Loading...

Bibliographic Information

Bibliographic Information
Book Title
Building a 2D Game Physics Engine
Book Subtitle
Using HTML5 and JavaScript
Authors
Copyright
2017
Publisher
Apress
Copyright Holder
Michael Tanaya, HuaMing Chen, Jebediah Pavleas and Kelvin Sung
eBook ISBN
978-1-4842-2583-7
DOI
10.1007/978-1-4842-2583-7
Softcover ISBN
978-1-4842-2582-0
Edition Number
1
Number of Pages
XVIII, 116
Number of Illustrations
23 b/w illustrations, 19 illustrations in colour
Topics