[solved] Mirroring a laser in onHitByLaser

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

[solved] Mirroring a laser in onHitByLaser

Postby Brother156 » Sun Apr 03, 2011 9:41 pm

Hi, I'm new to using Algodoo and I'm trying to use lasers to simulate key presses without using key bindings. I have a few lasers with different sises (the differences are very small) and they are neutrally pointing away from a box shape. Each laser has a mirror key, and so when the key is pressed, the laser is mirrored and it points toward the box shape. In the box shape onHitByLaser event I check to see what size the laser is and add a certain alpha character based on that size. But this adds alot of characters at the same time because I press the key for too long. I want to be able to mirror the laser back after I add just one character so and disable the key until that key is released.

I want to know if it is possible to mirror the laser with Thyme and if I can disable it's key until that key is released.
Last edited by Brother156 on Sun Apr 03, 2011 10:40 pm, edited 1 time in total.
Brother156
 
Posts: 2
Joined: Sun Apr 03, 2011 9:12 pm

Re: Mirroring a laser in onHitByLaser

Postby Kilinich » Sun Apr 03, 2011 10:27 pm

Brother156 wrote:I want to know if it is possible to mirror the laser with Thyme and if I can disable it's key until that key is released.


Why mirroring? You can just use laser activation key.
And here it is example of single key-down/key-up event:
Rating: rated 6.1
Filesize: 42.61 kB
Comments: 4
Ratings: 3
download


Run, press enter few times, look into console.
It's not very simple but it should do the trick - just replace box onCollide code to similar with your needs.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Mirroring a laser in onHitByLaser

Postby Brother156 » Sun Apr 03, 2011 10:39 pm

Thanks for the reply! :D
But it wasn't quite what I was looking for.
I found a laser logic example that shows how to use blips to turn off laser flow after a certain amount of time.
But thank's anyway, I'll be using that events example in another project though :P
Brother156
 
Posts: 2
Joined: Sun Apr 03, 2011 9:12 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests