ID:154666
Jan 22 2012, 10:26 am
|
|
How do i code it so i can make it that a player can attack a mob from anywhere? i somehow got it coded so you haveto look up at it to hit it ( i need north sound est wes,t not just north)
|
Jan 22 2012, 11:31 am
|
|
get_step(mob,dir)
|
Okay, so what you want is that you want to attack anything within 1 tile of you, and not just whatever you are facing?
|
mob/verb |
Your question could use a bit more detail.
Avainer1 wrote: mob/verb This is a valid solution if you want the game to automatically turn the mob to face any target in any adjacent tile. mob/verb/Attack(mob/m in get_step(src, dir)) This is another solution. As long as there is only one mob (m) in the tile the player is facing, it will be hit. The get_step() proc returns a turf, and in the verb arguments, the verb searches for mobs inside that turf. If you're using native pixel movement in your game, you will have to utilize a proc that searches obounds() in a given direction relative to the attacker. |