The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Page 1 of 2 12 LastLast
Results 1 to 15 of 18

Thread: Need help with RPG

  1. #1

    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 .

    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

  2. #2
    1,627
    posts
    hugeExplosions = true;
    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

    http://www.kirupa.com/forum/showthread.php?t=281507

    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/attachme...5&d=1187856752
    Last edited by Charleh; July 15th, 2008 at 07:21 AM.

  3. #3
    Quote Originally Posted by Charleh View Post
    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

    http://www.kirupa.com/forum/showthread.php?t=281507

    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/attachme...5&d=1187856752
    Cheers mate, will look in to it

  4. #4
    1,627
    posts
    hugeExplosions = true;
    No probs (oh yeah I did actually write that double dragon thing, I even drew the stick man!)

    If you get stuck let me know!
    MS Paint FTW!


  5. #5

    Quote Originally Posted by Charleh View Post
    No probs (oh yeah I did actually write that double dragon thing, I even drew the stick man!)

    If you get stuck let me know!
    _root.Charleh._fansCounter++;

    "A human can interpret missing logic but a computer can't." - wkt
    "That goes into the 'too bad' box." - TOdorus
    "This is a three year old thread, there's no reason to post here..." - flyingmonkey456
    "Despite beeing the oposite, they look very similar to me." - SparK

  6. #6
    OK, I have another question:

    Is there any way to allow an action requiring a trigger, such as a key press, to perform even when the window running the animation is not 'in focus' or selected?

  7. #7
    1,627
    posts
    hugeExplosions = true;
    I'm not sure what you mean by 'the window running the animation'. Do you mean different instances of the flash player/internet explorer - or do you mean different 'windows' within your game?
    MS Paint FTW!


  8. #8
    Yea, different windows, E.g.

    I create and play a flash document, then I open another window, say internet explorer, and with that one selected, I press arrow keys and want the flash document to react to it.

  9. #9
    That's not possible.
    My new hero: Chrysippus
    "Chrysippus is said to have died in a fit of laughter- having given wine to his donkey, he died of laughter after seeing it attempt to eat figs."
    What a legend!

  10. #10
    As Iamthejuggler said, unlikely, but interesting.

    What are you trying to accomplish with this technique? Just curious.

  11. #11
    not possible because
    1. Every key can be used in every program, thus making it too confusing (and if it were possible, it would have millions of variables for various programs NOT to react, each of which must be added)

    And if you want to add health bars to your enemies, all you have to do is add the same coding that you are using on your characters health on them, and just change what's within the if() areas

  12. #12
    1,627
    posts
    hugeExplosions = true;
    Well u can actually peek windows messages and handle them in multiple windows, but I don't think its possible in flash
    MS Paint FTW!


  13. #13
    If you can do it with javascript you may be able to pass those messages to the flash ... i guess it's possible if what charleh says is true. Could be tricky though.
    My new hero: Chrysippus
    "Chrysippus is said to have died in a fit of laughter- having given wine to his donkey, he died of laughter after seeing it attempt to eat figs."
    What a legend!

  14. #14
    flash.net.localConnection

    Edit: if you opened a new window, you'd need a swf in there to handle your key presses, and it would pass those presses back to the other one. Maybe not exactly what you're looking for, but it's still useful to know about.
    Last edited by therobot; August 2nd, 2008 at 12:01 AM.
    you = function(){
    setEnabled( true );
    live();
    setEnabled( false );
    }

  15. #15
    do you want to make a keylogger???

    you can comunicate from an application to other but not intercept keys!

    "A human can interpret missing logic but a computer can't." - wkt
    "That goes into the 'too bad' box." - TOdorus
    "This is a three year old thread, there's no reason to post here..." - flyingmonkey456
    "Despite beeing the oposite, they look very similar to me." - SparK

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012