Some scripting questions I have

Some scripting questions I have

Postby WeLuvGoatz » 22 Jul 2018, 07:13

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!
No.
User avatar
WeLuvGoatz
SuperTux Moderator
 
Posts: 232
Joined: 23 May 2018, 19:15

Re: Some scripting questions I have

Postby manuel » 22 Jul 2018, 07:33

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.
manuel
 
Posts: 190
Joined: 19 Sep 2017, 09:03

Re: Some scripting questions I have

Postby brmbrmcar » 22 Jul 2018, 17:06

Gravity is sector.settings.set_gravity(10) or whatever number you want.
brmbrmbrmbrmbrmbrmcar
User avatar
brmbrmcar
 
Posts: 357
Joined: 24 Oct 2015, 14:46

Re: Some scripting questions I have

Postby WeLuvGoatz » 22 Jul 2018, 17:20

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.
No.
User avatar
WeLuvGoatz
SuperTux Moderator
 
Posts: 232
Joined: 23 May 2018, 19:15

Who is online

Users browsing this forum: No registered users and 1 guest