CHAPTER 3

image

Drawing Objects in the World

After completing this chapter, you will be able to:

  • Create and draw multiple rectangular objects
  • Control the position, size, rotation, and color of the created rectangular objects
  • Define a coordinate system to draw from
  • Define a target subarea on the canvas to draw to
  • Work with abstract representations of renderable objects, transformation operators, and cameras

Introduction

Ideally, a video game engine should provide proper abstractions to support designing and building games in meaningful contexts. For example, when designing a soccer game, instead of a single square with a fixed ±1.0 drawing range, a ...

Get Build Your Own 2D Game Engine and Create Great Web Games: Using HTML5, JavaScript, and WebGL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.