moved player and enemy death logic to entity prototype