diff options
| author | realtradam <[email protected]> | 2023-05-30 06:13:42 -0400 |
|---|---|---|
| committer | realtradam <[email protected]> | 2023-05-30 06:13:42 -0400 |
| commit | 91e22bf324b34ef2e66dcec73f2cd85cf8887ef5 (patch) | |
| tree | 245fce2d710b4f7397171bee1d610124d2c56f45 | |
| parent | bc1d804c8a5e5e126c492f29a1d1e8d70d1cb66a (diff) | |
| download | TOJam2023-91e22bf324b34ef2e66dcec73f2cd85cf8887ef5.tar.gz TOJam2023-91e22bf324b34ef2e66dcec73f2cd85cf8887ef5.zip | |
fix ghosts so they phase through walls
| -rw-r--r-- | src/enemies.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/enemies.c b/src/enemies.c index 74bd0c5..0f545cc 100644 --- a/src/enemies.c +++ b/src/enemies.c @@ -39,19 +39,22 @@ deinit_enemies(void) enemy_t* spawn_enemy(float x, float y) { - rodeo_collision_2d_world_item_t enemy_collision = (rodeo_collision_2d_world_item_t){.x = x, .y = y, .width = 40, .height = 40}; - world_id id = rodeo_collision_2d_world_item_create(&collision_enemies_world, enemy_collision)->id; uint64_t rng = rodeo_random_uint64_get(); - - cvec_enemy_t *enemy_collision_world = &enemies; + cvec_enemy_t *enemy_obj_world = &enemies; + rodeo_collision_2d_world_t *enemy_collision_world = &collision_enemies_world; + if(rng % 3 == enemy_weapon_basic) { - enemy_collision_world = &ghosts; + enemy_obj_world = &ghosts; + enemy_collision_world = &collision_ghosts_world; } + rodeo_collision_2d_world_item_t enemy_collision = (rodeo_collision_2d_world_item_t){.x = x, .y = y, .width = 40, .height = 40}; + world_id id = rodeo_collision_2d_world_item_create(enemy_collision_world, enemy_collision)->id; + return cvec_enemy_t_push( - enemy_collision_world, + enemy_obj_world, (enemy_t){ .hp = 20.0, .move_speed = ((float)(rng % 3) + 1.0f) * 0.3f, @@ -87,7 +90,7 @@ draw_enemy(cvec_collision_2d_world_item_value *enemy) { texture = &amonghost_texture; color = (rodeo_color_RGBAFloat_t){ - .array = { 0.25f, 0.95f, 0.25f, 0.6f } + .array = { 0.25f, 0.95f, 0.25f, 0.5f } }; } break; |
