key_down / key_up events
7 posts • Page 1 of 1
key_down / key_up events
Useful phunlet I suppose
It runs any script only once on key press and once on release (each time key pressed).
It runs any script only once on key press and once on release (each time key pressed).
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: key_down / key_up events
For example if you set activationButton for laser to "mouse_left" (it can be done via clipboard or .phn file edit) and add key_up script "scene.addGroup({name := "selected"})", it will prevent you to select anything with left mouse click on sim running.
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: key_down / key_up events
Could it be possible to do something like this that is activated onCollide and has two different scripts? So when you set a ball on the floor, the floor's controllerAcc = controllerAcc + 1, and when you pick up the ball the floor's controllerAcc = controllerAcc - 1 so the floor keeps a running count of how many balls (or chairs or elephants) are on it?
So this could be used to more precisely simulate surface tension in a liquid by changing the attraction of a ball depending on how many other balls are touching it?
If that made any sense...
So this could be used to more precisely simulate surface tension in a liquid by changing the attraction of a ball depending on how many other balls are touching it?
If that made any sense...
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: key_down / key_up events
Not gonna work with collisions 
Dream of Algodoo as game development engine...
-

Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: key_down / key_up events
If You want to detect pressure on stationary things, You can use that.
Or use two floor planes very close to each other, and make upper one an alternating collider. Then, it's oncollide will increase controlleracc when having collision A (so +1 for each touching object), and decrease when having the other collision group.
Or use two floor planes very close to each other, and make upper one an alternating collider. Then, it's oncollide will increase controlleracc when having collision A (so +1 for each touching object), and decrease when having the other collision group.
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
Re: key_down / key_up events
Wait... what? Could you make a demonstration please?
Sorry I can't test the pressure sensor thing, I will do it tomorrow. At the moment, I do not want Algodoo to create the folder on my hard drive.
But, would it be possible to do that alternating collider thing on a bunch of balls so they all know exactly how many others they are touching?
Sorry I can't test the pressure sensor thing, I will do it tomorrow. At the moment, I do not want Algodoo to create the folder on my hard drive.
But, would it be possible to do that alternating collider thing on a bunch of balls so they all know exactly how many others they are touching?
Matthias Wandel is epic, in my humble opinion.
I love my brain...
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.
ARE YA HAPPY NOW?????
Thymechanic/Phundamentalist
Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
-

Someone Else - Posts: 1147
- Joined: Sun Nov 21, 2010 10:53 pm
- Location: The Milky Way Galaxy
Re: key_down / key_up events
I tried to make demonstration, and it kinda worked, but algodoo seems to have big problem in deciding how many collision occured, and the oncollide is ran wrong number of times. (I put 1 circle and it says 1, then I put another and it says 0 or stil 1l or whatever)
Anyway, theres the buggy concept:
Anyway, theres the buggy concept:
Phundamentalist
-

davidz40 - Posts: 438
- Joined: Sun Sep 06, 2009 10:30 am
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 3 guests




