[Release] Steed Walking

05/03/2011 19:39 Spirited42#16
Quote:
Originally Posted by _DreadNought_ View Post
like
xi = x2
yi = y2

Cant make it more simple then that, its just naming.

Good job spirited, Big difference to Angulius's(?) release.

Thanks mate, glad to see you back. As you know if you ever need help hit me up on msn. :)
Well, I'm leaving the switch statement up because the other method was not my idea and the switch statement shows how the directions relate to walking better. It's not the simplest way to do it though and there are probably many other ways to do it- but the array idea is pretty damn cool, and I think I'm going to use it on many other things besides walking that I've been using switch statements or unnecessary dictionaries *in dictionaries* for.

*edited
05/04/2011 21:29 KraHen#17
Then comment out the switch part in your code and use the array, so you get both readability and efficiency. Though IMO the array method is easier to read and understand.
05/05/2011 00:52 Spirited42#18
Quote:
Originally Posted by KraHen View Post
Then comment out the switch part in your code and use the array, so you get both readability and efficiency. Though IMO the array method is easier to read and understand.
I'm not editing my post. I didn't come up with it, so I shouldn't take the credit. I put a link below it instead.
05/05/2011 14:13 12tails#19
to save some ppl time use this...

Code:
        public static sbyte[] NormalX = new sbyte[8] { 0, -1, -1, -1, 0, 1, 1, 1 };
        public static sbyte[] NormalY = new sbyte[8] { 1, 1, 0, -1, -1, -1, 0, 1 };
        public static sbyte[] SteedX = new sbyte[24] { 0, -2, -2, -2, 0, 2, 2, 2, -1, -2, -2, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 2, 2, 1 };
        public static sbyte[] SteedY = new sbyte[24] { 2, 2, 0, -2, -2, -2, 0, 2, 2, 1, -1, -2, -2, -1, 1, 2, 2, 1, -1, -2, -2, -1, 1, 2 };
cya!