|
-
Oct 10th, 2000, 04:14 AM
#1
Thread Starter
Addicted Member
I got the rotational code written for my game, I can now rotate my units on a map with the right click of a mouse... Now to implement the unit points usage!
There's 8 possible directions - N (1), NE (2), E (3), SE (4), S (5), SW (6), W (7), NW (8). The numbers in brackets are the value of SoldierDirectionValue, an integer.
I have two variables, Soldiers(SelectedSoldier).Direction and Soldiers(SelectedSoldier).UnitPointsAvailible - .Direction is one of the 8 numbers above. Each time you rotate one direction it will cost 1 unit point, eg. if you rotate East to West it will cost 4 unit points, East to South East will cost 1, East to South will cost 2, etc..
However you can only rotate if you have more than 0 points.
Here raises a question.
How do I figure out the best way to turn (anti-clockwise or clockwise), and if I have enough movement points (if I don't I want it to stop and rotate as much as possible with the availible points)?
I want there to be a loop when it rotates, so I can put the graphics code in and also end the loop if it runs out of unit points.
If anyone can help me write this I'd be very happy. =) I've been working on this code for ages but it's just getting more complicated and I don't think it's gunna work anyway... =/
Thanks.
-Git
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|