Rotate angle opposite direction of object?

0 favourites
  • 6 posts
From the Asset Store
16 Direction Capx
$3 USD
40% off
Rotate & Animation for 16 Direction & Mouse Direction
  • Hello, I was wondering if it's possible to do this. I have an object which flies around a round planet, but I want the planet to go into the opposite direction relative to the object. The object is controlled by touch. So what I have is: Every tick > 'Planet' set angle toward Object.X, Object.Y. Now how can I make the Planet go the other way around relative to the Object?

    I've also got one more issue. When the Object is destroyed, the planet automatically returns to its original position. I don't know why it does that but it's nice. Now the issue is that it somehow it 'jumps' to around 225 degrees then jumps to its original position of 270 degrees again (sprite handle facing upwards). Any idea why it does that? I've got some pinned objects to the planet as well and they ofcourse also 'jump' so it looks kinda weird.

    Sample of what I have now: http://mediaconceptfactory.com/images/TestRocket.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • maybe something like this?

    https://www.dropbox.com/s/715s0l5hwiu50py/Rocket.capx?dl=0

  • Thanks for your help! Yeah only I was trying to have the planet rotate in the opposite direction of the rocket. Right now the planet rotates along with the rocket, rather than the opposite direction. Basically, there's an enemy base on the opposite side of the planet which you need to try to hit. I'm thinking the planet needs to rotate a few degrees extra though, in the opposite direction else you would only see the enemy base half it's size (in my idea I cut off the screen exactly half at the planet so you only see half of it all the time).

    Oh, and the planet immediately flips right around the time you launch. Not sure if you confused it with what I was trying to achieve.

    Thanks

  • Haha Yeah I don't know what I was thinking I was so tired sorry, try this one I hope is the correct one

    https://www.dropbox.com/s/6u0k8y7rnoupzit/Rocket2.capx?dl=0

    I forgot to mention something, in your capx on event 4 you have a >>>"trigger once" you don't need it because the top event >> the "on tap object" is already a trigger and it runs only once, you see the green arrow next to the "on tap object" That is the sign for the triggers that they run once only, so whenever you see the green arrow next to the condition you don't need to put the extra trigger once

  • Thanks man! That works great. You know your way around Construct 2. And thanks for that tip. I wasn't sure when to use so I guess I overdid using the trigger once.

    • R
  • Yw Sir, glad that you sorted out

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