Having the PC icon face different directions

Chris H.'s Ultima / ACS-style game development system!

Moderators: Ice Cream Jonsey, joltcountry

rld
Posts: 223
Joined: Sun Jan 25, 2009 2:17 am
Location: Dallas, TX

Having the PC icon face different directions

Post by rld »

Garth's Equipment Shop wrote:I wonder if there is a way to use something like this to have the PC icon change according to which direction the PC last moved in. So that you could have four different versions of the PC representing the PC facing in each of the four directions, N,S,E,W. Or Up,Down,Right,Left. That is the only thing that really annoys me about this old tile based 2d top-down style RPG. What I find most difficult is trying to figure out a way to draw critter, PC/NPC icons so they look right whichever direction they are moving in.
I haven't tried this out, but I think you could also implement this (for the player at least) by checking LOC[x] and LOC[y] each turn in the step macro against a pair of variables that contain the LOC[x] and LOC[y] values from the previous turn. So, if LOC[x] - (old LOC[x]) = 1, for example, the player just moved east and you can set the icon accordingly.

There would be a couple of special cases to check against (the player might have just gone through a portal, for instance), and the coding might be a bit tricky because I'm not sure if macro variables in ACK are allowed to go negative (I think they are all unsigned type).

User avatar
Garth's Equipment Shop
Posts: 638
Joined: Fri Dec 05, 2008 5:55 pm
Location: Festering Foothills
Contact:

Post by Garth's Equipment Shop »

Thanks for making a separate topic for this. And thanks for the tips. I'm going to experiment with this.
Which of you is interested in my fine wares?

Post Reply