Adding some fire tiles
These new GameObject derived objects will mean instant death to Bob. They won't move, but they will be animated. We will see we can achieve this just by setting the already existing properties of GameObject.
Adding this feature into our game is simple because we have already implemented all the features we need. We already have a way to locate and add new tiles, a way to detect and respond to a collision, sprite sheet animation, and so on. Let's do it step-by-step, then we can add these dangerous and life-threatening elements into our world.
We can put the entire functionality of the class into its constructor. All we do is configure the object much like we did our Grass object, but in addition, we configure it with all the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access