Need help with RPG

Hi everyone, I am relatively new to Flash and Kirupa so bear with me.
While completing various tutorials I have decided to slowly develop a birds-eye view real-time RPG. It has no major plans, as I am just adding to it as I learn, and i do not want to get too far ahead of myself with goals and flowcharts etc.

At the moment I have managed to get a movement system going, with the WASD keys controling Up, Down, Left, Right movement, and the mouse rotating the upper body (and hence aiming the attacks).

My next aim is to create a simple combat system, where if the weapon hits a target, the target takes damage/dies, for now i will keep it simple and just want to get it working. I have tried using hit tests, where if the weapon hits an enemy, the enemy plays its death animation. I am sure this method is inferior and my lack of Flash knowledge and experience limits me to this, and therefore there are a lot of bugs, such as hits can be true without the weapon even touching the enemy :D.

I have googled around for a tutorial on this kind of combat system but have not succeeded.

If anyone could propose an alternative idea with a link to appropriate code/tutorial, i would very much appreciate it.

Thank you for your patience and guidance :slight_smile:

Well one idea would be to create an ‘attack area’ in which you test for hits on certain frames of the swinging animation. The problem with the sword hittest is you need to limit it to make sure it’s not ‘hitting’ on frames it’s not supposed to - also multiple hits should be taken into account - do you ignore multiple enemies that are hit by the same stroke or do you hit them all?

You might want to create your own bounding boxes for all the objects which can be tested against each other - that way you have more control than just using in-built hittest methods

I’ve got some tuts on creating a shooter game - in fact I didn’t finish it, though the basecode can be used, you can take the BoundingBox class and add that to your game classes. It just uses simple axis aligned boxes and does intersection tests between them, very very simple.

Here’s the link

Oops, I forgot I used radius checking in that game not bounding boxes… hang on let me dig a class up

Hmm I can’t find my BoundingBox class on the site yet, though I did find a small game example which uses something you might be interested in - it’s a double dragon style game but when the character attacks you can see the ‘attack areas’, you could use those for the hit tests, though you would still need an area such as a radius check or a bounding box to check against each enemy

http://www.kirupa.com/forum/attachment.php?attachmentid=43905&d=1187856752

[quote=Charleh;2358894]Well one idea would be to create an ‘attack area’ in which you test for hits on certain frames of the swinging animation. The problem with the sword hittest is you need to limit it to make sure it’s not ‘hitting’ on frames it’s not supposed to - also multiple hits should be taken into account - do you ignore multiple enemies that are hit by the same stroke or do you hit them all?

You might want to create your own bounding boxes for all the objects which can be tested against each other - that way you have more control than just using in-built hittest methods

I’ve got some tuts on creating a shooter game - in fact I didn’t finish it, though the basecode can be used, you can take the BoundingBox class and add that to your game classes. It just uses simple axis aligned boxes and does intersection tests between them, very very simple.

Here’s the link

Oops, I forgot I used radius checking in that game not bounding boxes… hang on let me dig a class up

Hmm I can’t find my BoundingBox class on the site yet, though I did find a small game example which uses something you might be interested in - it’s a double dragon style game but when the character attacks you can see the ‘attack areas’, you could use those for the hit tests, though you would still need an area such as a radius check or a bounding box to check against each enemy

http://www.kirupa.com/forum/attachment.php?attachmentid=43905&d=1187856752[/quote]

Cheers mate, will look in to it :wink: