UI
Now that the ball is on the course, you need a way to aim and hit the ball. There are a number of possible control schemes for a game of this type. For this project, you'll use a two-step process:
- Aim: An arrow will appear swinging back and forth. Clicking the mouse button will set the aim direction to the arrow's.
- Shoot: A power bar will move up and down on the screen. Clicking the mouse will set the power and launch the ball.
Aiming arrow
Drawing an object in 3D is not as easy as it is in 2D. In many cases, you'll have to switch to a 3D modeling program such as Blender to create your game's objects. However, in this case Godot's primitives have you covered; to make an arrow, you just need two meshes: a long, thin rectangle and a triangular prism.
Start a new scene by adding a Spatial
node with a MeshInstance
child. Add a new CubeMesh
. Click on the Mesh
property and set the Size
property to (0.5, 0.2, 2)
. This is the body of the arrow, but it still has one problem. If you rotate the parent...