Rocket backpack

For questions about using Classic.

Post » Thu Nov 17, 2011 2:46 pm

Hi there, I'm trying to provide protagonist with a rocket backpack, but got stuck trying to achieve smooth transition from falling down to ascending. You can see the latest sample here http://dl.dropbox.com/u/49819507/rocket_1.cap.
I also tried arithmetic progression, turning gravitational vector upside down and using negative gravitation values. Could you suggest anything, please? It would also be great to have a look at a sample .CAP file to see how it can be implemented.
B
3
G
1
Posts: 12
Reputation: 499

Post » Thu Nov 17, 2011 5:37 pm

With physics it's really easy to set up.
Download
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Thu Nov 17, 2011 6:32 pm

I forgot to mention that 70% of game time protagonist will travel on foot, thats why I was trying to do this with platform behavior. Is there any way to do this in platform or how to set up platform behavior with physics?
Thanks.
B
3
G
1
Posts: 12
Reputation: 499

Post » Thu Nov 17, 2011 7:23 pm

Try this:

+ Sprite2: is on ground
-> Sprite2: Set 'canUseJetpack' to 0

+ Sprite2: Pick by Sprite2[Platform].VectorY Greater than 500
+ Sprite2: is falling
-> Sprite2: Set 'canUseJetpack' to 1

+ Sprite2: Value 'canUseJetpack' Equal to 1
+ MouseKeyboard: Key Z is down
-> Sprite2: Set vertical speed to Sprite2[Platform].VectorY-6000*timedelta
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Thu Nov 17, 2011 7:28 pm

I didn't comment the cap, but basically, when the jetman touches the ground, physics are destroyed and replaced by platform behavior. There are two variables in the "JetManAnim" sprite.
"State" keeps track if the jetman is in the air or not
"Cooldown" helps with the lift off, it waits for 1/2 second and than the platform behavior is turned off and replaced by physics.
Download
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Thu Nov 17, 2011 7:54 pm

R0J0hound,Noga Thank you a LOT!
Both your variants are working just great. I have spent too much time trying to do this correctly by myself. Now I am happy)
Thanks again!

Kuklatank2011-11-17 20:07:04
B
3
G
1
Posts: 12
Reputation: 499


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests