]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
removed random gen, indoor changes
authorClyne Sullivan <tullivan99@gmail.com>
Sun, 22 Oct 2017 20:45:57 +0000 (16:45 -0400)
committerClyne Sullivan <tullivan99@gmail.com>
Sun, 22 Oct 2017 20:45:57 +0000 (16:45 -0400)
17 files changed:
assets/style/indoors/bg/bg.png [new file with mode: 0644]
assets/style/indoors/bg/bgFarMountain.png [new file with mode: 0644]
assets/style/indoors/bg/bgWoodTile.png [new file with mode: 0644]
assets/style/indoors/bg/carpet.png [new file with mode: 0644]
assets/style/indoors/bg/dirt.png [new file with mode: 0644]
assets/style/indoors/bg/forestTileBack.png [new file with mode: 0644]
assets/style/indoors/bg/forestTileFar.png [new file with mode: 0644]
assets/style/indoors/bg/forestTileFront.png [new file with mode: 0644]
assets/style/indoors/bg/forestTileMid.png [new file with mode: 0644]
assets/style/indoors/bg/grass.png [new file with mode: 0644]
assets/style/indoors/bg/insideWoodHouse.png [new file with mode: 0644]
assets/style/indoors/bg/star.png [new file with mode: 0644]
include/world.hpp
src/systems/light.cpp
src/world.cpp
xml/!town.xml
xml/bobshouse.xml

diff --git a/assets/style/indoors/bg/bg.png b/assets/style/indoors/bg/bg.png
new file mode 100644 (file)
index 0000000..d3ada5d
Binary files /dev/null and b/assets/style/indoors/bg/bg.png differ
diff --git a/assets/style/indoors/bg/bgFarMountain.png b/assets/style/indoors/bg/bgFarMountain.png
new file mode 100644 (file)
index 0000000..f7e2bb9
Binary files /dev/null and b/assets/style/indoors/bg/bgFarMountain.png differ
diff --git a/assets/style/indoors/bg/bgWoodTile.png b/assets/style/indoors/bg/bgWoodTile.png
new file mode 100644 (file)
index 0000000..e10dd1f
Binary files /dev/null and b/assets/style/indoors/bg/bgWoodTile.png differ
diff --git a/assets/style/indoors/bg/carpet.png b/assets/style/indoors/bg/carpet.png
new file mode 100644 (file)
index 0000000..5585096
Binary files /dev/null and b/assets/style/indoors/bg/carpet.png differ
diff --git a/assets/style/indoors/bg/dirt.png b/assets/style/indoors/bg/dirt.png
new file mode 100644 (file)
index 0000000..11252ac
Binary files /dev/null and b/assets/style/indoors/bg/dirt.png differ
diff --git a/assets/style/indoors/bg/forestTileBack.png b/assets/style/indoors/bg/forestTileBack.png
new file mode 100644 (file)
index 0000000..d1c621a
Binary files /dev/null and b/assets/style/indoors/bg/forestTileBack.png differ
diff --git a/assets/style/indoors/bg/forestTileFar.png b/assets/style/indoors/bg/forestTileFar.png
new file mode 100644 (file)
index 0000000..db2fe8b
Binary files /dev/null and b/assets/style/indoors/bg/forestTileFar.png differ
diff --git a/assets/style/indoors/bg/forestTileFront.png b/assets/style/indoors/bg/forestTileFront.png
new file mode 100644 (file)
index 0000000..0dac8e5
Binary files /dev/null and b/assets/style/indoors/bg/forestTileFront.png differ
diff --git a/assets/style/indoors/bg/forestTileMid.png b/assets/style/indoors/bg/forestTileMid.png
new file mode 100644 (file)
index 0000000..24b64f7
Binary files /dev/null and b/assets/style/indoors/bg/forestTileMid.png differ
diff --git a/assets/style/indoors/bg/grass.png b/assets/style/indoors/bg/grass.png
new file mode 100644 (file)
index 0000000..fc49f0b
Binary files /dev/null and b/assets/style/indoors/bg/grass.png differ
diff --git a/assets/style/indoors/bg/insideWoodHouse.png b/assets/style/indoors/bg/insideWoodHouse.png
new file mode 100644 (file)
index 0000000..f926cb2
Binary files /dev/null and b/assets/style/indoors/bg/insideWoodHouse.png differ
diff --git a/assets/style/indoors/bg/star.png b/assets/style/indoors/bg/star.png
new file mode 100644 (file)
index 0000000..6360d30
Binary files /dev/null and b/assets/style/indoors/bg/star.png differ
index 991990e9af047c0a6d3e63bb6e64a3cccdd9e93a..0bfe078e766ed27ea0fee93c2f59647191c9c4b2 100644 (file)
@@ -160,7 +160,6 @@ public:
        static void goWorldPortal(Position& p);
 
        static void generate(LuaScript& script);
-       static void generate(int width = 0);
 
        static bool save(void);
        static void load(const std::string& file);
index 361099d7c1a268be020bc795cfa0a3a5a230d1cc..51a6702049578391782f30a8e4871f2204e30598 100644 (file)
@@ -26,7 +26,7 @@ void LightSystem::render(void) {
        unsigned int offset = 0;
        for (const auto& l : lights) {
                coords[offset] = l.pos.x, coords[offset + 1] = l.pos.y,
-                       coords[offset + 2] = 0, coords[offset + 3] = l.radius;
+                       coords[offset + 2] = -5, coords[offset + 3] = l.radius;
                colors[offset] = l.color.red, colors[offset + 1] = l.color.green,
                        colors[offset + 2] = l.color.blue, colors[offset + 3] = 1.0f;
                offset += 4;
index f55b39de2f6b77c0b05208ad1e62f35142c5f47d..e54a7eca46dd11152e096aad975785bb93d3413f 100644 (file)
@@ -45,15 +45,6 @@ static bool waitToSwap = false;
 // externally referenced in main.cpp
 int worldShade = 0;
 
-// ground-generating constants
-constexpr const float GROUND_HEIGHT_INITIAL =  80.0f;
-constexpr const float GROUND_HEIGHT_MINIMUM =  60.0f;
-constexpr const float GROUND_HEIGHT_MAXIMUM = 110.0f;
-constexpr const float GROUND_HILLINESS      =  10.0f;
-
-// defines grass height in HLINEs
-const unsigned int GRASS_HEIGHT = HLINES(4);
-
 WorldSystem::WorldSystem(void)
 {
        bgmObj = nullptr;
@@ -97,52 +88,6 @@ void WorldSystem::generate(LuaScript& script)
        }
 }
 
-void WorldSystem::generate(int width)
-{
-       float geninc = 0;
-
-       // allocate space for world
-       world.data = std::vector<WorldData> (width + GROUND_HILLINESS);
-
-       // prepare for generation
-       world.data[0].groundHeight = GROUND_HEIGHT_INITIAL;
-       auto wditer = std::begin(world.data) + GROUND_HILLINESS;
-
-       if (world.indoor) {
-               std::fill(world.data.begin(), world.data.end(), WorldData {true, {0, 0}, GROUND_HEIGHT_MINIMUM + 5, 4});
-       } else {
-               // give every GROUND_HILLINESSth entry a groundHeight value
-               for (; wditer < std::end(world.data); wditer += GROUND_HILLINESS)
-                       wditer[-static_cast<int>(GROUND_HILLINESS)].groundHeight = wditer[0].groundHeight + (randGet() % 8 - 4);
-
-               // create slopes from the points that were just defined, populate the rest of the WorldData structure
-               for (wditer = std::begin(world.data) + 1; wditer < std::end(world.data); wditer++) {
-                       auto w = &*(wditer);
-
-                       if (w->groundHeight != 0)
-                               geninc = (w[static_cast<int>(GROUND_HILLINESS)].groundHeight - w->groundHeight) / GROUND_HILLINESS;
-
-                       w->groundHeight = std::clamp(w[-1].groundHeight + geninc, GROUND_HEIGHT_MINIMUM, GROUND_HEIGHT_MAXIMUM);
-                       w->groundColor    = randGet() % 32 / 8;
-                       w->grassUnpressed = true;
-                       w->grassHeight[0] = (randGet() % 16) / 3 + HLINES(2);
-                       w->grassHeight[1] = (randGet() % 16) / 3 + HLINES(2);
-               }
-       }
-
-       // define x-coordinate of world's leftmost 'line'
-       world.startX = HLINES(width * -0.5);
-
-       // gen. star coordinates
-       if (stars.empty()) {
-               stars.resize(game::SCREEN_WIDTH / 30);
-               for (auto& s : stars) {
-                       s.x = world.startX + (randGet() % (int)HLINES(width));
-                       s.y = game::SCREEN_HEIGHT - (randGet() % (int)HLINES(game::SCREEN_HEIGHT / 1.3f));
-               }
-       }
-}
-
 float WorldSystem::isAboveGround(const vec2& p) 
 {
        const auto& gh = world.data[getLineIndex(p.x)].groundHeight;
@@ -307,14 +252,9 @@ void WorldSystem::loader(void)
                }
 
                // world generation
-                else if (tagName == "generation") {
-                       auto text = wxml->GetText();
-                       if (text == nullptr)
-                               generate(wxml->IntAttribute("width"));
-                       else {
-                               LuaScript script (text);
-                               generate(script);
-                       }
+               else if (tagName == "generation") {
+                       LuaScript script (wxml->GetText());
+                       generate(script);
                }
 
                // indoor stuff
@@ -591,7 +531,7 @@ void WorldSystem::render(void)
 
                for (int j = 0; j < count; j++) {
                        GLfloat five[5] = {
-                               0, 0, mountainDim.x * j + xcoord, GROUND_HEIGHT_MINIMUM, z
+                               0, 0, mountainDim.x * j + xcoord, 0, z
                        };
 
                        push5(bgItemsFront, five);
@@ -619,12 +559,12 @@ void WorldSystem::render(void)
                world.indoorTex.use();
                auto dim = world.indoorTex.getDim() * game::HLINE;
                GLfloat verts[] = {
-                       world.startX,         GROUND_HEIGHT_MINIMUM,         z, 0, 0,
-                       world.startX + dim.x, GROUND_HEIGHT_MINIMUM,         z, 1, 0,
-                       world.startX + dim.x, GROUND_HEIGHT_MINIMUM + dim.y, z, 1, 1,
-                       world.startX + dim.x, GROUND_HEIGHT_MINIMUM + dim.y, z, 1, 1,
-                       world.startX,         GROUND_HEIGHT_MINIMUM + dim.y, z, 0, 1,
-                       world.startX,         GROUND_HEIGHT_MINIMUM,         z, 0, 0,
+                       world.startX,         0,         z, 0, 0,
+                       world.startX + dim.x, 0,         z, 1, 0,
+                       world.startX + dim.x, dim.y, z, 1, 1,
+                       world.startX + dim.x, dim.y, z, 1, 1,
+                       world.startX,         dim.y, z, 0, 1,
+                       world.startX,         0,         z, 0, 0,
                };
 
                glVertexAttribPointer(Render::worldShader.coord, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), verts);
@@ -640,10 +580,10 @@ void WorldSystem::render(void)
        pOffset = (offset.x - world.startX) / game::HLINE;
 
        // only draw world within player vision
-       iStart = std::clamp(static_cast<int>(pOffset - (SCREEN_WIDTH / 2 / game::HLINE) - GROUND_HILLINESS),
+       iStart = std::clamp(static_cast<int>(pOffset - (SCREEN_WIDTH / 2 / game::HLINE)),
                            0, static_cast<int>(world.data.size()));
        iEnd = std::clamp(static_cast<int>(pOffset + (SCREEN_WIDTH / 2 / game::HLINE) + 2),
-                      0, static_cast<int>(world.data.size() - GROUND_HILLINESS));
+                      0, static_cast<int>(world.data.size()));
 
        // draw the dirt
        waitToSwap = true;
@@ -659,16 +599,9 @@ void WorldSystem::render(void)
 
        GLfloat *dirtp = &dirt[0];
        for (int i = iStart; i < iEnd; i++) {
-               if (world.data[i].groundHeight <= 0) { // TODO holes (andy)
-                       world.data[i].groundHeight = GROUND_HEIGHT_MINIMUM - 1;
-                       //glColor4ub(0, 0, 0, 255);
-               } else {
-                       //safeSetColorA(150, 150, 150, 255);
-               }
-
                int ty = world.data[i].groundHeight / 64 + world.data[i].groundColor;
                GLfloat five[5] = {
-                       0, 0, world.startX + HLINES(i), world.data[i].groundHeight - GRASS_HEIGHT, z - 0.1f
+                       0, 0, world.startX + HLINES(i), world.data[i].groundHeight, z - 0.1f
                };
 
                push5(dirtp, five);
@@ -679,11 +612,8 @@ void WorldSystem::render(void)
                push5(dirtp, five);
                five[0]--, five[2] -= game::HLINE;
                push5(dirtp, five);
-               five[1] = 0, five[3] = world.data[i].groundHeight - GRASS_HEIGHT;
+               five[1] = 0, five[3] = world.data[i].groundHeight;
                push5(dirtp, five);
-
-               if (world.data[i].groundHeight == GROUND_HEIGHT_MINIMUM - 1)
-                       world.data[i].groundHeight = 0;
        }
 
        glUniform1f(Render::worldShader.uniform[WU_light_impact], 0.45f);
@@ -695,115 +625,105 @@ void WorldSystem::render(void)
        Render::worldShader.disable();
        Render::worldShader.unuse();
 
-       if (!world.indoor) {
-               bgTex++;
-               //safeSetColorA(255, 255, 255, 255); TODO
+       bgTex++;
 
-               static std::vector<GLfloat> grass;
-               if (grass.size() != world.data.size() * 60) {
-                       grass.clear();
-                       grass.resize(world.data.size() * 60);
-               }
+       static std::vector<GLfloat> grass;
+       if (grass.size() != world.data.size() * 60) {
+               grass.clear();
+               grass.resize(world.data.size() * 60);
+       }
 
-               GLfloat *grassp = &grass[0];
-               for (int i = iStart; i < iEnd; i++) {
-                       auto wd = world.data[i];
-                       auto gh = wd.grassHeight;
+       GLfloat *grassp = &grass[0];
+       for (int i = iStart; i < iEnd; i++) {
+               auto wd = world.data[i];
+               auto gh = wd.grassHeight;
 
-                       // flatten the grass if the player is standing on it.
-                       if (!wd.grassUnpressed) {
-                               gh[0] /= 4;
-                               gh[1] /= 4;
-                       }
+               // flatten the grass if the player is standing on it.
+               if (!world.indoor && !wd.grassUnpressed) {
+                       gh[0] /= 4;
+                       gh[1] /= 4;
+               }
 
-                       // actually draw the grass.
-                       if (wd.groundHeight) {
-                               float five[5] = {
-                                       0, 1, world.startX + HLINES(i), wd.groundHeight + gh[0], z - 0.2f
-                               };
-
-                               push5(grassp, five);
-                               five[0]++, five[1]--, five[2] += HLINES(0.5f);
-                               push5(grassp, five);
-                               five[1]++, five[3] = wd.groundHeight - GRASS_HEIGHT;
-                               push5(grassp, five);
-                               push5(grassp, five);
-                               five[0]--, five[2] -= HLINES(0.5f);
-                               push5(grassp, five);
-                               five[1]--, five[3] = wd.groundHeight + gh[0];
-                               push5(grassp, five);
-                               five[1]++;
-
-                               five[2] = world.startX + HLINES(i + 0.5), five[3] = wd.groundHeight + gh[1];
-
-                               push5(grassp, five);
-                               five[0]++, five[1]--, five[2] += HLINES(0.5f) + 1;
-                               push5(grassp, five);
-                               five[1]++, five[3] = wd.groundHeight - GRASS_HEIGHT;
-                               push5(grassp, five);
-                               push5(grassp, five);
-                               five[0]--, five[2] -= HLINES(0.5f) + 1;
-                               push5(grassp, five);
-                               five[1]--, five[3] = wd.groundHeight + gh[1];
-                               push5(grassp, five);
-                       }
+               // actually draw the grass.
+               if (wd.groundHeight) {
+                       float five[5] = {
+                               0, 1, world.startX + HLINES(i), wd.groundHeight + gh[0], z - 0.2f
+                       };
+
+                       push5(grassp, five);
+                       five[0]++, five[1]--, five[2] += HLINES(0.5f);
+                       push5(grassp, five);
+                       five[1]++, five[3] = wd.groundHeight;
+                       push5(grassp, five);
+                       push5(grassp, five);
+                       five[0]--, five[2] -= HLINES(0.5f);
+                       push5(grassp, five);
+                       five[1]--, five[3] = wd.groundHeight + gh[0];
+                       push5(grassp, five);
+                       five[1]++;
+
+                       five[2] = world.startX + HLINES(i + 0.5), five[3] = wd.groundHeight + gh[1];
+
+                       push5(grassp, five);
+                       five[0]++, five[1]--, five[2] += HLINES(0.5f) + 1;
+                       push5(grassp, five);
+                       five[1]++, five[3] = wd.groundHeight;
+                       push5(grassp, five);
+                       push5(grassp, five);
+                       five[0]--, five[2] -= HLINES(0.5f) + 1;
+                       push5(grassp, five);
+                       five[1]--, five[3] = wd.groundHeight + gh[1];
+                       push5(grassp, five);
                }
+       }
 
-               Render::worldShader.use();
-               glUniform1f(Render::worldShader.uniform[WU_light_impact], 1.0f);
+       Render::worldShader.use();
+       glUniform1f(Render::worldShader.uniform[WU_light_impact], 1.0f);
 
-               Render::worldShader.enable();
+       Render::worldShader.enable();
 
-               glVertexAttribPointer(Render::worldShader.coord, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), &grass[2]);
-               glVertexAttribPointer(Render::worldShader.tex, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), &grass[0]);
-               glDrawArrays(GL_TRIANGLES, 0 , grass.size() / 5);
+       glVertexAttribPointer(Render::worldShader.coord, 3, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), &grass[2]);
+       glVertexAttribPointer(Render::worldShader.tex, 2, GL_FLOAT, GL_FALSE, 5 * sizeof(GLfloat), &grass[0]);
+       glDrawArrays(GL_TRIANGLES, 0 , grass.size() / 5);
 
-               // the starting pixel of the world
-               static const float s = -(static_cast<float>(SCREEN_WIDTH) / 2.0f);
-               // the ending pixel of the world
-               static const float e = static_cast<float>(SCREEN_WIDTH) / 2.0f;
-               static const float sheight = static_cast<float>(SCREEN_HEIGHT);
+       // the starting pixel of the world
+       static const float s = -(static_cast<float>(SCREEN_WIDTH) / 2.0f);
+       // the ending pixel of the world
+       static const float e = static_cast<float>(SCREEN_WIDTH) / 2.0f;
+       static const float sheight = static_cast<float>(SCREEN_HEIGHT);
                        
-               auto yOffset = offset.y - static_cast<float>(SCREEN_HEIGHT) / 2.0f;
-               GLfloat blackBar[] = {
-                       s,            yOffset,           z - 0.3f, 0.0f, 0.0f,
-                       world.startX, yOffset,           z - 0.3f, 1.0f, 0.0f,
-                       world.startX, yOffset + sheight, z - 0.3f, 1.0f, 1.0f,
-                       world.startX, yOffset + sheight, z - 0.3f, 1.0f, 1.0f,
-                       s,            yOffset + sheight, z - 0.3f, 0.0f, 1.0f,
-                       s,            yOffset,           z - 0.3f, 0.0f, 0.0f
-               };
+       auto yOffset = offset.y - static_cast<float>(SCREEN_HEIGHT) / 2.0f;
+       GLfloat blackBar[] = {
+               s,            yOffset,           z - 0.3f, 0.0f, 0.0f,
+               world.startX, yOffset,           z - 0.3f, 1.0f, 0.0f,
+               world.startX, yOffset + sheight, z - 0.3f, 1.0f, 1.0f,
+               world.startX, yOffset + sheight, z - 0.3f, 1.0f, 1.0f,
+               s,            yOffset + sheight, z - 0.3f, 0.0f, 1.0f,
+               s,            yOffset,           z - 0.3f, 0.0f, 0.0f
+       };
 
-               if (offset.x + world.startX > s) {
-                       Colors::black.use();
-                       glUniform1f(Render::worldShader.uniform[WU_light_impact], 0.0f);
-                       glVertexAttribPointer(Render::worldShader.coord, 3, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 5, blackBar);
-                       glVertexAttribPointer(Render::worldShader.tex, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 5, blackBar + 3);
-                       glDrawArrays(GL_TRIANGLES, 0, 6);
-               }
+       if (offset.x + world.startX > s) {
+               Colors::black.use();
+               glUniform1f(Render::worldShader.uniform[WU_light_impact], 0.0f);
+               glVertexAttribPointer(Render::worldShader.coord, 3, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 5, blackBar);
+               glVertexAttribPointer(Render::worldShader.tex, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 5, blackBar + 3);
+               glDrawArrays(GL_TRIANGLES, 0, 6);
+       }
 
-               if (offset.x - world.startX < e) {
-                       blackBar[0] = blackBar[20] = blackBar[25] = -world.startX;
-                       blackBar[5] = blackBar[10] = blackBar[15] = e;
+       if (offset.x - world.startX < e) {
+               blackBar[0] = blackBar[20] = blackBar[25] = -world.startX;
+               blackBar[5] = blackBar[10] = blackBar[15] = e;
 
-                       Colors::black.use();
-                       glUniform1f(Render::worldShader.uniform[WU_light_impact], 0.0f);
-                       glVertexAttribPointer(Render::worldShader.coord, 3, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 5, blackBar);
-                       glVertexAttribPointer(Render::worldShader.tex, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 5, blackBar + 3);
-                       glDrawArrays(GL_TRIANGLES, 0, 6);
-               }
-
-               Render::worldShader.disable();
-               Render::worldShader.unuse();
-       } else {
-               Render::useShader(&Render::worldShader);
-               Render::worldShader.use();
-               Colors::red.use();
-               vec2 ll = vec2 {world.startX, GROUND_HEIGHT_MINIMUM};
-               Render::drawRect(ll, ll + vec2(world.indoorTex.getDim().x, 4), z - 1);
-               Render::worldShader.unuse();
+               Colors::black.use();
+               glUniform1f(Render::worldShader.uniform[WU_light_impact], 0.0f);
+               glVertexAttribPointer(Render::worldShader.coord, 3, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 5, blackBar);
+               glVertexAttribPointer(Render::worldShader.tex, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 5, blackBar + 3);
+               glDrawArrays(GL_TRIANGLES, 0, 6);
        }
 
+       Render::worldShader.disable();
+       Render::worldShader.unuse();
+
        waitToSwap = false;
 }
 
index 26a62a10c95e4d3a8d0263da491c9561915fbb3d..b2d96a54c92878bf346cf99d24c2afa533509b2d 100644 (file)
                x = 0
 
                ground = function()
-                       if (x == 330) then
+                       if (x == 320) then
                                height = -1
                        else
-                               if (x &lt; 10) then
-                                       height = 800
-                               else
-                                       if (x &lt; 30) then
-                                               height = -100 * math.tan(0.08 * (x - 10) + 1.77) + 75
-                                       else
-                                               height = 60
-                                       end
-                               end
+                               height = 1 / math.pow(2, (x - 50) / 2) + 60 
                        end
                        x = x + 1
                end
index d7c81725eb3ec23bbf21a1582c2c4cd6f22af3ba..9160ef06d46a3699cd5fe6776c772402a83efac2 100644 (file)
@@ -2,7 +2,7 @@
 <include file="entities.xml"/>
 
 <IndoorWorld>
-       <style bgm="assets/music/theme_jazz.wav" folder="assets/style/classic/">
+       <style bgm="assets/music/theme_jazz.wav" folder="assets/style/indoors/">
                <layer path="bg/bg.png"/>
                <layer path="bg/bgFarMountain.png"/>
                <layer path="bg/forestTileFar.png"/>
                <layer path="bg/forestTileMid.png"/>
                <layer path="bg/forestTileFront.png"/>
                <layer path="bg/dirt.png"/>
-               <layer path="bg/grass.png"/>
+               <layer path="bg/carpet.png"/>
        </style>
        <house width="800" texture="assets/style/classic/bg/insideWoodHouse.png"/>
-       <generation width="320"/>
+       <generation>
+               x = 0
+
+               ground = function()
+                       if (x == 320) then
+                               height = -1
+                       else
+                               height = 60
+                       end
+
+                       x = x + 1
+               end
+
+               grass = function()
+                       height = 2
+               end
+       </generation>
        <time>6000</time>
        <!--<link outside="town.xml"/>-->
        <npc name="Bob" hasDialog="true" spawnx="30"/>