summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/assets.cpp6
-rw-r--r--src/game/game.cpp2
-rw-r--r--src/game/game.hpp6
-rw-r--r--src/game/units.cpp4
-rw-r--r--src/game/worldgen.cpp4
5 files changed, 13 insertions, 9 deletions
diff --git a/src/game/assets.cpp b/src/game/assets.cpp
index 1b57800..2f913ba 100644
--- a/src/game/assets.cpp
+++ b/src/game/assets.cpp
@@ -23,9 +23,11 @@ void load(void)
fx.blood.load("assets/units/blood_", 4);
world::register_tile(TILE_DIRT, 0);
- world::register_tile(TILE_WALL, CF_SOLID);
render::register_tile(TILE_DIRT, "assets/tiles/dirt.png");
- render::register_tile(TILE_WALL, "assets/tiles/wall.png");
+ world::register_tile(TILE_STONE, CF_SOLID);
+ render::register_tile(TILE_STONE, "assets/tiles/stone.png");
+ world::register_tile(TILE_WATER, CF_WATER);
+ render::register_tile(TILE_WATER, "assets/tiles/water.png");
}
} // namespace game::assets
diff --git a/src/game/game.cpp b/src/game/game.cpp
index 285f75d..3005bd5 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -75,7 +75,7 @@ void state_t::command(v2f_t x)
if (unit->dead)
continue;
- if (!unit->start_moving(snap, CF_SOLID))
+ if (!unit->start_moving(snap, CF_SOLID | CF_WATER))
unit->say(text::get(text::SAY_NO_PATH));
else
unit->say(text::get(text::SAY_MOVING));
diff --git a/src/game/game.hpp b/src/game/game.hpp
index fce113d..58892ff 100644
--- a/src/game/game.hpp
+++ b/src/game/game.hpp
@@ -9,14 +9,16 @@ namespace game {
enum {
TILE_NONE,
TILE_DIRT,
- TILE_WALL
+ TILE_STONE,
+ TILE_WATER
};
enum {
CF_BACKGROUND = 1,
CF_SOLID = 2,
CF_BODY = 4,
- CF_BODY_SMALL = 8
+ CF_BODY_SMALL = 8,
+ CF_WATER = 16
};
extern size_t selection_cookie;
diff --git a/src/game/units.cpp b/src/game/units.cpp
index bbba372..73e1cf0 100644
--- a/src/game/units.cpp
+++ b/src/game/units.cpp
@@ -382,7 +382,7 @@ alien_t::alien_t(game::state_t *game) : unit_t(game, UNIT_ALIEN)
void alien_t::wake(unit_t *by_whom)
{
- start_moving(by_whom->x, CF_SOLID);
+ start_moving(by_whom->x, CF_SOLID | CF_WATER);
next_targetting = game->now + 0.2;
}
@@ -415,7 +415,7 @@ void alien_t::think(void)
}
}
- start_moving(target->x, CF_SOLID);
+ start_moving(target->x, CF_SOLID | CF_WATER);
}
next_targetting = game->now + 0.2;
diff --git a/src/game/worldgen.cpp b/src/game/worldgen.cpp
index 573d03b..62c8a5e 100644
--- a/src/game/worldgen.cpp
+++ b/src/game/worldgen.cpp
@@ -17,11 +17,11 @@ void worldgen(world::tile_t *tile, world::tile_index_t x,
perlin->get(x, 1.0f) * 0.05f;
if (height < waterlevel)
- tile->type = TILE_WALL;
+ tile->type = TILE_WATER;
else if (height < waterlevel + 0.1)
tile->type = TILE_DIRT;
else if (perlin->get(x, 3.0f) > 0.0f)
- tile->type = TILE_WALL;
+ tile->type = TILE_STONE;
else
tile->type = TILE_DIRT;
}