ID:155114
 
Hi there Developer How-To. I'm trying to create some traps that activate if you enter the same x or y plane as them (think these fellows from Zelda). I've surmised I'd need to use a while()> look and check if a player is in the same column or row of turfs as the trap is.

Problem is I'm not entirely sure how to write up such a proc.
<dm>
if(player.x == trap.x) // player is lined up vertically
if(player.y == trap.y) // player is lined up horizontally
Well, I'm a total noob, but here's how I would approach it.

We could use the block() procedure if we knew how far along the axis we are going. But unless you hard-code the length, it's not going to work as well as one would like. So I think that spawning an invisible object to walk out from the object and upon bumping, sending the information back to the trap, telling it to move.
In response to Kaiochao (#1)
...I really overthought this one. Woops.