Need Help with Rocket!

About advanced scenes, and the Thyme scripting language used in Algodoo.

Need Help with Rocket!

Postby BAZOOKA » Wed May 08, 2013 2:31 pm

Have you seen FruitMonger's Super Sonic Rocket?
Please help me with the script, as I want to try and make a damn rocket with the same concept... :(
BTW I use Version 2.1.0
So can anyone please tell me the correct script for the sonic rocket? On my laptop, it works fine for about 30 seconds, and then it stops spawning the boxes, like forever! PLEASE HELP!
Attachments
62512_Super_Sonic_Rocket.phz
(11.19 KiB) Downloaded 40 times
Some science teacher said one day,'Remember to leave the water dry...'
User avatar
BAZOOKA
 
Posts: 22
Joined: Fri Oct 26, 2012 5:45 pm

Re: Need Help with Rocket!

Postby Xray » Wed Jul 03, 2013 8:14 pm

Modify the spawned box code as follows:

Code: Select all
  scene.addbox({
        angle := (readable(e.geom)).angle;
        angvel := (readable(e.geom)).angvel;
        vel := (readable(e.geom)).vel;
        size := [1.5, 0.5];
        pos := e.pos;
        timetolive := 0.1;
        friction := 0;
        airfrictionmult := 0;
        heterocollide := true;
        controlleracc := sim.time + 0.1;
        density := 10;
        colorhsva := [(e.geom.controlleracc - sim.time) * 120, 1, 1, 0.5];
        drawborder := false
    })


As you can see, I changed Density so that it can never become 0 (zero), and I added timeToLive := 0.1
So, instead of using Density to kill the boxes after a certain time period, I'm using timeToLive.
This prevents the strange timeout failure that you were having. :)
User avatar
Xray
 
Posts: 501
Joined: Sun Jun 17, 2012 6:12 am
Location: USA


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 10 guests