Task 3.2: Create an instance of player
If a class is a blueprint, then creating an instance is using that blueprint to make something!
- Outside of your class definition (in your main code), create a new player object!
💡 Hint
- Generally, you can create a class instance like so:
car_instance = Car("Red", 60)
- After you create the player instance, print out the player’s important properties to check they were created correctly.
💡 Hint
- You can access a class property by using a dot, like this:
car_instance.colour
. This should be"Red". - Print the player's
sprite
. - Print the player's
position_x
. - Print the player's
position_y
. - Print the player's
size
.
🚩 Checkpoint
- A player object stored in a variable called
Player
. - Printouts in the terminal showing the player's properties.