O'Reilly logo

Build Your Own 2D Game Engine and Create Great Web Games: Using HTML5, JavaScript, and WebGL by Jason Pace, Fernando Arnez, Jebediah Pavleas, Kelvin Sung

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 6

image

Defining Behaviors and Detecting Collisions

After completing this chapter, you will be able to:

  • Implement autonomous, controlled, gradual turning and target-locked chasing behaviors
  • Collide textured objects accurately
  • Understand the efficiency concerns of pixel-accurate collision
  • Program with pixel-accurate collision effectively and efficiently

Introduction

By this point, your game engine is capable of implementing games in convenient coordinate systems and presenting and animating objects that are visually appealing. However, there is a lack of abstraction support for the behaviors of objects. You can see the direct result of this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required