summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorarngo <[email protected]>2023-05-27 18:19:22 -0400
committerarngo <[email protected]>2023-05-27 18:19:22 -0400
commit95ac4162cb0b29be6d3cea07af37d0c6eafe6ac2 (patch)
tree8c31c8c584a1808275ea85d41c2b1400d5f162a5
parenta0dc49aa2f18b7454de89cf8fb103688d6a24162 (diff)
downloadrodeo_sample_game-95ac4162cb0b29be6d3cea07af37d0c6eafe6ac2.tar.gz
rodeo_sample_game-95ac4162cb0b29be6d3cea07af37d0c6eafe6ac2.zip
fix bullet offset
-rw-r--r--src/player.c9
-rw-r--r--src/sprite.c4
2 files changed, 4 insertions, 9 deletions
diff --git a/src/player.c b/src/player.c
index 55c6d38..fe413f6 100644
--- a/src/player.c
+++ b/src/player.c
@@ -142,8 +142,8 @@ player_shoot(rodeo_collision_2d_world_t *bullet_collision_world)
for(uint32_t i = 0; i < bullet_per_frame; ++i)
{
spawn_bullet(
- (float)player_position->x - (orc_size[0] / 2.0f),
- (float)player_position->y - (orc_size[1] / 2.0f),
+ (float)player_position->x + (orc_size[0] / 2.0f) - 9.0f,
+ (float)player_position->y + (orc_size[1] / 2.0f) - 16.0f,
(float)((int8_t)(rodeo_random_uint64_get() % 10) - 5),
(float)((int8_t)(rodeo_random_uint64_get() % 10) - 5),
bullet_collision_world,
@@ -225,11 +225,6 @@ void player_wall_resolver(
p->dx = 0;
p->dy = 0;
}
- rodeo_log(
- rodeo_logLevel_info,
- "%d collided with %d",
- p->id.id, w->id.id
- );
}
void
diff --git a/src/sprite.c b/src/sprite.c
index c1c88f6..a46f1d0 100644
--- a/src/sprite.c
+++ b/src/sprite.c
@@ -7,8 +7,8 @@ draw_sprite(sprite_t *sprite, float x, float y, float scale)
{
rodeo_texture_2d_draw(
&(rodeo_rectangle_t){
- .x = x - ((float)sprite->config.width * scale / 2),
- .y = y - ((float)sprite->config.height * scale / 2),
+ .x = x,// - ((float)sprite->config.width * scale / 2),
+ .y = y,// - ((float)sprite->config.height * scale / 2),
.width = (float)sprite->config.width * scale,
.height = (float)sprite->config.height * scale
},