From b64aa31b4dc0c5e050c4978bae7bd43a040a368b Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sat, 21 Oct 2017 19:56:48 -0400 Subject: lua scriptable world gen --- xml/!town.xml | 25 ++++++++++++++++++++++++- xml/wavy.xml | 28 ++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 xml/wavy.xml (limited to 'xml') diff --git a/xml/!town.xml b/xml/!town.xml index 29673b0..26a62a1 100644 --- a/xml/!town.xml +++ b/xml/!town.xml @@ -12,7 +12,30 @@ - + + x = 0 + + ground = function() + if (x == 330) then + height = -1 + else + if (x < 10) then + height = 800 + else + if (x < 30) then + height = -100 * math.tan(0.08 * (x - 10) + 1.77) + 75 + else + height = 60 + end + end + end + x = x + 1 + end + + grass = function() + height = math.random(2, 7) + end + Sunny -300 diff --git a/xml/wavy.xml b/xml/wavy.xml new file mode 100644 index 0000000..3f0c187 --- /dev/null +++ b/xml/wavy.xml @@ -0,0 +1,28 @@ + + + + + + x = 0 + ground = function() + if (x == 600) then + height = -1 + else + height = math.sin(x * 3.14 / 90) * 50 + 60 + end + x = x + 1 + end + + grass = function() + height = math.random(2, 4) + end + + Rainy + + + -- cgit v1.2.3