Mirage Engine
Attacking While Moving - Printable Version

+- Mirage Engine (https://mirage-engine.uk/forums)
+-- Forum: Mirage Source (Nostalgia) (https://mirage-engine.uk/forums/forumdisplay.php?fid=61)
+--- Forum: Archive (2006-2011) (https://mirage-engine.uk/forums/forumdisplay.php?fid=18)
+---- Forum: General (https://mirage-engine.uk/forums/forumdisplay.php?fid=17)
+---- Thread: Attacking While Moving (/showthread.php?tid=1743)



Attacking While Moving - wisefire - 09-05-2008

Well in Mirage when your walking you can press the arrow keys and attack and walk at the same time. I'm wanting to find a way to stop this.

I tried various things in CheckInput but nothing worked. Any ideas?


Re: Attacking While Moving - wisefire - 09-05-2008

Asrrin29 Wrote:There is code in there already to prevent you from casting while moving, take a look at that and see if you can adapt it to attacking as well.

Allright, I messed with it and it works, but its not great. Basicly They can still walk and attack, theres just a delay in between the attacking becuase canmove is false, But after the character attacks, it advances a step and attacks again. But, it looks better. Thanks.


Re: Attacking While Moving - Robin - 10-05-2008

Or just 'Exit Sub' if control is down, and have the directional keys' checks below it.

So:

If ControlDown = True then
attack so on and so forth
exit sub
end if

If DirectionUp....

Something like that.


Re: Attacking While Moving - wisefire - 10-05-2008

Dave Wrote:You could check if an arrow key is down at the same time control is down. Then you could ignore the appropriate key.

I tried that, It didn't work.

Robin, I'll try what you were saying in a moment.