|
|
|
 |
Posted 2005-11-23, 06:54 PM
in reply to Sovereign's post starting "Check his profile for contact..."
|
 |
 |
 |
I just check in every once in a while to see if anyone needs things, but usually this forum is dead for the most part.
Anyway, I'm not sure how that applies to any hack and slash game, nor what kinds of skills we are talking about here (which DOES affect how the code is done and routines that are needed - stuff like damage checking and movement skills are completely different and require different routines). Also the way they are gotten is important - are they simply "level" based (and go in a straight line from "Crappy Stab" to "Awesome Super Slash") or do you get them in random orders depending on what you do/read/buy/etc. That would affect whether or not you'd use a variable or a ton of switches.
The general gist is to make sure all skills are evenly spaced (not just for looks, but for coding purposes as well). Then you'd take input and simply change a number - if you hit right, you add 10, if you hit up, you subtract 1, etc. So it would be something like this:
11 21 31 41
12 22 32 42
13 23 33 43
14 24 34 44
etc. Easy enough. You'd then figure out where to place a "cursor" for selection purposes based on a multiple of something like "VirtX = VirtualCoordinates / 10" and "VirtY = VirtualCoordinates MOD 10" to find the virtual coordinates, and map those to whatever you want, like "RealX = VirtX * 15" and then use THOSE to tell where the selection picture is. Sounds complicated, but it's actually much simpler to do this and simply calculate where you are then having it directly say where it is for 40 things with a branch for each (and then branch AGAIN when it's selected).
On a skill selection, you'd just take the number (32, 41, whatever) and go through and do a long list of branches to figure out what to do at that point, whether it be damage or not. Not much of a way around this one.
Edit: Should probably draw a picture or something, the muliplying is tough to visualize unless you've done it before
|
 |
 |
 |
|
|
|
|
|
|
|