Page 1 of 1

Some scripting questions I have

PostPosted: 22 Jul 2018, 07:13
by WeLuvGoatz
Here are a few questions I have:

1. Is it possible to shake the ground with scripting? If so how? What I mean is the effect that the ground shakes when Icecrushers land or when Tux buttjumps.
2. Is it possible to change the gravity of a sector with scripts? If so, how?

Thank you and have a nice day!

Re: Some scripting questions I have

PostPosted: 22 Jul 2018, 07:33
by manuel
1.) You have two options:
a. You can add a path two a tilemap like to a platform and move it quickly up and down.
b. Use Camera.shake(). I would recommend this option.

2.) I'm not exactly sure what you mean, but here are two things:
a. Use Level.flip() to change the gravity, so the level gets upside-down.
b. Go to "sector settingsā€¦" and change the value for "Gravity". Higher values make Tux fall down faster and lower values make Tux jump higher.

Re: Some scripting questions I have

PostPosted: 22 Jul 2018, 17:06
by brmbrmcar
Gravity is sector.settings.set_gravity(10) or whatever number you want.

Re: Some scripting questions I have

PostPosted: 22 Jul 2018, 17:20
by WeLuvGoatz
Thanks.
I would use #1 for a heavy falling object hitting the ground, and use #2 for if Tux swims. A scripttrigger above water makes the gravity normal and one below the water makes the player fall slowly to create kindof a swimming effect.