mirror of https://git.sr.ht/~kikoodx/momento
42 lines
858 B
C
42 lines
858 B
C
/* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
/* Copyright (C) 2021 KikooDX */
|
|
#pragma once
|
|
|
|
#define LEVEL_WIDTH 25
|
|
#define LEVEL_HEIGHT 14
|
|
#define LEVEL_SIZE (LEVEL_WIDTH * LEVEL_HEIGHT)
|
|
#define KBLE_FORMAT_VERSION 0
|
|
#define KBLE_HEADER_LEN 6
|
|
|
|
typedef unsigned int Tile;
|
|
|
|
struct VisualTile {
|
|
int visible;
|
|
int x;
|
|
int y;
|
|
int texture_x;
|
|
int texture_y;
|
|
};
|
|
|
|
struct Level {
|
|
Tile data[LEVEL_WIDTH * LEVEL_HEIGHT];
|
|
struct VisualTile visual_data[LEVEL_WIDTH * LEVEL_HEIGHT];
|
|
int water_level;
|
|
int water_timer;
|
|
int width;
|
|
int height;
|
|
int gold;
|
|
int exit_locked;
|
|
int id;
|
|
};
|
|
|
|
extern struct Level level;
|
|
|
|
/* need to set global before call: level_id */
|
|
void level_load_bfile(void);
|
|
void level_load_binary(void);
|
|
void level_update(void);
|
|
void level_draw(void);
|
|
Tile level_get_tile(int x, int y);
|
|
int level_is_water(int x, int y);
|