Permalink
Browse files

* Funktion und Aussehen von Kartenfeldern getrennt, mehr Grafiken (L…

…ava, Schnee)

 * Neue Level Funktionen
 * Kaputtgemachtes set_target von letztem Commit gefixt.


git-svn-id: http://infon.googlecode.com/svn/trunk@122 8171fb75-e542-0410-96e4-03d5dd800671
  • Loading branch information...
1 parent 2eb7629 commit a9eed7e6e694b6bb18c6a21df59c886813d99229 @dividuum committed Dec 9, 2006
Showing with 842 additions and 611 deletions.
  1. +5 −1 Makefile
  2. +1 −1 client.rb
  3. +19 −14 client_world.c
  4. +2 −1 client_world.h
  5. +20 −3 common_world.h
  6. +46 −28 creature.c
  7. +3 −3 creature.h
  8. +6 −4 demo2graph.rb
  9. +5 −5 game.c
  10. BIN gfx/theme-snow.png
  11. BIN gfx/theme.png
  12. +1 −1 gl_gui.c
  13. +1 −1 global.h
  14. +68 −10 infond.lua
  15. +340 −336 level/cn.lua
  16. +22 −21 level/foo.lua
  17. +2 −0 level/gpn.lua
  18. +2 −1 level/owl.lua
  19. +2 −0 level/water.lua
  20. +2 −0 map.c
  21. +5 −0 misc.h
  22. +3 −3 player-highlevel.lua
  23. +39 −31 player.c
  24. +20 −19 player.lua
  25. +10 −10 rules/default.lua
  26. +39 −19 sdl_gui.c
  27. +23 −0 sdl_sprite.c
  28. +39 −23 sdl_sprite.h
  29. +13 −18 server.lua
  30. +103 −56 world.c
  31. +1 −2 world.h
View
6 Makefile
@@ -37,7 +37,11 @@ ifdef WINDOWS
else
SDLDIR := $(shell sdl-config --prefix)
CFLAGS += $(COMMON_CFLAGS)
- LUAPLAT = debug #linux
+ifdef OPTIMIZE
+ LUAPLAT = linux
+else
+ LUAPLAT = debug
+endif
LDFLAGS += -ldl
endif
View
2 client.rb
@@ -77,7 +77,7 @@ def readXX(len)
print "score=%d " % (socket.read16 - 500) if mask & 16 != 0
puts
when 1:
- puts "%d, %d => %d (%d) " % [socket.read8, socket.read8, socket.read8, socket.read8]
+ puts "%d, %d => %d " % [socket.read8, socket.read8, socket.read8]
when 2:
puts "msg: %s " % socket.readXX(len)
when 3:
View
33 client_world.c
@@ -60,18 +60,22 @@ void client_world_from_network(packet_t *packet) {
if (!packet_read08(packet, &y)) PROTOCOL_ERROR();
if (x >= info.width) PROTOCOL_ERROR();
if (y >= info.height) PROTOCOL_ERROR();
- uint8_t type;
- if (!packet_read08(packet, &type)) PROTOCOL_ERROR();
- if (type > TILE_WATER) PROTOCOL_ERROR();
- MAPTILE(x,y).map = type;
- uint8_t food;
- if (!packet_read08(packet, &food)) PROTOCOL_ERROR();
- if (food == 0xFF) {
- MAPTILE(x, y).food = -1;
- } else {
- if (food >= 10) PROTOCOL_ERROR();
- MAPTILE(x, y).food = food;
- }
+ uint8_t food_type;
+ if (!packet_read08(packet, &food_type)) PROTOCOL_ERROR();
+
+ uint8_t food = food_type & 0x0F;
+ if (food > 10) PROTOCOL_ERROR();
+ MAPTILE(x, y).food = food;
+
+ uint8_t type = (food_type & 0xF0) >> 4;
+ if (type >= TILE_LAST_DEFINED) PROTOCOL_ERROR();
+ MAPTILE(x,y).type = type;
+
+ uint8_t gfx;
+ if (!packet_read08(packet, &gfx)) PROTOCOL_ERROR();
+ if (gfx >= TILE_GFX_LAST_DEFINED) PROTOCOL_ERROR();
+ MAPTILE(x,y).gfx = gfx;
+
renderer_world_changed(x, y);
}
@@ -100,8 +104,9 @@ void client_world_info_from_network(packet_t *packet) {
// Tile Texturen setzen
for (int x = 0; x < w; x++) {
for (int y = 0; y < h; y++) {
- MAPTILE(x,y).food = -1;
- MAPTILE(x,y).map = TILE_SOLID;
+ MAPTILE(x,y).food = 0;
+ MAPTILE(x,y).type = TILE_SOLID;
+ MAPTILE(x,y).gfx = TILE_GFX_SOLID;
}
}
View
3 client_world.h
@@ -26,7 +26,8 @@
typedef struct maptile_s {
int food;
- maptype_e map;
+ maptype_e type;
+ mapgfx_e gfx;
} client_maptile_t;
typedef struct world_info_s {
View
23 common_world.h
@@ -26,9 +26,26 @@
typedef enum {
TILE_SOLID = 0,
- TILE_PLAIN = 1,
- TILE_WATER = 2,
- TILE_LAVA = 3,
+ TILE_PLAIN,
+
+ TILE_LAST_DEFINED,
} maptype_e;
+typedef enum {
+ TILE_GFX_SOLID = 0,
+ TILE_GFX_PLAIN,
+ TILE_GFX_BORDER,
+
+ TILE_GFX_SNOW_SOLID,
+ TILE_GFX_SNOW_PLAIN,
+ TILE_GFX_SNOW_BORDER,
+
+ TILE_GFX_WATER,
+ TILE_GFX_LAVA,
+ TILE_GFX_NONE,
+ TILE_GFX_KOTH,
+
+ TILE_GFX_LAST_DEFINED
+} mapgfx_e;
+
#endif
View
74 creature.c
@@ -52,6 +52,10 @@ static creature_t *creature_find_unused() {
return NULL;
}
+static int creature_num(const creature_t *creature) {
+ return creature - creatures;
+}
+
creature_t *creature_by_num(int creature_num) {
if (creature_num < 0 || creature_num >= MAXCREATURES)
return NULL;
@@ -65,8 +69,7 @@ int creature_id(const creature_t *creature) {
return creature->vm_id;
}
-creature_t *creature_get_checked_lua(lua_State *L, int idx) {
- const int vm_id = luaL_checklong(L, idx);
+creature_t *creature_by_id(int vm_id) {
const int hash = HASHVALUE(vm_id);
creature_t *creature = creature_hash[hash];
while (creature) {
@@ -75,6 +78,14 @@ creature_t *creature_get_checked_lua(lua_State *L, int idx) {
return creature;
creature = creature->hash_next;
}
+ return NULL;
+}
+
+creature_t *creature_get_checked_lua(lua_State *L, int idx) {
+ const int vm_id = luaL_checklong(L, idx);
+ creature_t *creature = creature_by_id(vm_id);
+ if (creature)
+ return creature;
luaL_error(L, "creature %d not in use", vm_id);
return NULL; // never reached
}
@@ -86,10 +97,6 @@ int creature_dist(const creature_t *a, const creature_t *b) {
return sqrt(distx * distx + disty * disty);
}
-int creature_num(const creature_t *creature) {
- return creature - creatures;
-}
-
static void creature_make_smile(const creature_t *creature, client_t *client) {
packet_t packet;
packet_init(&packet, PACKET_CREATURE_SMILE);
@@ -123,6 +130,7 @@ int creature_max_health(const creature_t *creature) {
return 5000;
default:
assert(0);
+ return 0;
}
}
@@ -136,6 +144,7 @@ int creature_max_food(const creature_t *creature) {
return 5000;
default:
assert(0);
+ return 0;
}
}
@@ -149,6 +158,7 @@ int creature_aging(const creature_t *creature) {
return 5;
default:
assert(0);
+ return 0;
}
}
@@ -177,10 +187,6 @@ creature_t *creature_nearest_enemy(const creature_t *reference, int *distptr) {
// ------------- Bewegung -------------
-int creature_can_move_to_target(creature_t *creature) {
- return creature->path != NULL;
-}
-
int creature_speed(const creature_t *creature) {
switch (creature->type) {
case CREATURE_SMALL:
@@ -191,9 +197,14 @@ int creature_speed(const creature_t *creature) {
return 800;
default:
assert(0);
+ return 0;
}
}
+int creature_can_move_to_target(creature_t *creature) {
+ return creature->path != NULL && creature_speed(creature) > 0;
+}
+
void creature_do_move_to_target(creature_t *creature, int delta) {
int travelled = creature_speed(creature) * delta / 1000;
@@ -245,6 +256,7 @@ int creature_heal_rate(const creature_t *creature) {
return 600;
default:
assert(0);
+ return 0;
}
}
@@ -285,6 +297,7 @@ int creature_eat_rate(const creature_t *creature) {
return 600;
default:
assert(0);
+ return 0;
}
}
@@ -325,6 +338,7 @@ int creature_hitpoints(const creature_t *creature) {
return 0;
default:
assert(0);
+ return 0;
}
}
@@ -338,6 +352,7 @@ int creature_attack_distance(const creature_t *creature) {
return 0;
default:
assert(0);
+ return 0;
}
}
@@ -346,7 +361,7 @@ void creature_do_attack(creature_t *creature, int delta) {
if (hitpoints == 0)
goto finished_attacking;
- creature_t *target = creature_by_num(creature->target);
+ creature_t *target = creature_by_id(creature->target_id);
// Nicht gefunden?
if (!target)
@@ -357,8 +372,8 @@ void creature_do_attack(creature_t *creature, int delta) {
goto finished_attacking;
// Ziel zu jung?
- if (target->spawn_time + 500 > game_time)
- goto finished_attacking;
+ // if (target->spawn_time + 500 > game_time)
+ // goto finished_attacking;
// Eigenes Viech?
if (target->player == creature->player)
@@ -529,6 +544,7 @@ int creature_can_feed(const creature_t *creature) {
return creature->food > 0;
default:
assert(0);
+ return 0;
}
}
@@ -542,6 +558,7 @@ int creature_feed_distance(const creature_t *creature) {
return TILE_SCALE;
default:
assert(0);
+ return 0;
}
}
@@ -555,22 +572,23 @@ int creature_feed_speed(const creature_t *creature) {
return 400;
default:
assert(0);
+ return 0;
}
}
void creature_do_feed(creature_t *creature, int delta) {
int food = creature_feed_speed(creature) * delta / 1000;
int finished = 0;
- creature_t *target = creature_by_num(creature->target);
+ creature_t *target = creature_by_id(creature->target_id);
// Nicht gefunden?
if (!target)
goto finished_feeding;
// Ziel zu jung?
- if (target->spawn_time + 500 > game_time)
- goto finished_feeding;
+ // if (target->spawn_time + 500 > game_time)
+ // goto finished_feeding;
// Zu weit weg?
if (creature_dist(creature, target) > creature_feed_distance(creature))
@@ -596,19 +614,19 @@ void creature_do_feed(creature_t *creature, int delta) {
}
-int creature_set_target(creature_t *creature, int target) {
+int creature_set_target(creature_t *creature, int target_id) {
// Sich selbst als Ziel macht nie Sinn.
- if (target == creature_num(creature))
+ if (target_id == creature->vm_id)
return 0;
// Nicht vorhanden?
- if (!creature_by_num(target))
+ if (!creature_by_id(target_id))
return 0;
// Nicht mehr pruefen, da sich das Ziel bereits in dieser
// Runde toeten koennte und daher ein true hier nicht heisst,
// dass tatsaechlich attackiert/gefuettert werden kann.
- creature->target = target;
+ creature->target_id = target_id;
return 1;
}
@@ -707,12 +725,12 @@ void creature_update_network_variables(creature_t *creature) {
creature->dirtymask |= CREATURE_DIRTY_SPEED;
}
- if ((creature->state == CREATURE_ATTACK ||
- creature->state == CREATURE_FEED) &&
- creature->network_target != creature->target)
- {
- creature->network_target = creature->target;
- creature->dirtymask |= CREATURE_DIRTY_TARGET;
+ if ((creature->state == CREATURE_ATTACK || creature->state == CREATURE_FEED)) {
+ const creature_t *target = creature_by_id(creature->target_id);
+ if (target && creature_num(target) != creature->network_target) {
+ creature->network_target = creature_num(target);
+ creature->dirtymask |= CREATURE_DIRTY_TARGET;
+ }
}
}
@@ -878,13 +896,14 @@ creature_t *creature_spawn(player_t *player, creature_t *parent, int x, int y, c
memset(creature, 0, sizeof(creature_t));
+ creature->vm_id = next_free_vm_id++;
creature->x = x;
creature->y = y;
creature->type = type;
creature->food = 0;
creature->health = creature_max_health(creature);
creature->player = player;
- creature->target = creature_num(creature); // muesste nicht gesetzt werden
+ creature->target_id = creature->vm_id; // muesste nicht gesetzt werden
creature->path = NULL;
creature->convert_food = 0;
creature->convert_type = type;
@@ -893,7 +912,6 @@ creature_t *creature_spawn(player_t *player, creature_t *parent, int x, int y, c
creature->suicide = 0;
creature->message[0] = '\0';
creature->spawn_time = game_time;
- creature->vm_id = next_free_vm_id++;
creature->age_action_deltas = 0;
const int hash = HASHVALUE(creature->vm_id);
View
6 creature.h
@@ -36,7 +36,7 @@ typedef struct creature_s {
int food;
int health;
player_t *player;
- int target;
+ int target_id;
pathnode_t *path;
int convert_food;
creature_type convert_type;
@@ -65,9 +65,9 @@ typedef struct creature_s {
struct creature_s *hash_next;
} creature_t;
-creature_t *creature_by_num(int creature_num);
-
+creature_t *creature_by_id(int creature_num);
int creature_id(const creature_t *creature);
+
creature_t *creature_get_checked_lua(lua_State *L, int idx);
creature_t *creature_spawn(player_t *player, creature_t *parent, int x, int y, creature_type type);
View
10 demo2graph.rb
@@ -3,9 +3,9 @@
require 'stringio'
class Tile
- attr_accessor :food, :type
- def initialize(type, food)
- @food, @type = food == 0xFF ? 0 : food + 1, type
+ attr_accessor :food, :type, :gfx
+ def initialize(type, gfx, food)
+ @food, @type, @gfx = food, type, gfx
end
end
@@ -106,7 +106,9 @@ def tick
player.score = @file.read16 - 500
end
when 1:
- @world[[@file.read8, @file.read8]] = Tile.new(@file.read8, @file.read8)
+ pos = [@file.read8, @file.read8]
+ food_type, gfx = @file.read8, @file.read8
+ @world[pos] = Tile.new(food_type & 0xF0 >> 4, gfx, food_type & 0xF)
when 2:
msg = @file.readXX(len)
when 3:
View
10 game.c
@@ -30,7 +30,7 @@
#include "creature.h"
#include "misc.h"
-static int should_end_round = 0;
+static int should_end_game = 0;
static struct timeval start;
static char intermission[256] = {0};
@@ -67,7 +67,7 @@ void game_send_initial_update(client_t *client) {
}
static int luaGameEnd(lua_State *L) {
- should_end_round = 1;
+ should_end_game = 1;
return 0;
}
@@ -153,8 +153,8 @@ void game_init() {
}
void game_one_game() {
- should_end_round = 0;
- game_time = 0;
+ should_end_game = 0;
+ game_time = 0;
game_send_info(SEND_BROADCAST);
@@ -187,7 +187,7 @@ void game_one_game() {
lua_pop(L, 1);
}
- while (!game_exit && !should_end_round) {
+ while (!game_exit && !should_end_game) {
int tick = get_tick();
int delta = tick - lasttick;
View
BIN gfx/theme-snow.png
Deleted file not rendered
View
BIN gfx/theme.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 gl_gui.c
@@ -399,7 +399,7 @@ static void world_draw() {
for (int x = 0; x < info->width; x++) {
glPushMatrix();
glTranslatef(TILE_X1(x), TILE_Y1(y), 0.0);
- switch (tile->map) {
+ switch (tile->type) {
case TILE_SOLID:
wall_draw();
break;
View
2 global.h
@@ -45,7 +45,7 @@ extern int game_exit;
#define PATHFIND_AREA_MERGE
// Netzwerk Protokoll
-#define PROTOCOL_VERSION 6
+#define PROTOCOL_VERSION 7
// open stdin (console) client
#define CONSOLE_CLIENT
View
78 infond.lua
@@ -334,6 +334,7 @@ function world_load(map)
-- lua functions
print = print;
pairs = pairs;
+ unpack = unpack;
math = { random = math.random };
string = { upper = string.upper;
sub = string.sub;
@@ -342,14 +343,31 @@ function world_load(map)
-- game functions
world_dig = world_dig;
+ world_set_type = world_set_type;
+ world_set_gfx = world_set_gfx;
+ world_get_type = world_get_type;
+ world_get_gfx = world_get_gfx;
world_find_digged = world_find_digged;
world_add_food = world_add_food;
+ world_make_border = world_make_border;
+ world_fill_all = world_fill_all;
game_info = game_info;
-- game constants
- TILE_SOLID = TILE_SOLID;
- TILE_PLAIN = TILE_PLAIN;
- TILE_WATER = TILE_WATER;
+ TILE_SOLID = TILE_SOLID;
+ TILE_PLAIN = TILE_PLAIN;
+ TILE_WATER = 2; -- compatibility
+
+ TILE_GFX_SOLID = TILE_GFX_SOLID;
+ TILE_GFX_PLAIN = TILE_GFX_PLAIN;
+ TILE_GFX_BORDER = TILE_GFX_BORDER;
+ TILE_GFX_SNOW_SOLID = TILE_GFX_SNOW_SOLID;
+ TILE_GFX_SNOW_PLAIN = TILE_GFX_SNOW_PLAIN;
+ TILE_GFX_SNOW_BORDER = TILE_GFX_SNOW_BORDER;
+ TILE_GFX_WATER = TILE_GFX_WATER;
+ TILE_GFX_LAVA = TILE_GFX_LAVA;
+ TILE_GFX_NONE = TILE_GFX_NONE;
+ TILE_GFX_KOTH = TILE_GFX_KOTH;
}
-- activate environment for world code and load world
@@ -364,9 +382,8 @@ function world_init()
stats.num_maps = stats.num_maps + 1
local ok, w, h, kx, ky = pcall(world_load, map)
if not ok then
- print("cannot load world '" .. map .. "': " .. w .. ". using 3x3 dummy world")
world_tick = coroutine.wrap(function () while true do coroutine.yield() end end)
- return 3, 3, 1, 1
+ error("cannot load world '" .. map .. "': " .. w .. ". using dummy world")
else
world_tick = coroutine.wrap(world_main)
return w, h, kx, ky
@@ -393,10 +410,47 @@ end
function world_find_digged_worldcoord()
local x, y = world_find_digged()
+ if not x then return end
return x * TILE_WIDTH + TILE_WIDTH / 2,
y * TILE_HEIGHT + TILE_HEIGHT / 2
end
+-- compatibility function
+function world_dig(x, y, typ, gfx)
+ gfx = gfx or typ
+ if typ == 2 then -- water
+ world_set_gfx(x, y, TILE_GFX_WATER)
+ return
+ end
+ local w, h = world.level_size()
+ local kx, ky = world.level_koth_pos()
+ if x == kx and y == ky then
+ gfx = TILE_GFX_KOTH
+ end
+ return world_set_type(x, y, typ) and world_set_gfx(x, y, gfx)
+end
+
+function world_fill_all(gfx)
+ local w, h = world.level_size()
+ for x = 0, w - 1 do
+ for y = 0, h - 1 do
+ world_set_gfx(x, y, gfx)
+ end
+ end
+end
+
+function world_make_border(gfx)
+ local w, h = world.level_size()
+ for x = 0, w-1 do
+ world_set_gfx(x, 0, gfx)
+ world_set_gfx(x, h - 1, gfx)
+ end
+ for y = 0, h-1 do
+ world_set_gfx(0 , y, gfx)
+ world_set_gfx(w - 1, y, gfx)
+ end
+end
+
-----------------------------------------------------------
-- Rules Funktionen
-----------------------------------------------------------
@@ -424,21 +478,26 @@ function kickban(fd, msg)
end
function killall()
- for n = 0, MAXPLAYERS - 1 do
- pcall(player_kill_all_creatures, n)
+ for pno in each_player() do
+ player_kill_all_creatures(pno)
end
end
function reset()
killall()
- for n = 0, MAXPLAYERS - 1 do
- pcall(player_set_score, n, 0)
+ for pno in each_player() do
+ player_set_score(pno, 0)
end
scroller_add("About to restart on map " .. map)
wall("About to restart on map " .. map)
game_end()
end
+function changemap(next_map)
+ map = next_map
+ reset()
+end
+
function kickall()
table.foreach(clients, function (fd, client)
clients[fd]:disconnect("kicked")
@@ -463,7 +522,6 @@ function clientlist()
end)
end
-
function acllist()
for n, rule in ipairs(acl) do
cprint(string.format("%2d: %-30s - %9d - %s", n, rule.pattern, rule.time and rule.time - os.time() or -1, rule.deny or "accept"))
View
676 level/cn.lua
@@ -9,342 +9,346 @@ function level_koth_pos()
end
function level_init()
- world_dig(20, 14, TILE_PLAIN)
- world_dig(6, 9, TILE_PLAIN)
- world_dig(6, 8, TILE_PLAIN)
- world_dig(5, 8, TILE_PLAIN)
- world_dig(5, 7, TILE_PLAIN)
- world_dig(5, 6, TILE_PLAIN)
- world_dig(5, 5, TILE_PLAIN)
- world_dig(6, 5, TILE_PLAIN)
- world_dig(6, 4, TILE_PLAIN)
- world_dig(7, 4, TILE_PLAIN)
- world_dig(8, 4, TILE_PLAIN)
- world_dig(9, 4, TILE_PLAIN)
- world_dig(10, 4, TILE_PLAIN)
- world_dig(11, 4, TILE_PLAIN)
- world_dig(11, 5, TILE_PLAIN)
- world_dig(12, 6, TILE_PLAIN)
- world_dig(12, 7, TILE_PLAIN)
- world_dig(12, 8, TILE_PLAIN)
- world_dig(12, 9, TILE_PLAIN)
- world_dig(11, 9, TILE_PLAIN)
- world_dig(11, 10, TILE_PLAIN)
- world_dig(10, 10, TILE_PLAIN)
- world_dig(9, 10, TILE_PLAIN)
- world_dig(8, 10, TILE_PLAIN)
- world_dig(7, 9, TILE_PLAIN)
- world_dig(7, 8, TILE_PLAIN)
- world_dig(6, 7, TILE_PLAIN)
- world_dig(6, 6, TILE_PLAIN)
- world_dig(7, 5, TILE_PLAIN)
- world_dig(8, 5, TILE_PLAIN)
- world_dig(8, 6, TILE_PLAIN)
- world_dig(9, 6, TILE_PLAIN)
- world_dig(10, 6, TILE_PLAIN)
- world_dig(10, 7, TILE_PLAIN)
- world_dig(11, 7, TILE_PLAIN)
- world_dig(11, 8, TILE_PLAIN)
- world_dig(10, 9, TILE_PLAIN)
- world_dig(9, 9, TILE_PLAIN)
- world_dig(8, 9, TILE_PLAIN)
- world_dig(8, 8, TILE_PLAIN)
- world_dig(8, 7, TILE_PLAIN)
- world_dig(11, 6, TILE_PLAIN)
- world_dig(10, 11, TILE_PLAIN)
- world_dig(10, 12, TILE_PLAIN)
- world_dig(11, 12, TILE_PLAIN)
- world_dig(11, 13, TILE_PLAIN)
- world_dig(12, 13, TILE_PLAIN)
- world_dig(13, 13, TILE_PLAIN)
- world_dig(13, 14, TILE_PLAIN)
- world_dig(14, 14, TILE_PLAIN)
- world_dig(15, 14, TILE_PLAIN)
- world_dig(16, 14, TILE_PLAIN)
- world_dig(17, 14, TILE_PLAIN)
- world_dig(18, 14, TILE_PLAIN)
- world_dig(19, 14, TILE_PLAIN)
- world_dig(20, 15, TILE_PLAIN)
- world_dig(17, 13, TILE_PLAIN)
- world_dig(16, 13, TILE_PLAIN)
- world_dig(15, 13, TILE_PLAIN)
- world_dig(14, 13, TILE_PLAIN)
- world_dig(14, 12, TILE_PLAIN)
- world_dig(13, 12, TILE_PLAIN)
- world_dig(12, 12, TILE_PLAIN)
- world_dig(12, 11, TILE_PLAIN)
- world_dig(11, 11, TILE_PLAIN)
- world_dig(18, 13, TILE_PLAIN)
- world_dig(19, 13, TILE_PLAIN)
- world_dig(20, 13, TILE_PLAIN)
- world_dig(21, 13, TILE_PLAIN)
- world_dig(21, 14, TILE_PLAIN)
- world_dig(21, 15, TILE_PLAIN)
- world_dig(19, 15, TILE_PLAIN)
- world_dig(22, 13, TILE_PLAIN)
- world_dig(23, 13, TILE_PLAIN)
- world_dig(23, 14, TILE_PLAIN)
- world_dig(22, 14, TILE_PLAIN)
- world_dig(23, 15, TILE_PLAIN)
- world_dig(22, 15, TILE_PLAIN)
- world_dig(22, 16, TILE_PLAIN)
- world_dig(21, 16, TILE_PLAIN)
- world_dig(20, 16, TILE_PLAIN)
- world_dig(24, 13, TILE_PLAIN)
- world_dig(24, 12, TILE_PLAIN)
- world_dig(24, 11, TILE_PLAIN)
- world_dig(25, 11, TILE_PLAIN)
- world_dig(25, 10, TILE_PLAIN)
- world_dig(26, 9, TILE_PLAIN)
- world_dig(26, 8, TILE_PLAIN)
- world_dig(27, 8, TILE_PLAIN)
- world_dig(27, 7, TILE_PLAIN)
- world_dig(28, 7, TILE_PLAIN)
- world_dig(28, 6, TILE_PLAIN)
- world_dig(29, 6, TILE_PLAIN)
- world_dig(29, 5, TILE_PLAIN)
- world_dig(30, 5, TILE_PLAIN)
- world_dig(31, 5, TILE_PLAIN)
- world_dig(32, 5, TILE_PLAIN)
- world_dig(33, 5, TILE_PLAIN)
- world_dig(33, 6, TILE_PLAIN)
- world_dig(34, 6, TILE_PLAIN)
- world_dig(34, 7, TILE_PLAIN)
- world_dig(34, 8, TILE_PLAIN)
- world_dig(33, 8, TILE_PLAIN)
- world_dig(32, 7, TILE_PLAIN)
- world_dig(31, 6, TILE_PLAIN)
- world_dig(31, 4, TILE_PLAIN)
- world_dig(32, 4, TILE_PLAIN)
- world_dig(33, 4, TILE_PLAIN)
- world_dig(34, 4, TILE_PLAIN)
- world_dig(35, 4, TILE_PLAIN)
- world_dig(36, 5, TILE_PLAIN)
- world_dig(37, 5, TILE_PLAIN)
- world_dig(38, 6, TILE_PLAIN)
- world_dig(38, 7, TILE_PLAIN)
- world_dig(37, 7, TILE_PLAIN)
- world_dig(37, 8, TILE_PLAIN)
- world_dig(36, 8, TILE_PLAIN)
- world_dig(35, 8, TILE_PLAIN)
- world_dig(33, 7, TILE_PLAIN)
- world_dig(32, 6, TILE_PLAIN)
- world_dig(34, 5, TILE_PLAIN)
- world_dig(30, 6, TILE_PLAIN)
- world_dig(29, 4, TILE_PLAIN)
- world_dig(30, 4, TILE_PLAIN)
- world_dig(31, 7, TILE_PLAIN)
- world_dig(30, 7, TILE_PLAIN)
- world_dig(29, 7, TILE_PLAIN)
- world_dig(28, 5, TILE_PLAIN)
- world_dig(27, 5, TILE_PLAIN)
- world_dig(26, 6, TILE_PLAIN)
- world_dig(28, 8, TILE_PLAIN)
- world_dig(29, 8, TILE_PLAIN)
- world_dig(29, 9, TILE_PLAIN)
- world_dig(30, 9, TILE_PLAIN)
- world_dig(31, 9, TILE_PLAIN)
- world_dig(31, 10, TILE_PLAIN)
- world_dig(32, 10, TILE_PLAIN)
- world_dig(32, 9, TILE_PLAIN)
- world_dig(33, 9, TILE_PLAIN)
- world_dig(28, 4, TILE_PLAIN)
- world_dig(27, 4, TILE_PLAIN)
- world_dig(26, 5, TILE_PLAIN)
- world_dig(27, 6, TILE_PLAIN)
- world_dig(31, 8, TILE_PLAIN)
- world_dig(30, 8, TILE_PLAIN)
- world_dig(27, 9, TILE_PLAIN)
- world_dig(27, 10, TILE_PLAIN)
- world_dig(27, 11, TILE_PLAIN)
- world_dig(26, 12, TILE_PLAIN)
- world_dig(25, 13, TILE_PLAIN)
- world_dig(24, 14, TILE_PLAIN)
- world_dig(26, 10, TILE_PLAIN)
- world_dig(26, 11, TILE_PLAIN)
- world_dig(23, 12, TILE_PLAIN)
- world_dig(25, 12, TILE_PLAIN)
- world_dig(28, 10, TILE_PLAIN)
- world_dig(28, 9, TILE_PLAIN)
- world_dig(23, 16, TILE_PLAIN)
- world_dig(24, 16, TILE_PLAIN)
- world_dig(25, 16, TILE_PLAIN)
- world_dig(25, 17, TILE_PLAIN)
- world_dig(26, 17, TILE_PLAIN)
- world_dig(26, 18, TILE_PLAIN)
- world_dig(27, 18, TILE_PLAIN)
- world_dig(28, 19, TILE_PLAIN)
- world_dig(28, 20, TILE_PLAIN)
- world_dig(29, 20, TILE_PLAIN)
- world_dig(29, 21, TILE_PLAIN)
- world_dig(29, 22, TILE_PLAIN)
- world_dig(30, 20, TILE_PLAIN)
- world_dig(31, 19, TILE_PLAIN)
- world_dig(32, 19, TILE_PLAIN)
- world_dig(33, 19, TILE_PLAIN)
- world_dig(33, 20, TILE_PLAIN)
- world_dig(34, 20, TILE_PLAIN)
- world_dig(34, 21, TILE_PLAIN)
- world_dig(34, 22, TILE_PLAIN)
- world_dig(34, 23, TILE_PLAIN)
- world_dig(33, 23, TILE_PLAIN)
- world_dig(32, 23, TILE_PLAIN)
- world_dig(31, 22, TILE_PLAIN)
- world_dig(31, 21, TILE_PLAIN)
- world_dig(31, 20, TILE_PLAIN)
- world_dig(32, 20, TILE_PLAIN)
- world_dig(32, 24, TILE_PLAIN)
- world_dig(31, 24, TILE_PLAIN)
- world_dig(31, 25, TILE_PLAIN)
- world_dig(30, 25, TILE_PLAIN)
- world_dig(29, 25, TILE_PLAIN)
- world_dig(29, 24, TILE_PLAIN)
- world_dig(29, 23, TILE_PLAIN)
- world_dig(30, 22, TILE_PLAIN)
- world_dig(32, 22, TILE_PLAIN)
- world_dig(33, 22, TILE_PLAIN)
- world_dig(30, 24, TILE_PLAIN)
- world_dig(30, 23, TILE_PLAIN)
- world_dig(31, 23, TILE_PLAIN)
- world_dig(32, 21, TILE_PLAIN)
- world_dig(33, 21, TILE_PLAIN)
- world_dig(35, 22, TILE_PLAIN)
- world_dig(36, 22, TILE_PLAIN)
- world_dig(36, 23, TILE_PLAIN)
- world_dig(36, 24, TILE_PLAIN)
- world_dig(35, 24, TILE_PLAIN)
- world_dig(34, 24, TILE_PLAIN)
- world_dig(33, 24, TILE_PLAIN)
- world_dig(28, 21, TILE_PLAIN)
- world_dig(27, 21, TILE_PLAIN)
- world_dig(26, 20, TILE_PLAIN)
- world_dig(25, 20, TILE_PLAIN)
- world_dig(25, 19, TILE_PLAIN)
- world_dig(24, 19, TILE_PLAIN)
- world_dig(24, 18, TILE_PLAIN)
- world_dig(23, 17, TILE_PLAIN)
- world_dig(24, 17, TILE_PLAIN)
- world_dig(25, 18, TILE_PLAIN)
- world_dig(26, 19, TILE_PLAIN)
- world_dig(27, 19, TILE_PLAIN)
- world_dig(27, 20, TILE_PLAIN)
- world_dig(19, 16, TILE_PLAIN)
- world_dig(18, 16, TILE_PLAIN)
- world_dig(18, 17, TILE_PLAIN)
- world_dig(17, 17, TILE_PLAIN)
- world_dig(16, 18, TILE_PLAIN)
- world_dig(15, 18, TILE_PLAIN)
- world_dig(15, 19, TILE_PLAIN)
- world_dig(14, 19, TILE_PLAIN)
- world_dig(14, 20, TILE_PLAIN)
- world_dig(13, 21, TILE_PLAIN)
- world_dig(13, 22, TILE_PLAIN)
- world_dig(12, 22, TILE_PLAIN)
- world_dig(12, 23, TILE_PLAIN)
- world_dig(11, 23, TILE_PLAIN)
- world_dig(10, 23, TILE_PLAIN)
- world_dig(9, 23, TILE_PLAIN)
- world_dig(9, 22, TILE_PLAIN)
- world_dig(10, 22, TILE_PLAIN)
- world_dig(10, 24, TILE_PLAIN)
- world_dig(9, 24, TILE_PLAIN)
- world_dig(9, 25, TILE_PLAIN)
- world_dig(8, 25, TILE_PLAIN)
- world_dig(7, 25, TILE_PLAIN)
- world_dig(6, 25, TILE_PLAIN)
- world_dig(6, 24, TILE_PLAIN)
- world_dig(6, 23, TILE_PLAIN)
- world_dig(6, 22, TILE_PLAIN)
- world_dig(7, 22, TILE_PLAIN)
- world_dig(8, 22, TILE_PLAIN)
- world_dig(8, 24, TILE_PLAIN)
- world_dig(7, 24, TILE_PLAIN)
- world_dig(5, 23, TILE_PLAIN)
- world_dig(5, 22, TILE_PLAIN)
- world_dig(4, 22, TILE_PLAIN)
- world_dig(4, 21, TILE_PLAIN)
- world_dig(5, 20, TILE_PLAIN)
- world_dig(6, 20, TILE_PLAIN)
- world_dig(7, 20, TILE_PLAIN)
- world_dig(7, 21, TILE_PLAIN)
- world_dig(8, 21, TILE_PLAIN)
- world_dig(12, 24, TILE_PLAIN)
- world_dig(11, 22, TILE_PLAIN)
- world_dig(9, 21, TILE_PLAIN)
- world_dig(10, 21, TILE_PLAIN)
- world_dig(11, 21, TILE_PLAIN)
- world_dig(12, 21, TILE_PLAIN)
- world_dig(14, 21, TILE_PLAIN)
- world_dig(15, 20, TILE_PLAIN)
- world_dig(16, 19, TILE_PLAIN)
- world_dig(17, 19, TILE_PLAIN)
- world_dig(17, 18, TILE_PLAIN)
- world_dig(18, 18, TILE_PLAIN)
- world_dig(19, 17, TILE_PLAIN)
- world_dig(12, 20, TILE_PLAIN)
- world_dig(13, 20, TILE_PLAIN)
- world_dig(13, 19, TILE_PLAIN)
- world_dig(14, 18, TILE_PLAIN)
- world_dig(16, 17, TILE_PLAIN)
- world_dig(38, 8, TILE_PLAIN)
- world_dig(37, 6, TILE_PLAIN)
- world_dig(36, 4, TILE_PLAIN)
- world_dig(35, 3, TILE_PLAIN)
- world_dig(34, 3, TILE_PLAIN)
- world_dig(33, 3, TILE_PLAIN)
- world_dig(13, 23, TILE_PLAIN)
- world_dig(14, 23, TILE_PLAIN)
- world_dig(15, 23, TILE_PLAIN)
- world_dig(16, 23, TILE_PLAIN)
- world_dig(17, 23, TILE_PLAIN)
- world_dig(18, 23, TILE_PLAIN)
- world_dig(19, 24, TILE_PLAIN)
- world_dig(20, 24, TILE_PLAIN)
- world_dig(21, 24, TILE_PLAIN)
- world_dig(22, 24, TILE_PLAIN)
- world_dig(23, 24, TILE_PLAIN)
- world_dig(24, 24, TILE_PLAIN)
- world_dig(25, 24, TILE_PLAIN)
- world_dig(26, 24, TILE_PLAIN)
- world_dig(27, 24, TILE_PLAIN)
- world_dig(28, 24, TILE_PLAIN)
- world_dig(19, 23, TILE_PLAIN)
- world_dig(7, 19, TILE_PLAIN)
- world_dig(7, 18, TILE_PLAIN)
- world_dig(7, 17, TILE_PLAIN)
- world_dig(7, 16, TILE_PLAIN)
- world_dig(7, 15, TILE_PLAIN)
- world_dig(7, 14, TILE_PLAIN)
- world_dig(7, 13, TILE_PLAIN)
- world_dig(7, 12, TILE_PLAIN)
- world_dig(7, 11, TILE_PLAIN)
- world_dig(7, 10, TILE_PLAIN)
- world_dig(13, 6, TILE_PLAIN)
- world_dig(14, 6, TILE_PLAIN)
- world_dig(15, 6, TILE_PLAIN)
- world_dig(16, 6, TILE_PLAIN)
- world_dig(17, 6, TILE_PLAIN)
- world_dig(18, 6, TILE_PLAIN)
- world_dig(19, 6, TILE_PLAIN)
- world_dig(20, 6, TILE_PLAIN)
- world_dig(21, 6, TILE_PLAIN)
- world_dig(22, 6, TILE_PLAIN)
- world_dig(23, 6, TILE_PLAIN)
- world_dig(24, 6, TILE_PLAIN)
- world_dig(25, 6, TILE_PLAIN)
- world_dig(35, 9, TILE_PLAIN)
- world_dig(35, 10, TILE_PLAIN)
- world_dig(35, 11, TILE_PLAIN)
- world_dig(35, 12, TILE_PLAIN)
- world_dig(35, 13, TILE_PLAIN)
- world_dig(35, 14, TILE_PLAIN)
- world_dig(35, 15, TILE_PLAIN)
- world_dig(35, 16, TILE_PLAIN)
- world_dig(35, 17, TILE_PLAIN)
- world_dig(35, 18, TILE_PLAIN)
- world_dig(35, 19, TILE_PLAIN)
- world_dig(35, 20, TILE_PLAIN)
- world_dig(35, 21, TILE_PLAIN)
+ world_fill_all(TILE_GFX_SNOW_SOLID)
+
+ world_dig(20, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(5, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(5, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(5, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(5, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(15, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(16, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(17, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(18, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(19, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(20, 15, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(17, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(16, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(15, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(18, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(19, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(20, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(21, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(21, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(21, 15, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(19, 15, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(22, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(23, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(23, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(22, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(23, 15, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(22, 15, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(22, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(21, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(20, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(36, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(37, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(38, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(38, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(37, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(37, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(36, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 7, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 5, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(23, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(23, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 25, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 25, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 25, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(29, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(30, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(31, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(32, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(36, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(36, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(36, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(23, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(19, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(18, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(18, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(17, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(16, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(15, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(15, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 25, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 25, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 25, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 25, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(5, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(5, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(4, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(4, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(5, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(6, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(8, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 22, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(9, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(10, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(11, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(15, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(16, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(17, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(17, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(18, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(19, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(12, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(16, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(38, 8, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(37, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(36, 4, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 3, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(34, 3, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(33, 3, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(15, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(16, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(17, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(18, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(19, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(20, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(21, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(22, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(23, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(26, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(27, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(28, 24, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(19, 23, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 15, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(7, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(13, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(14, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(15, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(16, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(17, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(18, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(19, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(20, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(21, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(22, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(23, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(24, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(25, 6, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 9, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 10, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 11, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 12, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 13, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 14, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 15, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 16, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 17, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 18, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 19, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 20, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+ world_dig(35, 21, TILE_PLAIN, TILE_GFX_SNOW_PLAIN)
+
+ world_make_border(TILE_GFX_SNOW_BORDER)
food_spawner = {}
for s = 0, 10 do
View
43 level/foo.lua
@@ -939,22 +939,13 @@ function level_init()
world_dig(61, 40, TILE_PLAIN)
world_dig(60, 38, TILE_PLAIN)
world_dig(61, 38, TILE_PLAIN)
- world_dig(62, 38, TILE_PLAIN)
- world_dig(62, 39, TILE_PLAIN)
world_dig(61, 37, TILE_PLAIN)
- world_dig(62, 37, TILE_PLAIN)
world_dig(61, 36, TILE_PLAIN)
- world_dig(62, 36, TILE_PLAIN)
- world_dig(62, 35, TILE_PLAIN)
- world_dig(62, 34, TILE_PLAIN)
world_dig(61, 34, TILE_PLAIN)
world_dig(61, 35, TILE_PLAIN)
world_dig(61, 33, TILE_PLAIN)
- world_dig(62, 33, TILE_PLAIN)
world_dig(61, 32, TILE_PLAIN)
- world_dig(62, 32, TILE_PLAIN)
world_dig(61, 31, TILE_PLAIN)
- world_dig(62, 31, TILE_PLAIN)
world_dig(60, 31, TILE_PLAIN)
world_dig(60, 32, TILE_PLAIN)
world_dig(60, 30, TILE_PLAIN)
@@ -1003,15 +994,10 @@ function level_init()
world_dig(61, 5, TILE_PLAIN)
world_dig(60, 6, TILE_PLAIN)
world_dig(61, 6, TILE_PLAIN)
- world_dig(62, 6, TILE_PLAIN)
world_dig(61, 7, TILE_PLAIN)
- world_dig(62, 7, TILE_PLAIN)
world_dig(61, 8, TILE_PLAIN)
- world_dig(62, 8, TILE_PLAIN)
world_dig(61, 9, TILE_PLAIN)
- world_dig(62, 9, TILE_PLAIN)
world_dig(61, 10, TILE_PLAIN)
- world_dig(62, 10, TILE_PLAIN)
world_dig(60, 10, TILE_PLAIN)
world_dig(60, 11, TILE_PLAIN)
world_dig(61, 11, TILE_PLAIN)
@@ -1107,18 +1093,11 @@ function level_init()
world_dig(6, 43, TILE_PLAIN)
world_dig(7, 42, TILE_PLAIN)
world_dig(7, 43, TILE_PLAIN)
- world_dig(6, 44, TILE_PLAIN)
- world_dig(7, 44, TILE_PLAIN)
world_dig(8, 43, TILE_PLAIN)
- world_dig(8, 44, TILE_PLAIN)
world_dig(9, 43, TILE_PLAIN)
- world_dig(9, 44, TILE_PLAIN)
world_dig(10, 43, TILE_PLAIN)
- world_dig(10, 44, TILE_PLAIN)
world_dig(11, 43, TILE_PLAIN)
- world_dig(11, 44, TILE_PLAIN)
world_dig(12, 43, TILE_PLAIN)
- world_dig(12, 44, TILE_PLAIN)
world_dig(11, 42, TILE_PLAIN)
world_dig(12, 42, TILE_PLAIN)
world_dig(11, 41, TILE_PLAIN)
@@ -1182,6 +1161,28 @@ function level_init()
world_dig(22, 19, TILE_PLAIN)
world_dig(22, 20, TILE_PLAIN)
world_dig(23, 21, TILE_PLAIN)
+
+ local w, h = level_size()
+ local offsets = { { -1, -1 }, { 0, -1 }, { 1, -1 },
+ { -1, 0 }, { 1, 0 },
+ { -1, 1 }, { 0, 1 }, { 1, 1 } }
+ for x = 1, w-2 do
+ for y = 1, h-2 do
+ local change = true
+ for n, offset in pairs(offsets) do
+ local xx, yy = unpack(offset)
+ if world_get_type(x + xx, y + yy) ~= TILE_SOLID then
+ change = false
+ break
+ end
+ end
+ if change then
+ world_set_gfx(x, y, TILE_GFX_LAVA)
+ end
+ end
+ end
+
+ world_make_border(TILE_GFX_LAVA)
food_spawner = {}
for s = 0, 15 do
View
2 level/gpn.lua
@@ -311,6 +311,8 @@ function level_init()
world_dig(1, 23, TILE_PLAIN)
world_dig(15, 6, TILE_PLAIN)
+ world_make_border(TILE_GFX_BORDER)
+
food_spawner = {}
for s = 0, 10 do
local dx, dy = world_find_digged()
View
3 level/owl.lua
@@ -59,6 +59,7 @@ function level_init()
end
end
+ world_make_border(TILE_GFX_WATER)
food_spawner = {}
for s = 0, 11 do
@@ -85,4 +86,4 @@ function level_tick()
end
end
end
-end
+end
View
2 level/water.lua
@@ -2042,6 +2042,8 @@ function level_init()
world_dig(55, 26, TILE_PLAIN)
world_dig(56, 26, TILE_PLAIN)
+ world_make_border(TILE_GFX_BORDER)
+
food_spawner = {
{
x = 5,
View
2 map.c
@@ -362,10 +362,12 @@ void area_merge_portals(area_t *area) {
assert(cur->next->prev == cur);
assert(cur->prev->next == cur);
+#ifndef NDEBUG
int cur_value = portalside_to_value(cur);
int next_value = portalside_to_value(cur->next);
assert(cur == cur->next || cur_value != next_value);
+#endif
if (portal_is_mergable_with_neighbour(cur)) {
portalside_merge_with_neighbour(cur);
View
5 misc.h
@@ -36,9 +36,14 @@ int yesno(const char *fmt, ...);
#define max(a,b) ((a)>(b)?(a):(b))
#endif
+#define limit(v,a,b) ((v)<(a)?(a):((v)>(b)?(b):(v)))
+
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
+#define lua_register_constant(L, name) \
+ do { lua_pushnumber(L, name); lua_setglobal(L, #name); } while (0)
+
#define save_lua_stack(L, diff) \
lua_State *check_L = L; \
int lua_stack = lua_gettop(check_L) - diff;\
View
6 player-highlevel.lua
@@ -266,7 +266,7 @@ end
function this_function_call_fails_if_cpu_limit_exceeded() end
-- Globales Array alle Kreaturen
-creatures = {}
+creatures = creatures or {}
function player_think(events)
can_yield = false
@@ -366,8 +366,8 @@ function player_think(events)
if not ok then
creature.message = msg
-- Falls die Coroutine abgebrochen wurde, weil zuviel
- -- CPU benutzt wurde, so triggert folgeder Funktions
- -- Aufruf den Abbruch von player_think. Um zu ermitteln,
+ -- CPU benutzt wurde, so triggert folgender Funktions-
+ -- aufruf den Abbruch von player_think. Um zu ermitteln,
-- wo zuviel CPU gebraucht wurde, kann der Traceback
-- in creature.message mittels 'i' angezeigt werden.
this_function_call_fails_if_cpu_limit_exceeded()
View
70 player.c
@@ -521,7 +521,7 @@ static int luaGetKothPos(lua_State *L) {
static int luaCreatureExists(lua_State *L) {
if (RESTRICTIVE) luaL_error(L, "this function is not available in restricted mode");
- lua_pushboolean(L, !!creature_by_num(luaL_checklong(L, 1)));
+ lua_pushboolean(L, !!creature_by_id(luaL_checklong(L, 1)));
return 1;
}
@@ -585,10 +585,6 @@ static void player_set_color(player_t *player, int color) {
lua_pushcclosure((p)->L, f, 1), \
lua_settable((p)->L, LUA_GLOBALSINDEX))
-#define lua_register_player_global(p, name) \
- (lua_pushnumber((p)->L, name), \
- lua_setglobal((p)->L, #name))
-
player_t *player_create(const char *pass, const char *highlevel) {
int playerno;
@@ -657,24 +653,22 @@ player_t *player_create(const char *pass, const char *highlevel) {
lua_register(player->L, "king_player", luaKingPlayer);
lua_register(player->L, "player_score", luaPlayerScore);
- lua_register_player_global(player, CREATURE_IDLE);
- lua_register_player_global(player, CREATURE_WALK);
- lua_register_player_global(player, CREATURE_HEAL);
- lua_register_player_global(player, CREATURE_EAT);
- lua_register_player_global(player, CREATURE_ATTACK);
- lua_register_player_global(player, CREATURE_CONVERT);
- lua_register_player_global(player, CREATURE_SPAWN);
- lua_register_player_global(player, CREATURE_FEED);
-
- lua_register_player_global(player, TILE_SOLID);
- lua_register_player_global(player, TILE_PLAIN);
- lua_register_player_global(player, TILE_WATER);
- lua_register_player_global(player, TILE_LAVA);
-
- lua_register_player_global(player, CREATURE_SPAWNED);
- lua_register_player_global(player, CREATURE_KILLED);
- lua_register_player_global(player, CREATURE_ATTACKED);
- lua_register_player_global(player, PLAYER_CREATED);
+ lua_register_constant(player->L, CREATURE_IDLE);
+ lua_register_constant(player->L, CREATURE_WALK);
+ lua_register_constant(player->L, CREATURE_HEAL);
+ lua_register_constant(player->L, CREATURE_EAT);
+ lua_register_constant(player->L, CREATURE_ATTACK);
+ lua_register_constant(player->L, CREATURE_CONVERT);
+ lua_register_constant(player->L, CREATURE_SPAWN);
+ lua_register_constant(player->L, CREATURE_FEED);
+
+ lua_register_constant(player->L, TILE_SOLID);
+ lua_register_constant(player->L, TILE_PLAIN);
+
+ lua_register_constant(player->L, CREATURE_SPAWNED);
+ lua_register_constant(player->L, CREATURE_KILLED);
+ lua_register_constant(player->L, CREATURE_ATTACKED);
+ lua_register_constant(player->L, PLAYER_CREATED);
lua_pushnumber(player->L, playerno);
@@ -1130,6 +1124,23 @@ static int luaPlayerSetOutputClient(lua_State *L) {
return 1;
}
+static int luaPlayerIterator(lua_State *L) {
+ if (lua_gettop(L) == 0) {
+ lua_pushcfunction(L, luaPlayerIterator);
+ return 1;
+ }
+
+ int pno = lua_isnumber(L, 2) ? lua_tonumber(L, 2) + 1 : 0;
+ while (pno >= 0 && pno < MAXPLAYERS) {
+ if (PLAYER_USED(&players[pno])) {
+ lua_pushnumber(L, pno);
+ return 1;
+ }
+ pno++;
+ }
+ return 0;
+}
+
void player_init() {
memset(players, 0, sizeof(players));
@@ -1150,6 +1161,8 @@ void player_init() {
lua_register(L, "player_get_used_cpu", luaPlayerGetCPUUsage);
lua_register(L, "player_set_output_client", luaPlayerSetOutputClient);
+ lua_register(L, "each_player", luaPlayerIterator);
+
lua_register(L, "creature_spawn", luaCreatureSpawn);
lua_register(L, "creature_get_pos", luaCreatureGetPos);
lua_register(L, "creature_get_state", luaCreatureGetState);
@@ -1168,14 +1181,9 @@ void player_init() {
lua_register(L, "creature_set_food", luaCreatureSetFood);
lua_register(L, "creature_set_type", luaCreatureSetType);
- lua_pushnumber(L, CREATURE_SMALL);
- lua_setglobal(L, "CREATURE_SMALL");
-
- lua_pushnumber(L, CREATURE_BIG);
- lua_setglobal(L, "CREATURE_BIG");
-
- lua_pushnumber(L, CREATURE_FLYER);
- lua_setglobal(L, "CREATURE_FLYER");
+ lua_register_constant(L, CREATURE_SMALL);
+ lua_register_constant(L, CREATURE_BIG);
+ lua_register_constant(L, CREATURE_FLYER);
}
void player_game_start() {
View
39 player.lua
@@ -29,24 +29,12 @@ _TRACEBACK = debug.traceback
save_in_registry('traceback', debug.traceback)
save_in_registry = nil
-dofile = nil -- would allow file loading
-loadfile = nil -- no file loading
-_VERSION = nil -- who cares
-newproxy = nil -- huh?
-gcinfo = nil -- no access to the garbage collector
-os = nil -- no os access
-package = nil -- package support is not needed
-io = nil -- disable io
-load = nil -- no file loading
-module = nil -- module support not needed
-
-- limit strings accepted by loadstring to 16k
do
local orig_loadstring = loadstring
- local check_code_size = string.len
local error = error
loadstring = function(code, name)
- if check_code_size(code) > 16384 then
+ if #code > 16384 then
error("code too large")
else
return orig_loadstring(code, name)
@@ -63,11 +51,13 @@ do
if type(thread) ~= "thread" then
error("arg #1 is not a thread")
end
- local dumper = function(what, where)
- local info = getinfo(2, "nlS")
+ local dumper = type(text) == "function" and text or function(info)
print(text .. ":" .. info.source .. ":" .. info.currentline)
end
- sethook(thread, dumper, "l")
+ local hook = function(what, where)
+ dumper(getinfo(2, "nlS"))
+ end
+ sethook(thread, hook, "l")
end
thread_untrace = function(thread)
if type(thread) ~= "thread" then
@@ -78,8 +68,16 @@ do
end
debug = nil -- no debugging functions
-
-collectgarbage()
+dofile = nil -- would allow file loading
+loadfile = nil -- no file loading
+_VERSION = nil -- who cares
+newproxy = nil -- huh?
+gcinfo = nil -- no access to the garbage collector
+os = nil -- no os access
+package = nil -- package support is not needed
+io = nil -- disable io
+load = nil -- no file loading
+module = nil -- module support not needed
collectgarbage = nil -- no access to the garbage collector
------------------------------------------------------------------------
@@ -130,4 +128,7 @@ end
------------------------------------------------------------------------
require(...)
-require = nil
+
+require = function(what)
+ print("cannot require file '" .. what .. "'. upload it using the batch (b) command.")
+end
View
20 rules/default.lua
@@ -88,20 +88,20 @@ function onCreatureKilled(victim, killer)
end
end
+function spawnCreatureAtRandomPos(player)
+ local x, y = world_find_digged_worldcoord()
+ if not x then return end
+ return creature_spawn(player, nil, x, y, CREATURE_SMALL)
+end
+
function onPlayerCreated(player)
- local x, y
- x, y = world_find_digged_worldcoord()
- creature_spawn(player, nil, x, y, CREATURE_SMALL)
- x, y = world_find_digged_worldcoord()
- creature_spawn(player, nil, x, y, CREATURE_SMALL)
+ spawnCreatureAtRandomPos(player)
+ spawnCreatureAtRandomPos(player)
end
function onPlayerAllCreaturesDied(player)
- local x, y
- x, y = world_find_digged_worldcoord()
- creature_spawn(player, nil, x, y, CREATURE_SMALL)
- x, y = world_find_digged_worldcoord()
- creature_spawn(player, nil, x, y, CREATURE_SMALL)
+ spawnCreatureAtRandomPos(player)
+ spawnCreatureAtRandomPos(player)
end
function onPlayerScoreChange(player, score)
View
58 sdl_gui.c
@@ -327,32 +327,52 @@ static void draw_world() {
for (int x = x1; x < x2; x++) {
int pos_rand = rand_table[(x ^ y) & 0xFF];
int floor_sprite;
- switch (tile->map) {
- case TILE_SOLID:
- if (x == 0 || x == info->width - 1 || y == 0 || y == info->height - 1) {
- floor_sprite = SPRITE_BORDER + pos_rand % SPRITE_NUM_BORDER;
- } else {
- floor_sprite = SPRITE_SOLID + pos_rand % SPRITE_NUM_SOLID;
- };
+ switch (tile->gfx) {
+ case TILE_GFX_SOLID:
+ floor_sprite = SPRITE_SOLID + pos_rand % SPRITE_NUM_SOLID;
break;
- case TILE_PLAIN:
- if (x == info->koth_x && y == info->koth_y) {
- floor_sprite = SPRITE_KOTH;
- } else {
- floor_sprite = SPRITE_PLAIN + pos_rand % SPRITE_NUM_PLAIN;
- }
+ case TILE_GFX_PLAIN:
+ floor_sprite = SPRITE_PLAIN + pos_rand % SPRITE_NUM_PLAIN;
break;
- case TILE_WATER:
- floor_sprite = SPRITE_WATER + ((render_real_time >> 8) + x + y) % SPRITE_NUM_WATER;
+ case TILE_GFX_BORDER:
+ floor_sprite = SPRITE_BORDER + pos_rand % SPRITE_NUM_BORDER;
+ break;
+ case TILE_GFX_SNOW_SOLID:
+ floor_sprite = SPRITE_SNOW_SOLID + pos_rand % SPRITE_NUM_SNOW_SOLID;
+ break;
+ case TILE_GFX_SNOW_PLAIN:
+ floor_sprite = SPRITE_SNOW_PLAIN + pos_rand % SPRITE_NUM_SNOW_PLAIN;
+ break;
+ case TILE_GFX_SNOW_BORDER:
+ floor_sprite = SPRITE_SNOW_BORDER + pos_rand % SPRITE_NUM_SNOW_BORDER;
+ break;
+ case TILE_GFX_WATER:
+ floor_sprite = SPRITE_WATER + ((render_real_time >> 7) + x + y) % SPRITE_NUM_WATER;
+ break;
+ case TILE_GFX_LAVA:
+ floor_sprite = SPRITE_LAVA + ((render_real_time >> 7) + x + y) % SPRITE_NUM_LAVA;
+ break;
+ case TILE_GFX_NONE:
+ floor_sprite = -1;
+ break;
+ case TILE_GFX_KOTH:
+ floor_sprite = SPRITE_KOTH;
break;
default:
- assert(0);
+ floor_sprite = SPRITE_KOTH;
}
- video_draw(screenx, screeny, sprite_get(floor_sprite));
+ if (floor_sprite < 0)
+ video_rect(screenx, screeny, screenx + SPRITE_TILE_SIZE, screeny + SPRITE_TILE_SIZE, 30, 30, 30, 0);
+ else
+ video_draw(screenx, screeny, sprite_get(floor_sprite));
- if (tile->food >= 0)
- video_draw(screenx, screeny, sprite_get(SPRITE_FOOD + tile->food));
+ if (tile->food != 0) {
+ if (tile->gfx == TILE_GFX_SNOW_PLAIN)
+ video_draw(screenx, screeny, sprite_get(SPRITE_SNOW_FOOD - 1 + tile->food));
+ else
+ video_draw(screenx, screeny, sprite_get(SPRITE_FOOD - 1 + tile->food));
+ }
screenx += SPRITE_TILE_SIZE;
tile++;
View
23 sdl_sprite.c
@@ -54,10 +54,27 @@ static void sprite_load_background() {
{ 4, 2 }, { 5, 2 }, { 6, 2 }, { 7, 2 },
{ 8, 2 }, { 9, 2 }, { 10, 2 }, { 11, 2 },
{ 12, 2 }, { 13, 2 }, { 14, 2 }, { 15, 2 },
+ // Border Snow
+ { 16, 0 }, { 17, 0 }, { 18, 0 }, { 19, 0 },
+ { 20, 0 }, { 21, 0 }, { 22, 0 }, { 23, 0 },
+ { 24, 0 }, { 25, 0 }, { 26, 0 }, { 27, 0 },
+ { 28, 0 }, { 29, 0 }, { 30, 0 }, { 31, 0 },
+ // Solid Snow
+ { 16, 1 }, { 17, 1 }, { 18, 1 }, { 19, 1 },
+ { 20, 1 }, { 21, 1 }, { 22, 1 }, { 23, 1 },
+ { 24, 1 }, { 25, 1 }, { 26, 1 }, { 27, 1 },
+ { 28, 1 }, { 29, 1 }, { 30, 1 }, { 31, 1 },
+ // Plain Snow
+ { 16, 2 }, { 17, 2 }, { 18, 2 }, { 19, 2 },
+ { 20, 2 }, { 21, 2 }, { 22, 2 }, { 23, 2 },
+ { 24, 2 }, { 25, 2 }, { 26, 2 }, { 27, 2 },
+ { 28, 2 }, { 29, 2 }, { 30, 2 }, { 31, 2 },
// KOTH
{ 0, 3 },
// Water
{ 0, 6 }, { 1, 6 }, { 2, 6 }, { 3, 6 },
+ // Lava
+ { 0, 7 }, { 1, 7 }, { 2, 7 }, { 3, 7 },
};
for (int i = 0; i < SPRITE_NUM_TILES; i++) {
@@ -75,6 +92,12 @@ static void sprite_load_food() {
SDL_Rect srcrect = { f * 16, 256, 16, 16 };
SDL_BlitSurface(gfx, &srcrect, sprites[SPRITE_FOOD + f], NULL);
}
+ for (int f = 0; f < SPRITE_NUM_SNOW_FOOD; f++) {
+ sprites[SPRITE_SNOW_FOOD + f] = SDL_CreateRGBSurface(SDL_HWSURFACE | SDL_SRCALPHA, 16, 16,
+ 32,0xFF000000,0x00FF0000,0x0000FF00,0x000000FF);
+ SDL_Rect srcrect = { f * 16, 256 + 16, 16, 16 };
+ SDL_BlitSurface(gfx, &srcrect, sprites[SPRITE_SNOW_FOOD + f], NULL);
+ }
}
static void sprite_load_thought() {
View
62 sdl_sprite.h
@@ -28,49 +28,65 @@
#define SPRITE_NUM 16384
// Tiles Konstanten
-#define SPRITE_BORDER 0
-#define SPRITE_NUM_BORDER 16
+#define SPRITE_BORDER 0
+#define SPRITE_NUM_BORDER 16
-#define SPRITE_SOLID (SPRITE_BORDER + SPRITE_NUM_BORDER)
-#define SPRITE_NUM_SOLID 16
+#define SPRITE_SOLID (SPRITE_BORDER + SPRITE_NUM_BORDER)
+#define SPRITE_NUM_SOLID 16
-#define SPRITE_PLAIN (SPRITE_SOLID + SPRITE_NUM_SOLID)
-#define SPRITE_NUM_PLAIN 16
+#define SPRITE_PLAIN (SPRITE_SOLID + SPRITE_NUM_SOLID)
+#define SPRITE_NUM_PLAIN 16
-#define SPRITE_KOTH (SPRITE_PLAIN + SPRITE_NUM_PLAIN)
-#define SPRITE_NUM_KOTH 1
+#define SPRITE_SNOW_BORDER (SPRITE_PLAIN + SPRITE_NUM_PLAIN)
+#define SPRITE_NUM_SNOW_BORDER 16
-#define SPRITE_WATER (SPRITE_KOTH + SPRITE_NUM_KOTH)
-#define SPRITE_NUM_WATER 4
+#define SPRITE_SNOW_SOLID (SPRITE_SNOW_BORDER + SPRITE_NUM_SNOW_BORDER)
+#define SPRITE_NUM_SNOW_SOLID 16
+
+#define SPRITE_SNOW_PLAIN (SPRITE_SNOW_SOLID + SPRITE_NUM_SNOW_SOLID)
+#define SPRITE_NUM_SNOW_PLAIN 16
+
+#define SPRITE_KOTH (SPRITE_SNOW_PLAIN + SPRITE_NUM_SNOW_PLAIN)
+#define SPRITE_NUM_KOTH 1
+
+#define SPRITE_WATER (SPRITE_KOTH + SPRITE_NUM_KOTH)
+#define SPRITE_NUM_WATER 4
+
+#define SPRITE_LAVA (SPRITE_WATER + SPRITE_NUM_WATER)
+#define SPRITE_NUM_LAVA 4
#define SPRITE_NUM_TILES (SPRITE_NUM_SOLID + \
SPRITE_NUM_PLAIN + \
SPRITE_NUM_BORDER + \
+ SPRITE_NUM_SNOW_SOLID + \
+ SPRITE_NUM_SNOW_PLAIN + \
+ SPRITE_NUM_SNOW_BORDER + \
SPRITE_NUM_KOTH + \
- SPRITE_NUM_WATER)
-
-// Sprite Nummern bis hier duerfen maximal 255 sein, da diese
-// beim World Netzwerk syncen in Bytes verpackt werden.
+ SPRITE_NUM_WATER + \
+ SPRITE_NUM_LAVA)
#define SPRITE_TILE_SIZE 16
// Food Konstanten
-#define SPRITE_FOOD 256
-#define SPRITE_NUM_FOOD 10
+#define SPRITE_FOOD 256
+#define SPRITE_NUM_FOOD 10
+
+#define SPRITE_SNOW_FOOD (SPRITE_FOOD + SPRITE_NUM_FOOD)
+#define SPRITE_NUM_SNOW_FOOD 10
// Thought Konstanten
-#define SPRITE_THOUGHT (SPRITE_FOOD + SPRITE_NUM_FOOD)
-#define SPRITE_NUM_THOUGHT CREATURE_STATES + 1 /* + Smile */
+#define SPRITE_THOUGHT (SPRITE_SNOW_FOOD + SPRITE_NUM_SNOW_FOOD)
+#define SPRITE_NUM_THOUGHT CREATURE_STATES + 1 /* + Smile */
// Koth Krone
-#define SPRITE_CROWN (SPRITE_THOUGHT + SPRITE_NUM_THOUGHT)
-#define SPRITE_NUM_CROWN 1
+#define SPRITE_CROWN (SPRITE_THOUGHT + SPRITE_NUM_THOUGHT)
+#define SPRITE_NUM_CROWN 1
// Logo
-#define SPRITE_LOGO (SPRITE_CROWN + SPRITE_NUM_CROWN)
-#define SPRITE_NUM_LOGO 1
+#define SPRITE_LOGO (SPRITE_CROWN + SPRITE_NUM_CROWN)
+#define SPRITE_NUM_LOGO 1
-#define SPRITE_CREATURE 512
+#define SPRITE_CREATURE 512
// Creature Konstanten
#define CREATURE_SPRITE(player, type, direction, anim) \
View
31 server.lua
@@ -27,12 +27,9 @@ function Client:joinmenu()
self:writeln("------------------------------")
local numplayers = 0
- for n = 0, MAXPLAYERS - 1 do
- local ok, name = pcall(player_get_name, n)
- if ok then
- numplayers = numplayers + 1
- self:writeln(string.format("%3d - %s", n, name))
- end
+ for pno in each_player() do
+ numplayers = numplayers + 1
+ self:writeln(string.format("%3d - %s", pno, player_get_name(pno)))
end
if numplayers == 0 then
self:writeln("no one here")
@@ -231,18 +228,16 @@ end
function Client:showscores()
local players = {}
- for n = 0, MAXPLAYERS - 1 do
- if player_exists(n) then
- table.insert(players, {
- num = n,
- name = player_get_name(n),
- score = player_score(n),
- creatures = player_num_creatures(n),
- age = (game_time() - player_spawntime(n)) / 1000 / 60,
- mem = player_get_used_mem(n),
- cpu = player_get_used_cpu(n)
- })
- end
+ for pno in each_player() do
+ table.insert(players, {
+ num = pno,
+ name = player_get_name(pno),
+ score = player_score(pno),
+ creatures = player_num_creatures(pno),
+ age = (game_time() - player_spawntime(pno)) / 1000 / 60,
+ mem = player_get_used_mem(pno),
+ cpu = player_get_used_cpu(pno)
+ })
end
table.sort(players, function (a,b)
return a.score > b.score
View
159 world.c
@@ -36,13 +36,16 @@ static int world_h;
static int koth_x;
static int koth_y;
+static int has_plains;
+
// TODO: Jeder Kreaturtype sollte eigene Pfadsuche haben
static map_t *walkmap;
static pathfinder_t finder;
typedef struct maptile_s {
int food;
maptype_e type;
+ mapgfx_e gfx;
} maptile_t;
static maptile_t *map;