controller player jumping problem
Posted: Tue May 27, 2014 5:23 pm
howdy
ive run into some little problem, looked through forum and wiki, but cant anything.
so, i cant seem to get my controller to get the player to jump . got it to move, no problem. but the buttons are not working to the same standard as say the d-pad
this is the code im using. bear in mind im giving both jump code for sharing with [or command] the keyboard and by itself. i just uncommented for this post.
though feel its an easy answer in the end
using the 360 controller, since its the best option i feel for gaming dev and controllers in general. though my hands down [best] controller is the gamecube one
ive run into some little problem, looked through forum and wiki, but cant anything.
so, i cant seem to get my controller to get the player to jump . got it to move, no problem. but the buttons are not working to the same standard as say the d-pad
this is the code im using. bear in mind im giving both jump code for sharing with [or command] the keyboard and by itself. i just uncommented for this post.
though feel its an easy answer in the end
Code: Select all
function player:jumping(key)
if key == ' ' or joyStick:isGamepadDown('a') then
if self.jump then
self.speedY = self.jumpSpeed
self.jump = false
end
end
--second jump
if joyStick:isGamepadDown('a') then
if self.jump then
self.speedY = self.jumpSpeed
self.jump = false
end
end
end