generated from tipragot/rust
Add a rendering system using temporary images #61
|
@ -27,7 +27,7 @@ struct TilesGap(Vec2);
|
|||
struct TilesSize(Vec2);
|
||||
|
||||
impl Tile {
|
||||
/// Returns the texture handle of the tile.
|
||||
/// Returns the handle of the image of the tile.
|
||||
fn get_texture(&self, asset_server: &AssetServer) -> Handle<Image> {
|
||||
match self {
|
||||
Self::Grass => asset_server.load("tiles/grass.png"),
|
||||
|
@ -95,7 +95,7 @@ fn render_map(
|
|||
}
|
||||
}
|
||||
|
||||
/// A simple sigmoid function to convert from y to z position.
|
||||
/// A simple sigmoid function to convert y position to z position.
|
||||
/// The return value is between 0 and 1.
|
||||
fn z_position_from_y(y: f32) -> f32 {
|
||||
-1.0 / (1.0 + (-y * 110_f64.powi(-5) as f32).exp())
|
||||
|
|
Loading…
Reference in a new issue