there is now a player character and the world renders using a cammera
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#include "entity.h"
|
||||
#include "cells.h"
|
||||
#include "vector.h"
|
||||
#include "world.h"
|
||||
|
||||
int EntityMove(entity* e, vec2 pos) {
|
||||
world* world = e->world;
|
||||
|
||||
if(world->wells[at(pos.x,pos.y, world)].cell->flags & (CELL_FLAG_BLOCKING)){
|
||||
return 1;
|
||||
}
|
||||
if(world->wells[at(pos.x,pos.y, world)].entityIds[0] != NULL){
|
||||
return 2;
|
||||
}
|
||||
|
||||
world->wells[at(e->position.x,e->position.y, world)].entityIds[0] = 0;
|
||||
world->wells[at(pos.x,pos.y, world)].entityIds[0] = e;
|
||||
e->position = pos;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user