small changes
parent
235acfa122
commit
6a8e5286ea
|
@ -122,14 +122,15 @@ void game_init(int8_t play_mode, uint32_t num_viewers, int32_t seed, uint16_t bl
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(zaklaus): VERY TEMPORARY -- SPAWN SOME NPCS THAT RANDOMLY MOVE
|
// TODO(zaklaus): VERY TEMPORARY -- SPAWN SOME NPCS THAT RANDOMLY MOVE
|
||||||
for (int i = 0; i < 100; i++) {
|
{
|
||||||
ECS_IMPORT(world_ecs(), General);
|
ECS_IMPORT(world_ecs(), General);
|
||||||
ECS_IMPORT(world_ecs(), Controllers);
|
ECS_IMPORT(world_ecs(), Controllers);
|
||||||
ECS_IMPORT(world_ecs(), Physics);
|
ECS_IMPORT(world_ecs(), Physics);
|
||||||
|
uint16_t half_world_dim = world_dim() / 2;
|
||||||
|
for (int i = 0; i < 100; i++) {
|
||||||
uint64_t e = entity_spawn(NULL);
|
uint64_t e = entity_spawn(NULL);
|
||||||
ecs_add(world_ecs(), e, EcsDemoNPC);
|
ecs_add(world_ecs(), e, EcsDemoNPC);
|
||||||
Position *pos = ecs_get_mut(world_ecs(), e, Position, NULL);
|
Position *pos = ecs_get_mut(world_ecs(), e, Position, NULL);
|
||||||
uint16_t half_world_dim = world_dim() / 2;
|
|
||||||
pos->x=rand() % world_dim() - half_world_dim;
|
pos->x=rand() % world_dim() - half_world_dim;
|
||||||
pos->y=rand() % world_dim() - half_world_dim;
|
pos->y=rand() % world_dim() - half_world_dim;
|
||||||
|
|
||||||
|
@ -138,6 +139,7 @@ void game_init(int8_t play_mode, uint32_t num_viewers, int32_t seed, uint16_t bl
|
||||||
v->y = (rand()%3-1) * 100;
|
v->y = (rand()%3-1) * 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int8_t game_is_networked() {
|
int8_t game_is_networked() {
|
||||||
return is_viewer_only;
|
return is_viewer_only;
|
||||||
|
|
Loading…
Reference in New Issue