Code:
Problem description:
I plan to implement an attack verb attacking the mob directly in front of the user's current position. I've successfully made a verb that attacks 1 tile away, but it does so in every direction, rather than only the direction it is faced in. How could I make it so that the verb only affects the mob the user is facing, rather than any mob only 1 step away, regardless of direction. I can think of at least one way myself, but it would require excessive amounts of typing, and I'd like to keep the code as short as possible. Any suggestions?
![]() Aug 25 2014, 3:39 pm
Best response
|
|
You can locate() a mob that's in front of you with 'in get_step(ref, dir)'.
|