Dash and angled jump coexisting

0 favourites
  • 9 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi everyone!

    My name is Alexandre Belmonte, nice to meet you all! I?m developing a run n gun game with Construct 2, something like Contra, Gunstar Heroes and Metal Slug (awesome games, I recommend!).

    I must say I?m pretty impressed with what C2 can do but I dont?t know much about the program.

    I want my character to dash and when he jumps, his body incline a little. To make this happen I made these events:

    <img src="http://i156.photobucket.com/albums/t10/AlexandreBO/Construct%202/JumpMechanics_zpsd40e0cd2.jpg" border="0" />

    <img src="http://i156.photobucket.com/albums/t10/AlexandreBO/Construct%202/Dash_zps10d7de1b.jpg" border="0" />

    I have many problems with the ?Set angle to X degrees? action:

    * When he landed shooting, sometimes a bullet was spawned forward down. Or on his feet.(?)

    He ?jumped? a little when he dashed, since his origin point was on the center, so I change it to the bottom . But this gave me more headaches:

    * Now everytime he lands he stay like this:

    <img src="http://i156.photobucket.com/albums/t10/AlexandreBO/Construct%202/Onfloor_zps55e3fefd.jpg" border="0" />

    Even more awful:

    <img src="http://i156.photobucket.com/albums/t10/AlexandreBO/Construct%202/Onplataform_zpsa774c8c4.jpg" border="0" />

    * And when o the air he turns very rough Like this:

    <img src="http://i156.photobucket.com/albums/t10/AlexandreBO/Construct%202/AirMovement_zpse596d976.jpg" border="0" />

    Instead of this:

    <img src="http://i156.photobucket.com/albums/t10/AlexandreBO/Construct%202/AirMovementGood_zpsff6cca2d.jpg" border="0" />

    How can I make my character dash and jump inclined without these problems if there is just one origin point?

  • I can see some posible problems in your code (lines 16 and 18) but it would be nice to have a capx to look at, before suggesting changes. Its really tedious to be trying to guess what the problem is instead of looking at it and solving it.

  • Hi lmchucho,

    Thanks for the help! Here it is:

    4shared.com/file/0EVkhfdz/Run_n_Gun.html

  • Wouldn't you just be better having different animations for jumping and dashing and play those when appropriate?

    Also looking at your code, I wouldn't use the sprite as a condition e.g. 16-19 and 23-24. I'd use the player (Skip?) instead and the sprite mirrored/not mirrored/rotation as the action.

  • Hi lmchucho,

    Thanks for the help! Here it is:

    http://www.4shared.com/file/0EVkhfdz/Run_n_Gun.html

    Next time add a before my name when replying, other way I dont get a notice. I found this again by chance. I'll look at the capx now, i'll tell you if fix it.

  • Ouch, you are using r141 and i'm using r139. I cant open the capx, and for some reason when I tell Steam to update my C2 to the latest beta, C2 stops working. :(

  • I made many tests these days but couldn't fix the problem of the protagonist stucking on the plataforms or the bullet spawning forward down, so I will just shrink the hitbox.

    Probably there is a way to make angled jump and dash but I spend too much time in this!

    Zantium:

    My problem was more the hitbox than the visual. I used some old animation I did, just to have some visual. The final game will have another art so I didn't make a jump, dash or even a stand animation.

    Thanks for your help in the condition!

    lmchucho

    That's sucks! But thanks for the tip!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • AlexandreBelmont

    I still think you're trying to do it the hard way, or at leaswt differently than I'd do it.

    For your angled jump animation, just use an angled hit box to fit it and use that instead of trying rotate the existing one.

    Or, instead of using a separate hit box, define one on the animated character itself but stick to the rectangle still for consistent hit detection. This way you could change the hitbox per frame to exactly where you wanted it.

    Oh and on the origin point part for turning in the air, you can set the point differently for each animation frame. You can also add extra points.

  • Zantium

    AlexandreBelmont

    I still think you're trying to do it the hard way, or at leaswt differently than I'd do it.

    For your angled jump animation, just use an angled hit box to fit it and use that instead of trying rotate the existing one.

    Wow! Can I do this? Didn't know I could change the hitbox! I will do some research about that.

    Or, instead of using a separate hit box, define one on the animated character itself but stick to the rectangle still for consistent hit detection. This way you could change the hitbox per frame to exactly where you wanted it.

    You mean when he jumps I use the animation as a hit box?

    Oh and on the origin point part for turning in the air, you can set the point differently for each animation frame. You can also add extra points.

    In my case it's the hitbox that turns and the animation follow the coordinates. Can I program Construct to make the hitbox turns with another point instead the origin point?

    Many thanks for the tips!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)