Hi Majin,
Alright, lets push these doors open...
If you have for example a door with a width of lets say 10 pixels, and your door would be located on the screen at 80,50:
Your door would span from the position 80,50 to position 89,50. To check if the player is close enough to the door to activate the opening of the door, you would open PICEDIT and look up the exact coordinates for the door again. Then you have to specify the space next to the door as a rectangle. In our example, the player should stand in a rectangle from 75,50 (upper left corner of the rectangle) to 95,60 (lower right corner of the rectangle) to be able to open the door. The rectangle is located just below the door.
OK, now for the logic you would use the test command obj.in.box to check if the player (ego) is standing in that specified rectangle.
In the logic script you would make it like this:
if (said("open","door")) {
if(obj.in.box(ego,75,50,95,60)) // checks position of player
print("OK. The door is now open.");
end.of.loop(door_view,f99); // animation of the door
}
else {
print("You are not close enough to the door.");
}
}
Good luck, hope that helped you.
b.o.k.