Page 1 of 2

how to Alerting rocks to fall down?

PostPosted: Tue 2 Jan 2018, 09:30
by Oscar Erni
Can anyone help me to have an events that can alert rocks to fall down when the player is in the position you give.... :o

Re: how to Alerting rocks to fall down?

PostPosted: Tue 2 Jan 2018, 10:16
by AnimatedG
Hi Oscar Erni,

I'm a newish user myself. Hope this works for you. If you want for example for the rocks to be triggered at 100 of X position. You will want to make it greater than or equal to 100 on X position

On condition - All Objects - Position - Compare X position of an object (eg. >= 100 of object[player])
action - (Trigger falling rocks)

Re: how to Alerting rocks to fall down?

PostPosted: Tue 2 Jan 2018, 10:50
by Oscar Erni
:D thank you very much .....
the rocks doesn't fall down... how do I apply gravity on rocks to fall down....something like this.. if the player is approaching on designated position, the rocks will suddenly fall down ( be alerted and the rocks will fall down..)

Re: how to Alerting rocks to fall down?

PostPosted: Tue 2 Jan 2018, 11:14
by AnimatedG
Hi Oscar Erni,

I have not really tried out using behaviours so i could be wrong. But i think you can add gravity to the rocks by:

Right clicking on the rocks (possibly have to be in the scene) - add a behaviour to an object - physics engine

Next select the rock and in the properties panel (where the position, scale, z-order are shown). There is now a physics property at the bottom. Click on "Click to edit" There should be options to change the gravity.

I haven't played around with this, so you will need to do some trial and error.

Re: how to Alerting rocks to fall down?

PostPosted: Tue 2 Jan 2018, 12:08
by Oscar Erni
thank you very much... :D

Re: how to Alerting rocks to fall down?

PostPosted: Tue 2 Jan 2018, 14:22
by Lizard-13
As AnimatedG said, you could use the Physics behavior this way:
*Add the physics behavior to the rocks, edit the behavior and put a positive value on the gravity Y coordinate.
*In the events editor, add "At the beginning of the scene >> Activate Physics for Rock: no" so the rocks won't fall at the beginning.
*Now, when you reach a position to alert a rock (X position of player > some value, player colliding with alerting area, etc.) activate the physics behavior for the specified rock and you are done.

If you don't want to add the Physics behavior for such simple thing, you can also do it:
*In a first event, at the beginning of the scene, set a variable "active" for the rocks = 0 (this is an object variable, now each rock has its own "active" variable set to 0).
*In another event, when you reach a position to alert a rock, set the variable "active" of that rock = 1, that specific rock is now active.
*Finally, in a third event, if the variable "active" of rock is = 1 move it downguard (modifying the Y position or through forces), so active rocks will fall down.

Re: how to Alerting rocks to fall down?

PostPosted: Wed 3 Jan 2018, 13:50
by Oscar Erni
Thank you very much...
another one... :D :D
when the rocks fall down how do i do an event it will delete the rocks besides collision on bottom platform....

Re: how to Alerting rocks to fall down?

PostPosted: Wed 3 Jan 2018, 13:52
by Oscar Erni
view the attachment :D

Re: how to Alerting rocks to fall down?

PostPosted: Thu 4 Jan 2018, 11:42
by AnimatedG
Hi Oscar Erni,

Maybe you can try deleting past a certain Y position.

Eg, the floor Y position is 100

Delete rocks when past Y Position of 100. This will only work if all your stages have flat terrain

Alternatively, if the floor is an object itself, you can do
Delete rock - When rock.Y() > floor.Y()

Alternatively, if your floor is not an object. You can create a rectangluar block. Place the block on top of the floor and hide the block. Then when rock collides with block, delete rock

Re: how to Alerting rocks to fall down?

PostPosted: Fri 5 Jan 2018, 17:15
by Oscar Erni
thank you very much...great men. :D