Skip to content

Commit

Permalink
Tweaked random function and added preview
Browse files Browse the repository at this point in the history
  • Loading branch information
pomettini committed Feb 2, 2024
1 parent bc804e3 commit 7b62c5f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Starfield\*

![Game preview](preview.gif)

Basically a port of the [Daniel Shiffman's Starfield p5.js sketch](https://thecodingtrain.com/challenges/1-starfield) for the [Playdate](https://play.date/)

Just turn the crank forward to accelerate. Have fun!
Expand Down
Binary file added preview.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const fn map(value: f32, start1: f32, stop1: f32, start2: f32, stop2: f32) -> f3

#[inline(always)]
const fn random(value: u32, min: f32, max: f32) -> f32 {
let fvalue = value as f32 / 100000.0;
let fvalue = value as f32 / 1000.0;
fvalue % (max - min) + min
}

Expand Down

0 comments on commit 7b62c5f

Please sign in to comment.