Skip to content
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

Add C# code examples to random_number_generation.rst #4098

Closed
NathanLovato opened this issue Sep 30, 2020 · 4 comments
Closed

Add C# code examples to random_number_generation.rst #4098

NathanLovato opened this issue Sep 30, 2020 · 4 comments
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement topic:dotnet

Comments

@NathanLovato
Copy link
Contributor

We have a freshly-merged page about RNG: #4024

It has GDScript code examples but lacks C# equivalent. If someone would like to translate the examples to C#, it'd be a nice addition.

@graphnode
Copy link

I'm guessing Your first game tutorial should be updated too?

Since I just started: Are we supposed to use RandomNumberGenerator or the Godot.GD?

@Calinou
Copy link
Member

Calinou commented Oct 19, 2020

Since I just started: Are we supposed to use RandomNumberGenerator or the Godot.GD?

Global-scope random functions require less boilerplate to use, but give you less control over randomization since they use a "global" random seed. See Random number generation for more information.

That said, for consistency with the GDScript code samples, use the same class as is used in GDScript. That means you should use Godot.GD in most code samples.

@skyace65 skyace65 added the area:manual Issues and PRs related to the Manual/Tutorials section of the documentation label Dec 31, 2022
@raulsntos
Copy link
Member

This seems to have been at least partially implemented by #5249, there are still a few examples that remain GDScript only and the page may have gotten outdated for both GDScript and C# by now (e.g.: it still seems to recommend to use randomize() but that's no longer necessary).

@tetrapod00
Copy link
Contributor

This seems fully resolved, after #9822, #10283, and #8072.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement topic:dotnet
Projects
None yet
Development

No branches or pull requests

6 participants