summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-04-06 21:04:38 +0200
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2018-04-06 21:04:38 +0200
commit8e27138b1769c85f01f0c27b4e6948b154efdb8e (patch)
treeabb971534ae23c0309684965222eb2dba32a1635
parentd1ed2617d61e0701fc473ff97e09842ca45a7fe5 (diff)
Makes more of a mess for the 'noise' function.
-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
)
)
)