Legacy GM Make Round Circle Drop Into Round Hollow Tube?

J

JeZxLee

Guest
Hi,

So I am currently implementing physics into our new GameMaker:Studio game now.
Before I ask my question, I would like you to look at progress HERE. (is no install Internet HTML5)

I am trying to get little round colored sprites to fall into a hollow round jar.
Please look at below picture to see what I try to do:


My main issue now is how do we setup the collision detection between the red circle
and the round hollow bottom of the glass tube?

Any help would be appreciated, thanks!
 
J

Jaqueta

Guest
If you don't want the gems to collide with each other, you can use a simple script like
(ofc this is just an example and can be improved)
Code:
if y>500
{
if vspeed>0.1
{vspeed=-vspeed/1.5}
else
{vspeed=0;y=500}
}
Now, if you want the gems to collide with each other, I recommend using Physics for the best looking effect.
 
J

JeZxLee

Guest
If you don't want the gems to collide with each other, you can use a simple script like
(ofc this is just an example and can be improved)
Code:
if y>500
{
if vspeed>0.1
{vspeed=-vspeed/1.5}
else
{vspeed=0;y=500}
}
Now, if you want the gems to collide with each other, I recommend using Physics for the best looking effect.
Hi,

Thanks for the reply, we ARE using GameMaker:Studio Physics system.
How can we setup the collisions between falling red round sprite and bottom round hollow tube as pictured above?
Thanks!
 
J

Jaqueta

Guest
All you need to do now is set up a Collision Event between the two, make sure to put something in the event to make sure that it won't get automatically destroyed, it can be even a comment. Also, make sure that both objects have Physics enabled, or else, nothing will happen.
 
J

jackhigh24

Guest
there is a function to set up an edge chain you can plot its shape to fit the inside of the yellow ring stuff only, i use it all the time for stuff that need real physics feed back but its a concave shape like that, the normal collision shape you would of had to set up wont take that kind of shape.
 
Top