News:

Function Finder  Find all the functions within source code files

Main Menu

pbJoystick v1.00

Started by SiN, January 02, 2005, 10:26:43 PM

Previous topic - Next topic

SiN

hi guys,

since PB doesnt currently have any joystick support, i wrote up a dll and some helper functions to add some joystick support.

it currently supports 16, 8-directional, 4 button gamepads. i would have coded stuff like analogue sticks in, but i didnt have the need for anything more complex for the project im working on. if YOU need it on the other hand, let me know, and if i get the time, ill throw in some extra functionality.

you can find pbJoystick on my website, www.mobeensoftware.8m.com , under "programming resources".


SiN

tomazmb

#1
Hello SiN,

One thing - off topic. On your website in section Games, i receive an information from my SpyBot, that your system is trying to install Gator, which is a known threat. Do you know anything about it ?

Have a nice day,

Tomaz

Edit: When I close your website also FastClick. It has probably to do with your host 8m.com.
My computer specification:

AMD Athlon 64 2800+
MB ASUS K8V Socket 754 VIA K8T800
SB Audigy 2
3 GB RAM DDR 400 MHz PQI
AGP NVIDIA GeForce 7600GT 256 MB-Club 3D
Windows XP Pro SP2
DirectX 9.0c

SiN

hi,

first off, thanx for browsing around the website :)

as for gator, no, had no idea. but your absolutely right, its because i have a freeservers (.8m.com) website. since none of my games are shareware, and i dont have a steady income, id rather not spend money on a ".com" full price site.

however, i can guarentee you that ALL of the software contained on the site contains NO spyware whatsoever.


SiN

troynall

Quotehi,

first off, thanx for browsing around the website :)

as for gator, no, had no idea. but your absolutely right, its because i have a freeservers (.8m.com) website. since none of my games are shareware, and i dont have a steady income, id rather not spend money on a ".com" full price site.

however, i can guarentee you that ALL of the software contained on the site contains NO spyware whatsoever.
SiN


how about force feed back ?
I have a need to control a joystick with recoil motor on it.


troy nall
troyleenall@lycos.com

kevin

Note:

 Since there's been a few requests for joystick support (and since I don't have one :) )   Sin was kind enough to write a plug in library a while back..  

 So i've pinned this just in case you missed it.

Ian Price

#5
I added this to my JetPak game right at the very beginning. Works a treat it does, but it should have been standard, rather than a .DLL. ;)

[EDIT] However, if you don't own a joystick, it'd be pretty difficult for you to test out an in-built function :P
I came. I saw. I played some Nintendo.

Blade

This is going to sound totally ignorant, but... how exactly do I install/use a .dll like this with PlayBasic?  I don't see any installation instructions in the readme, and I have no idea how to proceed. :unsure:   (I'd like nothing better than to see joystick commands incorporated as standard in future versions of PlayBasic - 2D games play best with a gamepad, IMO! )

Ian Price

#7
Here is a cutback version of the routine I used in my JetPak game - I'm not aware of any other PB game that has used the joypad .DLL

At the start of your game -
PlayBASIC Code: [Select]
; Load Joystick DLL
Global PBJoystick_DLL_Id = GetFreeDll()
LoadDll "data\pbJoystick.dll", PBJoystick_DLL_Id




Within your main character movement routine -
PlayBASIC Code: [Select]
rt=CallDll(PBJoystick_DLL_Id, "joyRight", 0); Right 
lt=CallDll(PBJoystick_DLL_Id, "joyLeft", 0); Left
up=CallDll(PBJoystick_DLL_Id, "joyUp", 0); Up
dn=CallDll(PBJoystick_DLL_Id, "joyDown", 0); Down
button1 = CallDll(PBJoystick_DLL_Id, "joyButton", 0, 0); Firebutton 1

; Move Right
If rt=1 Then x=x+4

; Move Left
If lt=1 Then x=x-4

; Fire
If button1=1 then fire_laser(x,y)

etc.




Hope that helps. :)
I came. I saw. I played some Nintendo.

kevin

Joystick commands are now in PB1.37

Ian Price

#9
Yay! :)

Is there a maximum number of pads that are detected by PB?
I came. I saw. I played some Nintendo.

thaaks

Of course. Simple calculation.

Kevin has no joysticks - no official joystick support in PB.
Kevin has one joystick - support for one joystick made it into the product.

Just send as many joypads/sticks to Kevin as you need supported  :P

Just kidding but I couldn't resist  :D

Have fun,
Tommy

Blade

QuoteJoystick commands are now in PB1.37

Talk about a response!  Thanks, Kevin. :)