Mouse Triggered lasers and hinges
Posted: Sun Jan 30, 2011 5:06 am
For those of you who didn't know, you can set a hinge to move, or a laser to fire with a left or right mouse click. Here's how:
First, create a hinge or laser. For the activation button/forward key/backward key, put in something like the up/down arrow, ect. Now select it and press Ctrl (command key on a Mac) + c (if you're using phun, this is not supported, so this won't work and you'll have to download my scene )
Open notepad OR textedit. Now press Ctrl (command key on a Mac) + v. You now can see just what makes up a hinge/laser. It should look something like this
Now change the activationButton/buttonForward/buttonBack to "mouse_left" or "mouse_right"
select your text and and again press Ctrl (command key on a Mac) + c
now go into algodoo, place your mouse where you want the hinge/laser and press Ctrl (command key on a Mac) + v.
Here's my example scene. If your not using a fixed context menu, this may really annoy you; one of the lasers fires with the right-click button.
Now you have your mouse-triggered laser/hinge. Enjoy it and create something awesome. And when you create something awesome, post it in this thread so others can more easily find it!
First, create a hinge or laser. For the activation button/forward key/backward key, put in something like the up/down arrow, ect. Now select it and press Ctrl (command key on a Mac) + c (if you're using phun, this is not supported, so this won't work and you'll have to download my scene )
Open notepad OR textedit. Now press Ctrl (command key on a Mac) + v. You now can see just what makes up a hinge/laser. It should look something like this
- Code: Select all
// FileVersion 14
// Phunlet created by Algodoo v1.8.5
FileInfo -> {
title = "Laser on mouse button";
author = "TC42";
version = 14
};
Scene.addHinge {
geom0 := -1;
world0pos := [-0.09375, 0.15625];
geom1 := 0;
geom1pos := [-0.09375, 0.15625];
ccw := false;
motorTorque := +inf;
impulseLimit := +inf;
opaqueBorders := true;
autoBrake := true;
motor := true;
motorSpeed := 1.5707964;
color := [0.014852926, 0.0, 0.29705852, 1.0];
distanceLimit := +inf;
entityID := 7505;
zDepth := 7.0;
size := 0.020154854;
buttonForward := "up";
buttonBack := "down"
}
Now change the activationButton/buttonForward/buttonBack to "mouse_left" or "mouse_right"
select your text and and again press Ctrl (command key on a Mac) + c
now go into algodoo, place your mouse where you want the hinge/laser and press Ctrl (command key on a Mac) + v.
Here's my example scene. If your not using a fixed context menu, this may really annoy you; one of the lasers fires with the right-click button.
Now you have your mouse-triggered laser/hinge. Enjoy it and create something awesome. And when you create something awesome, post it in this thread so others can more easily find it!