June 2018
Beginner to intermediate
298 pages
7h 38m
English
When new rocks are spawned, the main scene will need to pick a random start location. To do this, you could use some geometry to pick a random point along the perimeter of the screen, but instead you can take advantage of yet another Godot node type. You'll draw a path around the edge of the screen, and the script will pick a random location along the path. Add a Path2D node and name it RockPath. When you click on the Path2D, you will see some new buttons appear at the top of the editor:

Select the middle one (Add Point) to draw the path by clicking to add the points shown. To make the points align, make sure Snap to grid is checked. ...
Read now
Unlock full access