lol,
you would need to work out the x,y, coordinates of the enemy on the screen and then create some kind of a conditional on the door.
____________________________
| ........................|.......................|
|.........................|.......................|
|.........................|...................... |
|.........................|.......................|
|.........................|.......................|
|.........................|.......................|
|...E....................|...............D......|
E= Enemy D= Door
So work out the coordinates of E and then divide the screen in half. If the door is opened when E is on the left handside then he doesn't hear. If the door is opened on the right hand side then he does hear.
pseudo code
(for simplicity let us say that x and y go from 0 to 10)
- Code: Select all
getcoordinate x = x
getcoordinate y = y
//define
opendoor()
if x,y > 5,5
then make enemy chase actor
else
do nothing.
I hope this helps. It's ok by the way to be a newbie and not know any programming code but if you lie and say that you know how to do it then people will just tell you to go away and do it yourself until you can remember. You don't just "forget" code.