Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Game Arcade

Author
Message
kayser2008
11
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 20th Mar 2014 17:11
Hy i´m new at Dark Basic. can anyone give me an exemple to put credits ( put a coin and give you 1 credit) on a game , i have searching the forum but cant find anything.
Cheers
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 21st Mar 2014 23:28 Edited at: 22nd Mar 2014 00:52
You would need to do a keyboard hack on the ENTER key for the coin mechanism for the following method to work, but you should get an idea or two from this.
Hope it helps...

[your splash screen's code goes here]

input "Please insert coin"; getpaid

[your game's code goes here]

... use a variable for credits if you need more than one coin...

makeasplash:
[your splash screen's code goes here]

waitformoremoney:
input "Please insert coin"; getpaid
gettingpaid = gettingpaid + 1
if gettingpaid < 4
goto waitformoremoney
else
gettingpaid = 0
endif

[your game's code goes here]

goto makeasplash

kayser2008
11
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 22nd Mar 2014 11:54
Thank you .. i have some experience in Autoit and in Autoit to do that task you have to write and read an .ini for example if the "5" key is pressed it will write in the .ini and it will read the .ini if it has coins.
I´m trying to do some dart machine games ( 301,501,cricket etc) does anyone knows of some exemple here of that kind for me to study?
Thanks
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Mar 2014 12:59
I think the easiest option would be to just get a USB controller, like a cheap USB joypad - then hack it to provide button input for the game, and coin detection using a standard cabinet coin slot. The cabinet coin slot is probably quite expensive, but not bad if you consider how much these machines can make.

In DBPro, you would just check the joystick buttons for action - the coin slot may be a bit tricker, and involve some trial and error.

The fancy, proper option is to use a keyboard controller board, which would connect via USB or PS2, and just have a bank of points that cables attach to, so you'd have everything wired up properly that way, plugs going to microswitched buttons, and to the coin door. The major benefit in using a controller board is that they have much higher bandwidth than normal keyboards. If you use a normal keyboard, you can only press 3 or 4 buttons at once and have them register, but on a controller board it's more like 12 - makes a big difference with MAME cabinets, esp fighting games. Imagine only being able to recognize 1 or 2 buttons at a time on a StreetFighter game for example. It might be fine to hack a USB joypad or keyboard for a simple gambling game, but coin doors might not like it.

I am the one who knocks...
kayser2008
11
Years of Service
User Offline
Joined: 27th Aug 2013
Location:
Posted: 24th Mar 2014 16:01
That problem of the keyboard hack i have it solved i´m gone use a Arduino Uno with a code that simulates the keybord inputs
ex- a = 20 single on the dartboard
b = 20 double on the dartboard
c = 20 triple on the dartboard

what i want is to point me in the rigut direction to make the games ( 301,501,701,cricket) and to make the games to recognise if that key is pressed ( the dartboard or the coin key ) if there is anyone that ever do this in DBP or something similar for me to study the code.

Thanks
Conjured Entertainment
AGK Developer
19
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 1st Apr 2014 03:36 Edited at: 1st Apr 2014 03:54
Quote: "That problem of the keyboard hack i have it solved i´m gone use a Arduino Uno with a code that simulates the keybord inputs "

Yeah, the I-PAC looks like a nice solution too.
The coin mech could be treated like any other button input.
That site has legal warnings about coin mechs because of all the MAME users.
Your DB games you shouldn't have those IP issues like MAME, since you own the game you created in DarkBASIC.

@ VanB
Yeah, the keyboard hack is a suggestion for any PC style game that uses standard keyboard input.
Modern arcade games might require more input, but lots of arcade classics got buy with just a joystick and a few buttons.

Login to post a reply

Server time is: 2024-11-21 12:07:04
Your offset time is: 2024-11-21 12:07:04