How do I rotate rocket's angle smoothly towards object?

Get help using Construct 2

Post » Mon Jan 25, 2016 11:46 pm

Message: ganich can only post plain text URLS until they have 500 rep. 4 URLS modified. Why?
Hi,

I am working on a project and I need some of you talented people to help me out a little. First Download and run the .capx file I'm attaching with this post to have a better idea of what i'm asking for.

So Basically, My rocket is floating in Space where's there's no gravity. The controls are keyboard "UP Arrow" to fly upwards and Keyboard "Down Arrow" to fly downwards to avoid obstacles. I have added physics, set world gravity to 0 and added Linear Damping to my Spaceship so if you move upwards, you will keep going.

However, I can't figure out one thing. I want to achieve this

1. Whenever I press and hold the direction button (Up or Down), lets say for example 'Up Arrow', I want the tip of the spaceship's nose to start tilting towards the marked point A on the layout. As long as I keep holding down the UP Arrow, the ship should smoothly tilt towards the A mark. Similarly, Holding down the 'Down Arrow' button should do the same but starting to tilt the nose of the spaceship towards marker B on the layout.



I don't want it to be a sudden thing, I want it be in a flow and gradually start curving down as long as i'm pressing the button. If opposite button is pressed then the force of angle should shift upwards smoothly incriminating.

Construct 2 Working File
https://goo.gl/JAidbt


I hope you guys understand what i'm trying to say. If not then download the .capx file and you will be absolutely clear on what I want.


Screenshot

Full Screenshot: http://s17.postimg.org/sapc3pp7z/Capture.png
Image

Construct 2 Working File
https://goo.gl/JAidbt (Dropbox Download)

Example Game
https://www.youtube.com/watch?v=hByliKJRsmo
Watch it from the middle when the rocket is flying. However, in my game there's no gravity so the ship should only turn downwards when down arrow is pressed.

Any help will be greatly appreciated.
B
11
Posts: 27
Reputation: 448

Post » Tue Jan 26, 2016 12:00 am

Is there a specific reason why you use physics behaviour for this and not bullet?

Of you were to use bullet behaviour, I would just use rotate clockwise or counterclockwise, depeniding on up ot down pushed..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 26, 2016 12:53 am

LittleStain wrote:Is there a specific reason why you use physics behaviour for this and not bullet?

Of you were to use bullet behaviour, I would just use rotate clockwise or counterclockwise, depeniding on up ot down pushed..


Physics Behavior is given to create space environment because I wanted to set the gravity to zero. Watch the youtube video I posted at the end of my post. You can see how the rocket start turning up and down tilting it from the nose.
B
11
Posts: 27
Reputation: 448

Post » Tue Jan 26, 2016 10:36 am

I saw the video and as far as I can see, there is no need for physics behaviour, that is why I asked..

In Construct2 the bullet-behaviour and the platform behaviour also have gravity, but you said you set the gravity to 0 in your game, so even gravity wouldn't be a reason for the physics behaviour..

A simple bullet- behaviour should work just fine in my opinion..
Rotate 1 degrees counter-clockwise when pushing up
Rotate 1 degrees clockwise when pushing down
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jan 26, 2016 11:35 pm

LittleStain wrote:I saw the video and as far as I can see, there is no need for physics behaviour, that is why I asked..

In Construct2 the bullet-behaviour and the platform behaviour also have gravity, but you said you set the gravity to 0 in your game, so even gravity wouldn't be a reason for the physics behaviour..

A simple bullet- behaviour should work just fine in my opinion..
Rotate 1 degrees counter-clockwise when pushing up
Rotate 1 degrees clockwise when pushing down


But if I don't use the physics behavior, how would I create the linear damping. Secondly, the platform scrolls and the player stays stable on the screen because I want to generate random obstacles.

I have found the solution to my problem though. I used when key "up" is pressed > Rotate Toward Angle
B
11
Posts: 27
Reputation: 448

Post » Thu Apr 14, 2016 8:50 pm

hi @ganich , are you found the solution? if yes, say the way please.
B
10
S
3
Posts: 180
Reputation: 1,212


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 23 guests