From 8e27138b1769c85f01f0c27b4e6948b154efdb8e Mon Sep 17 00:00:00 2001 From: Nathanael Sensfelder Date: Fri, 6 Apr 2018 21:04:38 +0200 Subject: Makes more of a mess for the 'noise' function. --- src/battlemap/src/View/Battlemap/Tile.elm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/battlemap/src/View/Battlemap/Tile.elm b/src/battlemap/src/View/Battlemap/Tile.elm index 3286394..fb91731 100644 --- a/src/battlemap/src/View/Battlemap/Tile.elm +++ b/src/battlemap/src/View/Battlemap/Tile.elm @@ -16,6 +16,9 @@ import Struct.Tile -------------------------------------------------------------------------------- -- LOCAL ----------------------------------------------------------------------- -------------------------------------------------------------------------------- +noise_function : Int -> Int -> Int -> Int +noise_function a b c = + (round (pi * (radians (toFloat a)) * (radians (toFloat b)) * (toFloat c))) -------------------------------------------------------------------------------- -- EXPORTED -------------------------------------------------------------------- @@ -39,9 +42,13 @@ get_html tile = (toString -- I don't like how Elm does random, let's get some noisy -- function instead. - (rem - ((-1 * (tile_loc.x + tile_loc.y))^2) - 9 + ( + (noise_function + tile_loc.x + tile_loc.y + (Struct.Tile.get_cost tile) + ) + % 9 ) ) ) -- cgit v1.2.3-70-g09d2