July 2024
Beginner to intermediate
320 pages
8h 13m
English
This chapter covers
In most games, especially action games, there will be the need to know when one or more objects collide with each other. Because our sample game is a shoot-em-up, we need to know when our enemy objects encounter both our player and any player’s bullets. At this stage, our enemies are all a fixed size, but later we will introduce more enemies of different sizes, so we will need to take this into account with the collision detection routine we will introduce in this chapter.
Our first step is to write a function that works out whether two objects of different sizes have hit ...
Read now
Unlock full access