Set angle of my rocket

0 favourites
  • 8 posts
From the Asset Store
A whole set you need to create a gorgeous winter 2d game
  • Hello everyone!

    I been working on a little mini experiment, to try to emulate rocket physics using the bullet behavior, and by touching the screen, the sprite will move up and continue to accelerate, and if you stop touching the screen, the sprites speed will eventually slow, and go downward. You may touch the screen again to start thrust.

    All of this works, however what if I wanted to change the angle of which the projectile is traveling? I cannot figure out how to do this, ive tried setting the bullets angle of motion differently, that does not work, and rotating the sprites angle does not work, it will rotate the sprite, but the bullets motion doesn't compensate for the angle I adjusted the rocket. (it just travels in the same, straight bullet line) I am not sure if even the bullet behavior is enough to emulate the rocket, would physics work better?

    Screenshot of events:

    Any help please?

    I appreciate it!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Can you add a Touch event so when you Touch the screen again the rocket will Angle toward Touch.

  • Can you add a Touch event so when you Touch the screen again the rocket will Angle toward Touch.

    Sadly, no I cant. I would overall like to use the phones beta/ gamma orientation to move the rocket. I know touching can change the angle of motion, with the "set angle of motion - angle(Sprite.X,Sprite.Y,Touch.X,Touch.Y)"

  • When testing make sure you use extravagant values to confirm you are indeed not getting what you expect. I should think that physics will be much better for this though. Even custom events would be preferable. Physics is a lot of fun to play with if you haven't tried it and in many ways more intuitive.

    I'm not sure what you are trying to accomplish exactly though... Do you want the rocket to change angle counterclockwise?

  • Ruskul

    I am not too sure if I should use physics though, as it is CPU intensive for mobile development, that is where I am not sure what to do.

    I am trying to allow the player to just press and hold the screen, the thrust increases while holding for a period of time, that already works using the bullet behavior.

    Then I want the player to be able to "steer" the rocket counter clockwise and clockwise, by using the mobile device orientation. Like tilting the phone left and right, and it would steer the rocket in both directions. Here is a little sketch in paint in what I am picturing in my head. It is a crude drawing, sorry.

  • Update

    I did mess around with the physics a bit, I got something what I wanted working, still have to test on mobile

  • Basically, tilting rotates the rocket, and the rocket will go into the direction it is rotated, which I am still having a hard time doing, I am getting somewhere with the physics though with the thrusting physics, I cannot find an example on this forum that covers this, would be useful though!

  • Anyone know of a solution for realistic rocket physics using gravity, and thrust?

    Cannot find any examples on the forums

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