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

bunnymark example - add color to the bunnies #480

Open
mvoltz opened this issue Jan 3, 2025 · 4 comments
Open

bunnymark example - add color to the bunnies #480

mvoltz opened this issue Jan 3, 2025 · 4 comments

Comments

@mvoltz
Copy link

mvoltz commented Jan 3, 2025

I noticed all the bunnies are gray. Two small changes add random colors and alpha to each bunny. (at least it works in linux :)

if rl.IsMouseButtonDown(rl.MouseLeftButton) {
                ...
                b.Speed.Y = float32(rl.GetRandomValue(-250, 250)-500) / 60.0
		b.Color.R = uint8(rl.GetRandomValue(50, 240))
		b.Color.G = uint8(rl.GetRandomValue(80, 240))
		b.Color.B = uint8(rl.GetRandomValue(100, 240))
		b.Color.A = uint8(rl.GetRandomValue(100, 255))
               ...
	}
}
...
for _, b := range bunnies {
        ...
	rl.DrawTexture(texture, int32(b.Position.X), int32(b.Position.Y), b.Color)
@JupiterRider
Copy link
Contributor

If you want, you can create a pull request to update the example :)

@mvoltz
Copy link
Author

mvoltz commented Jan 5, 2025 via email

@gen2brain
Copy link
Owner

Will that affect benchmark in any way, and how is it handled in other bindings? I recently saw a bindings benchmark, so it would be nice if they are all similar enough.

@mvoltz
Copy link
Author

mvoltz commented Jan 10, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants