summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/battlemap/src/View/Battlemap/Tile.elm13
1 files 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
)
)
)