Spawning a box with a specific angle?

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

Spawning a box with a specific angle?

Postby Rideg » Sat Dec 19, 2009 7:45 pm

Hello! me again and wondering how to spawn a box with the same angle of another box. Can't explain it better so i'm posting a scene that explains my "problem" better;) Thank you all.

Rating: rated 5
Filesize: 12.3 kB
Comments: 2
Ratings: 1
download
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spawning a box with a specific angle?

Postby KarateBrot » Sat Dec 19, 2009 8:35 pm

It's exactly the same like here ;)

but you can't use "this.angle" that's no variable in algodoo. and instead of typing := type = because := is the declaring sign.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Spawning a box with a specific angle?

Postby Rideg » Sat Dec 19, 2009 8:38 pm

So I type scene.my.thisAngle=what?
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spawning a box with a specific angle?

Postby KarateBrot » Sat Dec 19, 2009 8:41 pm

yes exactly.
but what you want to type depends on what you want to do with scene.my.thisangle
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Spawning a box with a specific angle?

Postby Rideg » Sat Dec 19, 2009 8:47 pm

You know the box that spwnes in by the red box? Well the spawned boxes angle should be spawned with the same angle as the grey box, and I don't know what to write in the script :(
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spawning a box with a specific angle?

Postby KarateBrot » Sun Dec 20, 2009 3:27 am

which angle do you mean? the grey box has got 4 sides so basically there are 4 angles.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Spawning a box with a specific angle?

Postby Rideg » Sun Dec 20, 2009 12:19 pm

It has the angle of zero degrees ( the side were the laser hits it )currently but when it's being rotated the angle changes and so does the scene.my.thisAngle.
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spawning a box with a specific angle?

Postby KarateBrot » Sun Dec 20, 2009 12:23 pm

where it hits it that's not 0 degrees. it's 270 degrees. if the laser would hit the right side of the box it would be 0 degrees.
Image
User avatar
KarateBrot
 
Posts: 825
Joined: Mon Aug 31, 2009 7:32 pm
Location: Germany

Re: Spawning a box with a specific angle?

Postby Rideg » Sun Dec 20, 2009 12:35 pm

okey.. but the problem remains how will I get the spawned boxex to have that angle?
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden

Re: Spawning a box with a specific angle?

Postby standardtoaster » Sun Dec 20, 2009 12:47 pm

angle := scene.my.ang
User avatar
standardtoaster
 
Posts: 606
Joined: Mon Aug 31, 2009 7:57 pm

Re: Spawning a box with a specific angle?

Postby Rideg » Sun Dec 20, 2009 4:03 pm

yeah know that it's updating the variable thats the problem.. I need the grey box angle to tell the variable what number it should have.
Image
make sure to check out my work.
User avatar
Rideg
 
Posts: 948
Joined: Tue Dec 15, 2009 5:17 pm
Location: Östersund, Sweden


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests

cron