How do I Set Angle Gravity from Two Moving Sprite

Get help using Construct 2

Post » Wed Jun 15, 2016 2:32 pm

Message: Evsun can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
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,
Image

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 : http://bit.ly/1VZfSRG
B
6
S
1
G
1
Posts: 19
Reputation: 888

Post » Wed Jun 15, 2016 4:59 pm

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.
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Wed Jun 15, 2016 11:09 pm

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.
B
6
S
1
G
1
Posts: 19
Reputation: 888

Post » Thu Jun 16, 2016 2:21 am

https://www.dropbox.com/s/xflrfur7gz27n ... .capx?dl=0

Did you remember to remove your previous behaviors and turn off gravity on the bullet?
Mistakes were made.
B
51
S
25
G
107
Posts: 1,581
Reputation: 60,458

Post » Thu Jun 16, 2016 8:24 am

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.
B
6
S
1
G
1
Posts: 19
Reputation: 888

Post » Thu Jun 16, 2016 9:04 am

thanks with your help and capx sir, after i create a new project and not adding the physic behaviors. It's work...
B
6
S
1
G
1
Posts: 19
Reputation: 888


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], Yahoo [Bot], yiuyiu6666 and 14 guests