Browse Source

add map gr, and house pictures

master
milang 11 months ago
parent
commit
70ab42d349
4 changed files with 32 additions and 0 deletions
  1. BIN
      assets-fx/img/houses.png
  2. BIN
      assets-fx/img/wall.png
  3. +19
    -0
      src/map.c
  4. +13
    -0
      src/map.h

BIN
assets-fx/img/houses.png View File

Before After
Width: 128  |  Height: 8  |  Size: 3.1KB

BIN
assets-fx/img/wall.png View File

Before After
Width: 128  |  Height: 8  |  Size: 707B

+ 19
- 0
src/map.c View File

@@ -0,0 +1,19 @@
#include "map.h"

const int dim_x=100;
const int dim_y=100;
static int map[dim_x][dim_y];

int get_item(int x, int y)
{
if (x&~dim_x||y&~dim_y)
return -1;
return map[x][y];
}

void set_item(int x, int y, int item)
{
if (x&~dim_x||y&~dim_y)
return;
map[x][y]=item;
}

+ 13
- 0
src/map.h View File

@@ -0,0 +1,13 @@
#ifndef MAP_H
#define MAP_H

#include <gint/display.h>
extern image_t img_houses;
extern image_t img_wall;

int get_item(int x, int y);
void set_item(int x, int y, int item);



#endif

Loading…
Cancel
Save