PYTHON — Splitting Space Rocks With Python

<p>In the current version of the game, when you hit a rock with a bullet, the rock disappears, which is not very realistic. In this lesson, we will modify the&nbsp;<code>Rock</code>&nbsp;constructor to handle the splitting of rocks. We will also introduce different rock sizes.</p> <p>Let&rsquo;s start by creating a factory method within the&nbsp;<code>Rock</code>&nbsp;class. This method, called&nbsp;<code>.create_random()</code>, will be responsible for constructing and returning a rock object. This approach makes the code clearer and easier to read.</p> <p><a href="https://medium.com/paulacy-pulse/python-splitting-space-rocks-with-python-77b2123fb989"><strong>Click Here</strong></a></p>
Tags: Space rocks