Add tree test map, fix easing system

This commit is contained in:
2024-01-07 09:32:36 +01:00
parent 6884619f05
commit 07e03702ad
6 changed files with 730 additions and 5 deletions

View File

@@ -402,7 +402,6 @@ static void renderGame(Game *game, float dt) {
bzTileMapDrawCollisions(&game->map);
if (game->debugDraw.spatialGrid)
bzSpatialGridDrawDebugGrid(game->entityGrid);
drawPlayerInputUI();
EndMode2D();
@@ -514,7 +513,7 @@ static void renderMainMenu(Game *game, float dt) {
if (uiMainMenuButton("Play")) {
game->screen = SCREEN_GAME;
unloadMap(game);
loadMap(game, "assets/maps/map_01.tmj");
loadMap(game, "assets/maps/tree_test.tmj");
}
if (uiMainMenuButton("Settings")) {
game->screen = SCREEN_SETTINGS;

View File

@@ -30,7 +30,7 @@ bool initEntityObjectsLayer(BzTileMap *map, BzTileObjectGroup *objectGroup) {
if (!objectTileset) return true;
for (i32 i = 0; i < objectGroup->objectCount; i++) {
if (i == 1) break;
//if (i == 1) break;
BzTileObject object = objectGroup->objects[i];
Position pos = (Position) { object.shape.x, object.shape.y };
entityCreateWorker(pos, game);

View File

@@ -75,7 +75,7 @@ void updateEasingSystem(ecs_iter_t *it) {
x = e->easeStart + e->easeTarget * x + e->easeOffset;
// Outer
x = e->start + e->target * x + e->offset;
easing->x = x;
easing[i].x = x;
u8 *compData = ecs_get_mut_id(ECS, entity, easing[i].compID);
compData += easing[i].memberOffset;

View File

@@ -14,7 +14,7 @@ i32 harvestEvent(ecs_entity_t entity, HarvestEvent event) {
.duration = 0.6f,
// 45 * (1.0f + (-1.0f) * x)
.target = 45,
.target = GetRandomValue(30, 55) * GetRandomValue(1, 2) - 1,
.easeTarget = -1.0f,
.easeStart = 1.0f
});