speed
and direction
obsolete. However, it does enable a whole bunch of specific physics variables which can be used instead.obj_StaticParent
' and 'obj_DynamicParent
'. Then add collision events in both of them checking for collisions with themselves and each other so that they look like this:instance_destroy()
so that if any instance falls out the room it is removed.obj_StaticParent
as its parent, and the other three objects should be children of obj_DynamicParent
to ensure that the collisions are resolved correctly. We can now move on and define the fixtures for the objects.obj_Base
and select the Uses Physics option then click the Physics button. This will open the object physics properties window with a number of extra options, shown below:obj_Block
. This is our first dynamic object and you should again select Uses Physics then click the 'Physics' button to open the properties editor, then adjust the box fixture shape to suit the sprite in the Fixture Editor, as we did for the floor object. The default values are fine here too - the density set to 0.5 - so close the object once you've finished and then open the object obj_Circle
.obj_Control
. Give it an Alarm[0] event with a comment, like 'Spawn Timer' or something. This is simply to limit the number of instances of our physics objects spawned. Now add a Step Event with the following:obj_Base
objects all on the 'Instances' layer. Now run the project! If all has gone correctly you should see something like this: