Rename buildings to building_factory, randomize unit place position
This commit is contained in:
@@ -20,8 +20,8 @@ add_executable(PixelDefense
|
||||
|
||||
game/ai_actions.c
|
||||
game/ai_actions.h
|
||||
game/buildings.c
|
||||
game/buildings.h
|
||||
game/building_factory.c
|
||||
game/building_factory.h
|
||||
game/components.c
|
||||
game/components.h
|
||||
game/constants.h
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "game_state.h"
|
||||
#include "components.h"
|
||||
#include "systems/systems.h"
|
||||
#include "buildings.h"
|
||||
#include "building_factory.h"
|
||||
|
||||
#include <raymath.h>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "buildings.h"
|
||||
#include "building_factory.h"
|
||||
|
||||
#include "components.h"
|
||||
#include "entity_factory.h"
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef PIXELDEFENSE_BUILDINGS_H
|
||||
#define PIXELDEFENSE_BUILDINGS_H
|
||||
#ifndef PIXELDEFENSE_BUILDING_FACTORY_H
|
||||
#define PIXELDEFENSE_BUILDING_FACTORY_H
|
||||
|
||||
#include <breeze.h>
|
||||
#include <flecs.h>
|
||||
@@ -19,4 +19,4 @@ bool canAffordBuilding(BuildingType type, PlayerResources res);
|
||||
|
||||
Vector2 getPositionNearBuilding(ecs_entity_t building, Vector2 fromPos);
|
||||
|
||||
#endif //PIXELDEFENSE_BUILDINGS_H
|
||||
#endif //PIXELDEFENSE_BUILDING_FACTORY_H
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "input.h"
|
||||
#include "map_init.h"
|
||||
#include "map_layers.h"
|
||||
#include "buildings.h"
|
||||
#include "building_factory.h"
|
||||
#include "ui_widgets.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <flecs.h>
|
||||
|
||||
#include "buildings.h"
|
||||
#include "building_factory.h"
|
||||
#include "components.h"
|
||||
#include "entity_factory.h"
|
||||
#include "game_state.h"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "../game_state.h"
|
||||
#include "../input.h"
|
||||
#include "../buildings.h"
|
||||
#include "../building_factory.h"
|
||||
#include "../pathfinding.h"
|
||||
|
||||
#include <rlImGui.h>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "../input.h"
|
||||
#include "../map_init.h"
|
||||
#include "../ui_widgets.h"
|
||||
#include "../buildings.h"
|
||||
#include "../building_factory.h"
|
||||
#include "../utils.h"
|
||||
#include "../entity_factory.h"
|
||||
|
||||
@@ -189,7 +189,8 @@ void drawGameUI(Game *game, f32 dt) {
|
||||
(building.pos.x + building.size.x * 0.5f) * 16.0f,
|
||||
(building.pos.y + building.size.y + 0.5f) * 16.0f
|
||||
};
|
||||
//placePos = GetWorldToScreen2D(placePos, game->camera);
|
||||
placePos.x += GetRandomValue(-16, 16);
|
||||
placePos.y += GetRandomValue(-4, 4);
|
||||
PlayerResources playerRes = game->playerResources[game->player];
|
||||
switch (building.type) {
|
||||
case BUILDING_KEEP: {
|
||||
|
||||
Reference in New Issue
Block a user