-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CS code missing for adding music #8003
Labels
area:getting started
Issues and PRs related to the Getting Started section of the documentation
bug
topic:dotnet
Comments
jynus
added a commit
to jynus/godot-docs
that referenced
this issue
Sep 23, 2023
The last step in "Your first 2D game" (Finishing up) lacks code or directions in general for C#. Add a short snipet that can be used for reference and for copy and paste. Fixes godotengine#8003
You are completely right, that last part is very rough. I suggested the following addition - let me know if that works for you: public void GameOver()
{
...
GetNode<AudioStreamPlayer>("Music").Stop();
GetNode<AudioStreamPlayer>("DeathSound").Play();
}
public void NewGame()
{
...
GetNode<AudioStreamPlayer>("Music").Play();
} This is taken almost literally from the tutorial demo at: GDScript C# |
jynus
added a commit
to jynus/godot-docs
that referenced
this issue
Sep 23, 2023
The last step in "Your first 2D game" (Finishing up) lacks code or directions in general for C#. Add a short snipet that can be used for reference and for copy and paste. Fixes godotengine#8003
raulsntos
added
topic:dotnet
area:getting started
Issues and PRs related to the Getting Started section of the documentation
labels
Sep 23, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area:getting started
Issues and PRs related to the Getting Started section of the documentation
bug
topic:dotnet
Your Godot version:
4.1.1
Issue description:
The tutorial is overall very beginner friendly, but on the last bit it uses $Music.play() and while I've been trying to compare the GDScript to C# to try to understand how to translate it into C# I'm not quite proficient enough in both to do that yet. (My goal with this was to get practice using C#).
URL to the documentation page:
https://docs.godotengine.org/en/stable/getting_started/first_2d_game/07.finishing-up.html
If you know how to fix the issue you are reporting please
consider opening a pull request. We provide a tutorial on
using git here: https://docs.godotengine.org/en/stable/community/contributing/pr_workflow.html,
writing documentation at https://docs.godotengine.org/en/stable/community/contributing/docs_writing_guidelines.html
and contributing to the class reference here: https://docs.godotengine.org/en/stable/community/contributing/updating_the_class_reference.html
The text was updated successfully, but these errors were encountered: