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 .
TLbind 1.3 - professional controls made easy (now w/ mouse!)
Re: TLbind - making professional control schemes easy
Here it is
- Attachments
-
- TLbind.lua
- (3.36 KiB) Downloaded 332 times
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: TLbind - making professional control schemes easy
Thank you very much.by Nixola on Tue Feb 21, 2012 1:13 pm
Here it is
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
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
how to bind left mouse button?
- TechnoCat
- Inner party member
- Posts: 1611
- Joined: Thu Jul 30, 2009 12:31 am
- Location: Milwaukee, WI
- Contact:
Re: TLbind - making professional control schemes easy
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.
would output
(joystick)
or (keyboard)
EDIT:
I wrote a quick table reverser and key parser. All is dandy. https://gist.github.com/1999019
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.")
Code: Select all
>>Press X to drop a bomb.
or
Code: Select all
>>Press Space to drop a bomb.
EDIT:
I wrote a quick table reverser and key parser. All is dandy. https://gist.github.com/1999019
-
- Prole
- Posts: 28
- Joined: Tue Mar 20, 2012 10:39 am
Re: TLbind - making professional control schemes easy
Hey, how would I do to aim where I point the joystick?
Currently I'm doing this:
Which is working, but everytime I release the joystick the character is aiming towards the right instantly, also this code seems to produce "corners".
Currently I'm doing this:
Code: Select all
shape:setRotation(math.atan2(player.control["VerticalAim"], player.control["HorisontalAim"]))
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: TLbind - making professional control schemes easy
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.
-
- Prole
- Posts: 28
- Joined: Tue Mar 20, 2012 10:39 am
Re: TLbind - making professional control schemes easy
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
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!
[' ']={"jump","airJump"} or (for joysticks)
[1]={"jump","airJump"}
and any plans to add left and right mouse button?
thanks!
-
- Citizen
- Posts: 71
- Joined: Mon Sep 26, 2011 7:16 pm
Re: TLbind - making professional control schemes easy
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
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
- Attachments
-
- player.love.zip
- (5.33 KiB) Downloaded 295 times
Who is online
Users browsing this forum: Google [Bot] and 3 guests