Page 3 of 4
Re: TLbind - making professional control schemes easy
Posted: Tue Feb 21, 2012 12:56 pm
by cattail
Hi, every one.
I like to play joystick, and I find the lib TLbind will be useful. But I can't download it from the official link.
The browser give me a error message "The connection to the server was reset while the page was loading."
I guess maybe I'm behind G_ F_W (super_big_firewall) something.
And search wiki and forum, I want to get it from smrq's demo .
But I seen the advice, must use TLbind v1.1
Can someone kind to put TLbind.lua(v1.1) in this forum like a .love demo?
(The most .love in the forum I can download them but old one(s) )
Or put it to github , post here a link? (That also can be download too)
Thanks a lot .
Re: TLbind - making professional control schemes easy
Posted: Tue Feb 21, 2012 1:13 pm
by Nixola
Here it is
Re: TLbind - making professional control schemes easy
Posted: Tue Feb 21, 2012 3:25 pm
by cattail
by Nixola on Tue Feb 21, 2012 1:13 pm
Here it is
Thank you very much.
I have test it by smrq's demo, love2d V0.7.2 is ok
(Willbe)V0.8.0 (hg clone from bitbucket.org) is fail, but after modify main.lua (smrq's demo)
it will run almost ok , still has some place will be adjust.
The point is
Code: Select all
--change this line
players[2].controlOptions, players[2].control = makeJoystickControls(0) -- for love 0.7.x
--to
players[2].controlOptions, players[2].control = makeJoystickControls(1) -- for love 0.8
BTW:
That two place I have found TLbind.lua is v1.07 , but still good for my test
https://gist.github.com/1744602 ( smrq's demo , a good sample for joystick coding)
justas_tomkus 's code( TLbind.lua is the same: v1.07)
https://bitbucket.org/justas_tomkus/bit ... /downloads
Re: TLbind - making professional control schemes easy
Posted: Mon Mar 05, 2012 6:20 pm
by gfreak
how to bind left mouse button?
Re: TLbind - making professional control schemes easy
Posted: Thu Mar 08, 2012 4:20 am
by TechnoCat
Wanted to give my thanks for making this.
It is sweet. And so easy to port to 0.8.0
I'd like to know if there is a way to go from action to key.
Code: Select all
print("Press " .. tlbind.controls.Bomb .. " to drop a bomb.")
would output
(joystick)
or
(keyboard)
EDIT:
I wrote a quick table reverser and key parser. All is dandy.
https://gist.github.com/1999019
Re: TLbind - making professional control schemes easy
Posted: Mon Apr 02, 2012 10:25 pm
by MiniDemonic
Hey, how would I do to aim where I point the joystick?
Currently I'm doing this:
Code: Select all
shape:setRotation(math.atan2(player.control["VerticalAim"], player.control["HorisontalAim"]))
Which is working, but everytime I release the joystick the character is aiming towards the right instantly, also this code seems to produce "corners".
Re: TLbind - making professional control schemes easy
Posted: Tue Apr 03, 2012 6:18 am
by bartbes
Well, when you release the joystick the angle becomes 0, which is to the right. You should probably check whether the values are not (close to) 0.
Re: TLbind - making professional control schemes easy
Posted: Tue Apr 03, 2012 2:35 pm
by MiniDemonic
Thanks bartbes, that did fix the auto aiming to right thingy, also noticed that the "corner" problems was due to the TLbind.deadzone setting. Changed the deadzone to 0 and now it works good enough, although the aiming still got "corners" but they are barely noticeable.
Re: TLbind - making professional control schemes easy
Posted: Sun May 06, 2012 8:01 pm
by gfreak
any plans to support multiple controls per button?
[' ']={"jump","airJump"} or (for joysticks)
[1]={"jump","airJump"}
and any plans to add left and right mouse button?
thanks!
Re: TLbind - making professional control schemes easy
Posted: Tue Jul 17, 2012 3:36 pm
by kingslovelua
Hi I'm trying to make a prototype shooter game , as my first project as I'm still learning programming in general. I found TLbind library on the love2d wiki and tried implementing it into my project but for some reason I can't get it to work for me if you find the time could you explain what i'm doing wrong in my project?
I was also trying to figure out how to use the love.joyStick but it it seems confusing does anyone here know how to use the love.joyStick api
this is how I tried using it but it was a no go for me
Code: Select all
if love.joystick.isDown( joystick, 1 ) then
player.body:applyForce(10, 0.0)
print("moving right")
elseif love.joystick.isDown( joystick, -1 ) then
player.body:applyForce(-10, 0.0)
print("moving left")
end
if love.joystick.isDown( joystick, 2 ) then
player.body:applyForce(0, -500)
elseif love.joystick.isDown( joystick, -2 ) then
player.body:applyForce(0, 100)
end
as I did with love.keyboard.isDown which worked
if love.keyboard.isDown("right") then
player.body:applyForce(10, 0.0)
print("moving right")
elseif love.keyboard.isDown("left") then
player.body:applyForce(-10, 0.0)
print("moving left")
end
if love.keyboard.isDown("up") then
player.body:applyForce(0, -500)
elseif love.keyboard.isDown("down") then
player.body:applyForce(0, 100)
end