Friction, velocity, rendering

This commit is contained in:
2025-10-09 09:44:17 -05:00
parent c31bcf7f6a
commit 7622f81309
7 changed files with 93 additions and 75 deletions

View File

@@ -12,11 +12,12 @@
#include "rpg/entity/entity.h"
#include "display/screen.h"
#define TILE_WIDTH 1
#define TILE_WIDTH 8
#define TILE_HEIGHT TILE_WIDTH
errorret_t sceneMapInit(scenedata_t *data) {
cameraInitPerspective(&data->sceneMap.camera);
data->sceneMap.camera.projType = CAMERA_PROJECTION_TYPE_PERSPECTIVE_FLIPPED;
errorOk();
}
@@ -25,7 +26,7 @@ void sceneMapUpdate(scenedata_t *data) {
}
void sceneMapRender(scenedata_t *data) {
const float_t camOffset = 12.0f;
const float_t camOffset = 32.0f;
const float_t pixelPerfectOffset = tanf(
data->sceneMap.camera.perspective.fov / 2.0f
) * ((float_t)SCREEN.height / 2.0f);
@@ -56,6 +57,8 @@ void sceneMapRenderEntity(const entity_t *entity) {
float_t x = worldChunkPosToF32(entity->position[0], TILE_WIDTH);
float_t y = worldChunkPosToF32(entity->position[1], TILE_HEIGHT);
x -= TILE_WIDTH * 0.5f;
y -= TILE_HEIGHT * 0.5f;
spriteBatchPush(
NULL,