How to add a sound that an enemy AI can hear?
- by Chris
Given:
a 2D top down game
Tiles are stored just in a 2D array
Every tile has a property - dampen (so bricks might be -50db, air might be -1)
From this I want to add it so a sound is generated at point x1, y1 and it "ripples out". The image below kind of outlines it better. Obviously the end goal is that the AI enemy can "hear" the sound - but if a wall is blocking it, the sound doesn't travel as far.
Red is the wall, which has a dampen of 50db.
I think in the 3rd game tick I am confusing my maths.
What would be the best way of implementing this?