Exercise – Define a Base Class
The exercises below are based on a game where a spaceship avoidsobstacles in space. The ship is positioned at the bottom of acoordinate system and can only move left and right while obstacles”fall” from top to bottom. Throughout the exercises, you’ll createclasses to represent different types of spaceships that can be usedin the game.
Create a Spaceship class with three variable properties: name,health, and position. The default value of name should be an emptystring and health should be 0. position will be represented by anInt where negative numbers place the ship further to the left andpositive
PayPal Gateway not configured
PayPal Gateway not configured