+/* Initializer function */
+
+__attribute__ ((constructor)) static void init()
+{
+ wall = (struct material) {
+ .solid = true,
+ .color = get_color("#5B2F00"),
+ };
+
+ air = (struct material) {
+ .solid = false,
+ .color = get_color("#FFE027"),
+ };
+
+ outside = (struct material) {
+ .solid = true,
+ .color = black,
+ };
+
+ player = (struct entity) {
+ .name = "player",
+ .x = MAP_WIDTH / 2,
+ .y = MAP_HEIGHT / 2,
+ .color = get_color("#00FFFF"),
+ .texture = "🙂",
+ .remove = false,
+ .meta = NULL,
+ .health = 10,
+ .max_health = 10,
+ .collide_with_entities = true,
+
+ .on_step = NULL,
+ .on_collide = NULL,
+ .on_collide_with_entity = NULL,
+ .on_spawn = NULL,
+ .on_remove = NULL,
+ .on_death = &player_death,
+ .on_damage = &player_damage,
+ };
+
+ entity_collision_map[player.x][player.y] = &player;
+
+ for (int x = 0; x < MAP_WIDTH; x++)
+ for (int y = 0; y < MAP_HEIGHT; y++)
+ map[x][y] = (struct node) {&wall};
+
+ register_input_handler('q', (struct input_handler) {
+ .run_if_dead = true,
+ .callback = &quit,
+ });
+
+ register_render_component(&render_map);
+
+ damage_overlay_color = get_color("#F20000");
+}
+