Time for action — modifying the gameClasses file
To modify the gameClasses
file, follow the ensuing steps:
- Open the
gameClasses.monkey
file. - Add an
Import
statement for the explosionClass.monkey
file. - Save the file and close it.
You have added the explosion
class to the game, so that it can be used later on.
Modifying the rocket class
Once a rocket reaches its target position, a new explosion has to be created there. We need to add some code inside the rocket class' Update
method.
..................Content has been hidden....................
You can't read the all page of ebook, please click
here login for view all page.