Switched to using tile coordinates, losing my angled movement unfortunately.
This commit is contained in:
@@ -44,16 +44,18 @@ void renderOverworldDraw(void) {
|
||||
meshDraw(&chunk->meshBase, -1, -1);
|
||||
}
|
||||
|
||||
|
||||
for(uint8_t i = 0; i < ENTITY_COUNT_MAX; i++) {
|
||||
entity_t *entity = &ENTITIES[i];
|
||||
if(entity->type == ENTITY_TYPE_NULL) continue;
|
||||
|
||||
float_t x = (entity->x * TILE_WIDTH_HEIGHT) + entity->subX;
|
||||
float_t y = (entity->y * TILE_WIDTH_HEIGHT) + entity->subY;
|
||||
|
||||
// Draw the entity
|
||||
spriteBatchPush(
|
||||
NULL,
|
||||
floorf(entity->x), floorf(entity->y),
|
||||
floorf(entity->x + TILE_WIDTH_HEIGHT), floorf(entity->y + TILE_WIDTH_HEIGHT),
|
||||
x, y,
|
||||
x + TILE_WIDTH_HEIGHT, y + TILE_WIDTH_HEIGHT,
|
||||
0xFF, 0x00, 0xFF, 0XFF,
|
||||
0.0f, 0.0f, 1.0f, 1.0f
|
||||
);
|
||||
|
Reference in New Issue
Block a user