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.


Results 1 to 10 of 10

Thread: Math.atan2 shooting Game

  1. #1

    Math.atan2 shooting Game

    Hi everyone,
    I've been wanting to make a type of game where the character can move left to right while the user shoots with the cursor, but I want the arms to be attached to the curcor .. well not attached but is dragged by it.
    At the moment I can't find an example so I hope you all understand me.

    If you could find a tutorial for this type of game please share it with me!
    (Please dont give me tower defense & balloon shoot tutorials Ive seen them and there not like the game I want)

  2. #2
    err...i dont get it exactly... but if you just want a guy who can aim at the mouse with rotating arms, and shoot at it! Then just put the arm inside the chars mc.....if not, explain yourself some more!!
    MY BLOG

    I need a SPRITER who can do pixel arts for an arcade fighter project. If you can help out, please pm me.
    I also need someone who can write simple xml files.


  3. #3
    ok, the char moves with the A and D keys and you shot with the mouse...

    the mouse is a crosshair and the weapons(arms) are always aiming to the mouse
    I played a game like this once, it's was called "abuse".

    i think it's simple to do, it's the same as a normal shooter game(metal slug like) but with 2 simbols(classes) inside 1

    the player has 2 classes in it
    the player has the registry point in the bottom
    the player.arms too
    and the player.body has the registry point where the arms should be fixed(torso);

    the arms part position is the same X and Y of the body
    Code:
    onClipEvent(enterFrame){
        this._x = _parent.body._x;
        this._y = _parent.body._y;
    }
    the arms part has 2 simbols, one inside of the other
    the arms itself and the gfx;

    then you could just make gfx._yscale *=-1 to make it not get upside down;


    -----------
    it's harder than i tought

  4. #4
    Quote Originally Posted by SparK_BR View Post
    ok, the char moves with the A and D keys and you shot with the mouse...

    the mouse is a crosshair and the weapons(arms) are always aiming to the mouse
    I played a game like this once, it's was called "abuse".

    i think it's simple to do, it's the same as a normal shooter game(metal slug like) but with 2 simbols(classes) inside 1

    the player has 2 classes in it
    the player has the registry point in the bottom
    the player.arms too
    and the player.body has the registry point where the arms should be fixed(torso);

    the arms part position is the same X and Y of the body
    Code:
    onClipEvent(enterFrame){
        this._x = _parent.body._x;
        this._y = _parent.body._y;
    }
    the arms part has 2 simbols, one inside of the other
    the arms itself and the gfx;

    then you could just make gfx._yscale *=-1 to make it not get upside down;


    -----------
    it's harder than i tought
    That's exactly what I wana do but I'm sort of a newbie so could you explain in a bit more detail or if it's easier for you add me on AIM or MSN:
    theghettoprincess@hotmail.co.uk

    AIm: Amymationgirl

  5. #5
    ok, i will try to make it
    (i hv a lot of time)

    later i will post the source code for you to take a look

    sorry, i don't hv msn and/or aim
    but i have Google Talk

  6. #6
    Quote Originally Posted by SparK_BR View Post
    ok, i will try to make it
    (i hv a lot of time)

    later i will post the source code for you to take a look

    sorry, i don't hv msn and/or aim
    but i have Google Talk
    Thanks that'd mean alot!

  7. #7

    Fla Box here it is

    there's some comments on the code, in the main parts
    other parts are too simple to put a comment

    i hope it helps

    later i will post the .swf for those who don't want to download the source

    edit: here's the .swf
    http://img225.imageshack.us/my.php?i...onatan2ti3.swf
    Attached Files Attached Files
    Last edited by SparK_BR; July 17th, 2008 at 10:57 PM. Reason: .swf

  8. #8
    Quote Originally Posted by SparK_BR View Post
    there's some comments on the code, in the main parts
    other parts are too simple to put a comment

    i hope it helps

    later i will post the .swf for those who don't want to download the source

    edit: here's the .swf
    http://img225.imageshack.us/my.php?i...onatan2ti3.swf
    Thank you so much you my friend are awesome!

  9. #9
    Quote Originally Posted by Amymation View Post
    Thank you so much you my friend are awesome!
    I enjoyed making the game basis

    and I have somethings here to help you making the shooting thing!

    ps: I never included the .as file, but it will work for sure
    the code I used in the game is almost the same as the .as file

    have fun

    + == &


    edit:
    you will need a platformer engine thing later with side-scrolling! it's cool
    Attached Files Attached Files
    Last edited by SparK_BR; July 30th, 2008 at 06:55 AM.

    "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

  10. #10
    also try the madness game, works the same way. old but well done.
    // AS2 vs. Life?

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