Friction, velocity, rendering
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user