How do I Set Angle Gravity from Two Moving Sprite

0 favourites
  • 6 posts
From the Asset Store
Gravity Square is a game where I aim to reach the square at the polka dot door :)
  • Hello sir, i am new on this engine but i start to love it so much. Now i'm on a game project which like a puzzle game.

    But i'm stuck on this step. You can check the image below,

    There's 2 circle there, let's say inCircle for the smaller and outCircle. for the bigger one. Both circle are rotating in different direction. The main idea of this game is, there will be a ball that come from each color on the outCircle to inCircle. Player need to touch the inCircle to rotate inCircle faster and match the color of ball before the ball hit inCircle.

    Problem start here,

    On the outCircle i put a sprite (invisible) which i use to get the X and Y when i createObject for the ball. After i create object(ball), i want that ball to move slowly to inCircle. I have try using angleGravity, physic, force but all of that didn't work as i expect (or just my silly don't know how to use it properly).

    So, please master help me how to make the ball move slowly to inCircle. Because when i use angleGravity, both object are move (inCircle and outCircle) so i think the angle isn't a good solution.

    Any help will be very appreciate. Thank you.

    This my capx so far : bit.ly/1VZfSRG

  • With behaviors, I think bullet should cover everything you need.

    Without behaviors, the simple action would be to move towards another object, or move at angle.

    You can use another invisible sprite in the middle as the target if you have trouble with your target moving.

    If you need it to accelerate over time, store the current speed in an insurance variable to use as the amount moved per step, and increment the speed.

  • But when i use bullet behavior setAngleOfMotion, i need to get the angle from where the ball created to the inCircle. This what i confuse sir, how to do that ? When i use angle(ball.X,ball.Y,inCircle.X,inCircle.Y), the ball just falling down and that equation just give me value from 90 to 110.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • https://www.dropbox.com/s/xflrfur7gz27n ... .capx?dl=0

    Did you remember to remove your previous behaviors and turn off gravity on the bullet?

  • Yes it's what i think sir, i try to find the physic behavior that i add before. I have check all the sprite and i didn't find any physic behavior left there but the world still have gravity that pull the ball to the bottom.

  • thanks with your help and capx sir, after i create a new project and not adding the physic behaviors. It's work...

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