idk
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "rpg.h"
|
||||
#include "entity/entity.h"
|
||||
#include "rpg/world/world.h"
|
||||
#include "time/time.h"
|
||||
#include "rpgcamera.h"
|
||||
#include "util/memory.h"
|
||||
@@ -14,8 +15,13 @@
|
||||
errorret_t rpgInit(void) {
|
||||
memoryZero(ENTITIES, sizeof(ENTITIES));
|
||||
|
||||
// Init the world.
|
||||
worldInit();
|
||||
|
||||
// Initialize the camera
|
||||
rpgCameraInit();
|
||||
|
||||
// TEST: Create some entities.
|
||||
entity_t *ent;
|
||||
ent = &ENTITIES[0];
|
||||
entityInit(ent, ENTITY_TYPE_PLAYER);
|
||||
@@ -27,18 +33,26 @@ errorret_t rpgInit(void) {
|
||||
entityInit(ent, ENTITY_TYPE_NPC);
|
||||
ent->position[0] = 6, ent->position[1] = 6;
|
||||
|
||||
// All Good!
|
||||
errorOk();
|
||||
}
|
||||
|
||||
void rpgUpdate(void) {
|
||||
if(!TIME.fixedUpdate) return;
|
||||
|
||||
// TODO: Do not update if the scene is not the map scene?
|
||||
|
||||
// Update the world.
|
||||
worldUpdate();
|
||||
|
||||
// Update overworld ents.
|
||||
entity_t *ent = &ENTITIES[0];
|
||||
do {
|
||||
if(ent->type == ENTITY_TYPE_NULL) continue;
|
||||
entityUpdate(ent);
|
||||
} while(++ent < &ENTITIES[ENTITY_COUNT]);
|
||||
|
||||
// Update the camera.
|
||||
rpgCameraUpdate();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user