title: Building a 2D Game Physics Engine: Using HTML5 and JavaScript
author: Michael Tanaya
description: 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)
zlib_text: 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  3D Game Programming
  
  
  
  
  
  Change the world with JavaScript
  
  
    
  
  
  Cosmos Elijah
  
  
  Contents
  
  
  
  
  
  [Introduction..................................................................................................................
  8](text00001.html#a3WC)
  
  
  
  
  
  
  
  
  [1\. Project: Creating Simple Shapes . . . . . . . . 1](text00001.html#a3WR)
  
  
  [1.1 Programming with the ICE Code Editor 1](text00001.html#a3WS)
  
  
  [1.2 Making Shapes with JavaScript 4](text00001.html#a3WT)
  
  
  [1.3 Animating the Shapes 14](text00001.html#a3WU)
  
  
    
  
  
  [1.4 The Code So Far 15](text00001.html#a3WV)
  
  
    
  
  
  [1.5 What’s Next 15](text00001.html#a3WW)
  
  
  
  
  
  
  
  
  [2\. Playing with the Console and Finding What’s Broken . . .
  17](text00001.html#a3WD)
  
  
  [2.1 Getting Started 17](text00001.html#a3WE)
  
  
    
  
  
  [2.2 Opening and Closing the JavaScript Console 18](text00001.html#a3WF)
  
  
  [2.3 Debugging in ICE: The Red X 19](text00001.html#a3WG)
  
  
    
  
  
  [2.4 Debugging in ICE: The Yellow Triangle 19](text00001.html#a3WH)