Dash and angled jump coexisting

Get help using Construct 2

Post » Fri Aug 16, 2013 1:36 am

Hi everyone!

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

I must say Im pretty impressed with what C2 can do but I dontt 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:





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:



Even more awful:



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


Instead of this:



How can I make my character dash and jump inclined without these problems if there is just one origin point?AlexandreBelmont2013-08-16 01:39:03
B
7
S
2
G
1
Posts: 13
Reputation: 1,101

Post » Fri Aug 16, 2013 5:13 am

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.
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Sun Aug 18, 2013 10:31 pm

Hi lmchucho,

Thanks for the help! Here it is:

http://www.4shared.com/file/0EVkhfdz/Run_n_Gun.html
B
7
S
2
G
1
Posts: 13
Reputation: 1,101

Post » Sun Aug 18, 2013 11:01 pm

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.
B
14
S
3
G
2
Posts: 59
Reputation: 2,180

Post » Mon Aug 19, 2013 4:28 am

[QUOTE=AlexandreBelmont] Hi lmchucho,

Thanks for the help! Here it is:

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

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.
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Mon Aug 19, 2013 4:31 am

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. :(
B
10
S
4
Posts: 133
Reputation: 1,543

Post » Thu Aug 29, 2013 1:05 am

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!
B
7
S
2
G
1
Posts: 13
Reputation: 1,101

Post » Thu Aug 29, 2013 9:11 pm

@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.Zantium2013-08-29 21:15:30
B
14
S
3
G
2
Posts: 59
Reputation: 2,180

Post » Fri Aug 30, 2013 2:53 pm

@Zantium

[QUOTE=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.[/QUOTE]

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

[QUOTE=Zantium]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.[/QUOTE]

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

[QUOTE=Zantium]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.[/QUOTE]

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!AlexandreBelmont2013-08-30 14:54:35
B
7
S
2
G
1
Posts: 13
Reputation: 1,101


Return to How do I....?

Who is online

Users browsing this forum: TRMG and 41 guests