CCW and KeyBind

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

CCW and KeyBind

Postby InfinityPlayer » Thu Dec 15, 2011 12:34 am

Is it possible to bind a key so that when i press it, it makes the hinge or hinges reverse direction. I'd like to do this in a scene i'm currently making, but without having to go to the axle box and pressing the box for Reverse. :crazy: :oops: :oops:
I am still learning, not an expert yet. I'm just here to have some phun.
InfinityPlayer
 
Posts: 40
Joined: Thu Dec 09, 2010 7:57 pm

Re: CCW and KeyBind

Postby Kilinich » Thu Dec 15, 2011 1:02 am

Key activated laser (or collision switch with key activated motor).
onLaserHit (or onCollide) script

{scene.my.ccw = !scene.my.ccw}

On hinge script menu set ccw = {scene.my.ccw}

the ony problem is it will trigger every frame so I recommend do use something like this
http://www.algodoo.com/algobox/details/50835

or just a mechanical collision switch with spring like that scene under sign
http://www.algodoo.com/algobox/details/32658
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: CCW and KeyBind

Postby InfinityPlayer » Thu Dec 15, 2011 8:29 pm

So, how can i put that in a script box to make the hinge change direction every time i press AND release a key?
I am still learning, not an expert yet. I'm just here to have some phun.
InfinityPlayer
 
Posts: 40
Joined: Thu Dec 09, 2010 7:57 pm

Re: CCW and KeyBind

Postby Kilinich » Thu Dec 15, 2011 10:10 pm

okay... :(
Attachments
ccw.phn
Here you are an example
(17.29 KiB) Downloaded 38 times
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: CCW and KeyBind

Postby InfinityPlayer » Thu Dec 29, 2011 3:46 am

When I click on the above link, Krill, all I get is code no scene
I am still learning, not an expert yet. I'm just here to have some phun.
InfinityPlayer
 
Posts: 40
Joined: Thu Dec 09, 2010 7:57 pm

Re: CCW and KeyBind

Postby Kilinich » Thu Dec 29, 2011 9:51 am

InfinityPlayer wrote:When I click on the above link, Krill, all I get is code no scene


Just open it in algodoo
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


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 5 guests