TutorialsThese are old tutorials from Gaming World (2005 and before I believe), which are text documents because the old mainsite doesn't exist anymore. I just put some stuff related to ABS' there, I did not check how good/bad they are or if they rely on pictures which are no longer present, but it might still be useful. Check them out and see if they help.
Also, Shift key is 7, and it does work for me.
What I usually do is whenever the hero uses the attack key (I use the enter key for that), I turn on an attack switch. Then I get the heros x and y values, and the x and y values for the enemy character sprites. For ranged attacks, I determine if I want fixed value or not. Then you could do something like this:
If Hero is facing right
If Hero Y = Enemy 1 Y
If Hero X + Range >= Enemy 1 X
If Hero X < Enemy 1 X
Does damage to enemy, flash enemy, kills them if their HP variable is 0
then do something similar for the other directions/enemies.
Basically what this is doing, if the hero is facing right, the enemy has to have the same Y variable or else they'll be higher or lower on the map and you shouldn't be able to reach them. If the Hero X + range is greater than or equal to Enemy 1 X, and the Hero X is less than the Enemy 1 X, that means that the enemy is in between you and the maximum range. Try that out with some values:
If Hero X is 16 and hero range is 4, and the Enemy 1 X is 19...
Hero X + range = 20. 20 >= 19 so the enemy falls in there. But now to make sure they aren't behind you... Enemy 1 X is not less than 16, so they are able to be attacked.
I won't do the same for the other directions, so plug in some values and try it out. They are not exactly the same code. If you are facing left, the Hero X - range has to be less than the Enemy X, while Hero X has to be greater than Enemy X. It would be best to look at the map, place an example and try to calculate it so you get what I'm doing here. X and Y are 0 at the top left corner, and are highest at the bottom right corner, so keep that in mind.
There's probably a better way of doing that too, I think one of the tutorials there might have it, that's just a way I used to do it a while ago.