Would it be possible to pass more than one entity through a method?
For example,
entity:overlaps(entity)
map:get_entites("bomb"):overlaps(test)
The function map.get_entities_by_type(type) and other similar functions return an iterator. You can iterate on it to check all collisions at once! (see the Lua API). You can also define your own function, using those functions, and allowing to do things on iterators or lists, but it's not really necessary.
@Diarandor
Thank you for pointing me to the function map.get_entities_by_type(type) (http://www.solarus-games.org/doc/latest/lua_api_map.html#lua_api_map_get_entities_by_type).
I just have to say Solarus is spectacular. It was really that simple. Here is a little working piece of code.
sol.timer.start(1000, function()
for bomb in map:get_entities_by_type("bomb") do
if bomb:overlaps(test) then
test:set_enabled(false)
end
end
return true
end)