collideSet help.

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

collideSet help.

Postby Copsicle » Sun Jun 03, 2018 4:07 am

So, recently, I've been trying learning more about the thyme scriping. Once I learned how to use the collideSet script, I was thinking about making a bowling alley. Since there is 10 pins in a bowling game and 10 different collision layers, it could have been a big advantage to make an alley, but the problem is that I couldn't fing a way to randomize the collision layer for the bowling ball so the scores can vary depending of the collisions of the bowling ball. Is there a way to randomizr the collideSet number? (sorry if my sentences aren't clear, englist isn't my first language)
Copsicle
 
Posts: 1
Joined: Sat May 26, 2018 12:30 am

Re: collideSet help.

Postby FRA32 » Tue Jun 05, 2018 6:31 pm

since Algodoo doesn't support bitwise operators, you gotta make collisions like this:

collideset = 0;
for(10,(i)=>{
collideset = collideset + rand.boolean*2^i
});
FRA32
 
Posts: 227
Joined: Wed Dec 03, 2014 9:51 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 9 guests

cron