ID:176586
 
How do i make it that if a player clicks Attack that if they are facing up the "up" attack animation shows? I need the same for the left,right,and down. Also how do i do if a player lays a bomb that the bomb lays in front of him? Btw im making a Zelda game.
It should automatically do it if you have a 4 direction icon state labeled attack in your player's icon, and you flick the attack animation when you click attack. As for the bomb, I would guess it would be an "if" statement calling the player's direction variable, then setting the bomb 32 pixels in the direction the player is facing. Like to detect:

mob/verb/bomb()
if(dir == North)
//generate the bomb here one tile north of the mob.
if(die == South)
//etc, etc.
In response to Hepitank
thx and for the bomb how do i lay it 1 square away from the dude?
In response to Leahcim
well instead of doing if(usr.dir = stuff....) u can use the get_step proc. like this
mob/verb/attack()
var/obj/sword/s = new/obj/sword(get_step(usr,usr.dir))//this creates teh obj in front of them.
sleep(5)
del(s)//wait a bit and hten delete the sword

so lets say you want to make it so that the obj does damage only when it HITS a mob.
obj/sword
icon = 'sword.dmi'//icon
New(Loc)
for(var/mob/M in Loc)
M.HP-= rand(1,10)//assuming u have a HP var
M.DeathCheck()//assuming u have a deatcheck proc
and that should do what you want you might also wanna add in like flick iconstates and stuff