Interactive practices are hands-on coding exercises that help you apply what you've learned in the lessons. They're an important part of your learning journey as they allow you to reinforce concepts you've just learned in a lesson.This guide explains how to access and complete practices throughout your courses. We'll cover:
What practices are
How to access practices
How to run a practice
How to use the practice interface
Tips for success
What are the interactive practices?
Practices are small, focused coding exercises included in a number of lessons and that are auto-tested by Godot using GDPractice, a code practice system we've made for you. These interactive practices typically ask you to:
Apply techniques you just learned
Solve specific problems with code
Meet specific code requirements
Early in the curriculum, practices are often simple and closely match the lessons. As you progress, they start to step away from the lessons a bit more, training you to transfer what you've learned to a new context.
Each practice has a unique identifier (like L2.P1, meaning "Lesson 2, Practice 1") to help you locate them in the course and in Godot. This identifier is displayed in lessons, in the GDQuest dock in Godot, and in the practice interface when running the practice.
Accessing practices in Godot
Practice files are directly included in the workbook project of a course module. You can find them in the GDQuest dock, which, by default, is located on the right side of the Godot editor. To access it:
Look at the docks at the right of the Godot editor, Inspector and Node
If you see the GDQuest dock, click on it to open it. Otherwise, click the Scroll right button at the right of the docks to reveal the GDQuest dock
NOTE:
After opening the GDQuest dock, you can reposition it by clicking the three vertical dots at the top-right of the dock and selecting your preferred location.
To open a practice, click on its name in the GDQuest dock. This will open the practice scene and script in the editor and reveal a RUN button in the dock.
Once you've opened a practice scene in Godot, it's time to edit the files and run the practice. You can edit the scene and script files as you would any other Godot project. Then, to run the practice, click the RUN button below the practice in the GDQuest dock.This will run the practice scene and automatically test your code against the requirements. It also displays the practice interface in the game window.
When you run a practice, a sliding panel appears in the game window on the left. This interface lists the requirements you need to meet and gives feedback on your progress. It also gives contextual messages to help you understand what you need to do to complete individual requirements.
The running practice is split into three main sections horizontally:
The info panel: This foldable panel docked to the left shows the practice name, status, and a list of messages. You can fold it to hide it and free up space in the game window.
The practice scene: Directly to the right of the info panel, you can see your practice scene. This is where you can see your code in action and test it.
The reference scene: The slightly greyed out scene on the right of the window is a reference copy of the completed practice. It shows you how the practice should look and play when completed. You can use it as a reference to compare your work with the expected result.
The info panel
In the info panel, the most important part is the list of requirements and messages. They can take three colors:
Red indicates that a requirement is not met. Below the red label, you can find a contextual message explaining why the requirement is not met. This message can help you understand what you need to do to complete the requirement.
Green means that a requirement is met. When you pass a requirement, you'll only see the green label and a checkmark.
If a requirement is gray, it means that it's not running because another requirement it depends on is not met. Usually, this means that we cannot test a specific part of your code because another part is not working yet. Complete the red requirements first, and the grey ones will activate.
Take these feedback messages as pointers. They are not error messages, but rather hints to guide you in the right direction and help you understand what you need to do.When testing practices, we cannot always pinpoint exactly what's missing. So we give you the best hints we can to help you understand what you need to do. Sometimes you'll still have to do some digging to find the exact root cause of the issue. This is normal and an integral part of programming.
Nathan
Founder and teacher at GDQuest
At the top of the dock is the status of the practice. GDPractice, the system that runs the practices, can simulate a player actually playing the game. When this happens, you should not make inputs as this can interfere with the simulation. The interface will tell you when the simulation is running and when it is not with a warning sign. It also shows any inputs currently being simulated.Once you pass all the requirements, the GDQuest dock will update with a checkmark icon to indicate that the practice is complete. You can then head back to the website to review and check off every task you completed.
Tips for success
Here are some tips to help you complete practices successfully:
Refer back to the lesson: The techniques you need are usually covered in the current lesson
Test frequently: Run your code often to see which checks pass and which fail
Use the hints: Each practice comes with a series of hints to guide you without giving away the solution. Don't hesitate to use them if you're stuck
Be patient: If something doesn't work, carefully check your code and scenes for errors or missing elements. Not everything is a code issue!
Take breaks: If you're feeling frustrated, take a break and come back later with fresh eyes. Sometimes, stepping away for a bit can help you see the solution more clearly
Ask for help: If you're really stuck, don't hesitate to ask for help in the community. Be sure to include the full practice code you wrote and screenshots of your scene setup. People will need all that context to be able to help you
Remember, making mistakes and getting stuck is a natural part of learning to code! When you encounter challenges, take your time to understand what's happening, try to wrap your head around errors and feedback messages, and take your time. The more you practice, the better you'll become at solving problems and writing code.