diff options
| author | arngo <[email protected]> | 2022-01-25 23:10:35 -0500 |
|---|---|---|
| committer | arngo <[email protected]> | 2022-01-25 23:10:35 -0500 |
| commit | ee4ea2cdb16ee50028a63cc11d9a46eafa40f80a (patch) | |
| tree | 069bdc212a92817da39369d48bfa3b038f1d76a1 /src/levels.rb | |
| parent | 8ce7f2aee71ac457ecc0ff5202cc0364d1d0b6d4 (diff) | |
| download | orc-arena-of-time-ee4ea2cdb16ee50028a63cc11d9a46eafa40f80a.tar.gz orc-arena-of-time-ee4ea2cdb16ee50028a63cc11d9a46eafa40f80a.zip | |
level unloading
Diffstat (limited to 'src/levels.rb')
| -rw-r--r-- | src/levels.rb | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/levels.rb b/src/levels.rb index ef9cbae..abe67c5 100644 --- a/src/levels.rb +++ b/src/levels.rb @@ -9,8 +9,8 @@ level0 = { player_spawn: Rl::Vector2.new(120,300), scissor_size: Path.new( lambda do |time| - [300, - 300] + [250, + 250] end ), scissor_path: Path.new( @@ -75,16 +75,19 @@ FECS::Sys.new('ConstructLevel') do player_ent.component[FECS::Cmp::Player].moved = false FECS::Cmp::ScissorTime.first.time = 0 - # use current_level component to know which level from levels array to load - # create entities e.g. walls - # set properties for scissor box - # set properties for end goal zone - # move player to start end FECS::Sys.new('DestroyLevel') do - # delete all level specific entities and their components - # dont delete entities that carry over to next level + FECS::Cmp::Hitbox.reverse_each do |hitbox_cmp| + unless hitbox_cmp.entities.empty? + next if hitbox_cmp.entity.equal? @player + end + hitbox_cmp.delete + end + + FECS::Cmp::DamageHitbox.reverse_each do |hitbox_cmp| + hitbox_cmp.delete + end end # changing the level will destroy the current level and set up the next one |
