ID:156378
 
I know most of you will probably direct me to the guide but I wanted to try and ask anyway.

So im making a game and it has states for attacking and walking and all that. I was wondering how would i code it.

mob/attack(mob/M as mob in oview(1))
if(M.HP <= 0)
usr << "[M] is already dead!"
else
usr << "You attack [M]!"
icon = 'XXX'
icon_state = "attack"
sleep(10)
icon = 'XXX'
icon_state = "Norm"



thats the way I think it would be done but im not sure.
Some of the code may be incorect because its been a while since iv coded icons but yea its an rough draft.
flick()
Unless your attack icon states are in a different dmi file, I don't think you need to change icon. and unless you want only 10 frames of the icon it to show, you should just use flick, and adjust the frames in the movie itself.