In this lab we will start working on a board game using a rolling die, similar to Chutes and Ladders. Here is an an example (http://www.cs.iusb.edu/~danav/teach/b583/monsterGL/) of the intended result.
Ex. 1. Godot Project. Create a new 3D project in Godot called MonsterRun. Leave it empty for now.
Download the following zip file and extract the files in a local folder.
Create a folder called Models and drag the files path.obj and path.mtl into it. It's important to get the folder's name right. Create another folder called Scenes. Drag the file root.tscn into this folder. Open the scene to load it. It should contain the usual 3D environment, a box with transparent walls, and inside it, the path object with 20 quads placed on it.
Create another folder called Materials and drag all the png files into it. Also drag the other obj and mtl objects into the folder Models as well as die.fbx.
The scene already has 20 tiles to be used in the game. The path object is supposed to be under them. If you can't see it, add it from the Models folder and scale it and rotate it so that it fits most of the tiles. You can rearrange the tiles to fit the path better and set the color of the path as you like. Once the path object is properly defined, make the tile objects children of the path if they are not already.
Create 3 button objects called Button1, Button2, Button3. Place them at the top of the window in the center next to each other. Have them display "Roll", "Fight", and "Run" respectively. Add a node of type Label and place it at the top in the left corner, with the text "Roll: 2 PowerUp: 1 Monster: 3". Make it big enough to fit this text and name it InfoText. Add another label placed in the top right corner showing "Score: 0" and named ScoreText.
Add the die.fbx model to the scene and call it DieObj. Set its X scale to 0.2, then hit a tab so that the other scale values can be adjusted accordingly. Drag it down to the level of the box's base and place it around the center of the box.
Add the knight (credit to thingiverse.com user MattKerekanich) or the shroom object to the scene, as you prefer. This will represent the player. Assign it a material in the Inspector under Geometry - Material Override, with the color you want under Albedo. Set its scale as 0.2 or close. Make sure that it stands on the plane (y = 0). Give it the name Player. Place it over the object tile0.
Create a Node3D object called GameMaster and attach the script game_master.gd to it as component. Connect the buttons, the text under the buttons, the info text, the score text, the player, and the camera to the attributes of this script. Set the size of the Tile array to 25, but do not attach the tiles themselves to the references.
Apply the image start.png to the first tile and finish.png to the last one. Set a number of the other tiles with images of the pumpkin/candy/monsters as you want, and the others as pebbles. Here is an example of a possible result:
Connect the pressed() signal of Button1 to the function action1 in game_master.
Run the program. It should show all the elements we need, but it's not running yet. You should be able to click on the first button and roll the die.
This will be continued in Homework 10.