Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for _, entity in pairs(Isaac.GetRoomEntities()) do -- go through every entity in the room
- if entity.Type ==
- and entity.Variant == then -- look for your shield entity
- local shield = entity
- -- you found your shield entity
- for _, entities in pairs(Isaac.GetRoomEntities()) do -- go through every entity in the room again
- if entities.Type == EntityType.ENTITY_PROJECTILE then -- look for enemy projectile.
- local shot = entities
- -- check collision
- if (shot.Position - shield.Position):Length() <= shot.Size + shield.Size then
- -- remove projetile if it is one the same position than the shield
- shot:Remove()
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment