Math behind a sine curve

Get help using Construct 2

Post » Mon Jun 04, 2012 4:16 am

O'hoy fellow Scir'vees!

I have this top down game in which I want the player to be able to jump. Since there is no jump or height function in the 8 directions behvaiour I needed to hack something together myself and thus my following conundrum..

I created an invisible sine object do to a nice sine curve for me when you press the jump key, however, there's not way to reset the oscillation, the curve always starts where it was inactivated, making it quite a hassle to get it to work right. So I decided to just do a nice sine expression myself... I'm incredibly inexperienced when it comes to this type of math though so...

How do I make an expression that has an initial force that de-accelerate to 1 and then accelerate to 0? (faking gravity after a jump etc)

~BJulmust2012-06-04 04:18:45
B
17
S
6
G
6
Posts: 100
Reputation: 4,885

Post » Tue Jul 03, 2012 1:13 am

The simplest way I can think of add jumping to 8direction movement is to use a hidden object with the platform behavior to get your jump height from and set it up like this:
http://dl.dropbox.com/u/5426011/examples12/8dir_jump.capx

B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Tue Jul 03, 2012 2:00 am

That is very simple indeed :) Thanks!
B
17
S
6
G
6
Posts: 100
Reputation: 4,885


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests