The NEW Build Your Own Arcade Controls

Main => Software Forum => Topic started by: Chris John Hunter on May 25, 2013, 03:53:22 pm

Title: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on May 25, 2013, 03:53:22 pm
 :blank:
Title: Re: Build Your Own Front End
Post by: Generic Eric on May 25, 2013, 05:10:08 pm
I'd be interested. 
Title: Build Your Own Front End
Post by: Monkeyvoodoo on May 25, 2013, 05:27:26 pm
Count me in too. I would love to learn how to do this.
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 26, 2013, 09:53:02 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Le Chuck on May 26, 2013, 02:39:09 pm
I'm watching, just not playing along.  Always interested in learning new things.
Title: Re: Re: Build Your Own Front End
Post by: darkSSide on May 26, 2013, 04:46:25 pm
I'm watching, just not playing along.  Always interested in learning new things.
I'm game as well

Sent from my Atari 2600

Title: Re: Re: Build Your Own Front End
Post by: Chris John Hunter on May 26, 2013, 05:15:57 pm
 :blank:
Title: Re: Build Your Own Front End
Post by: yotsuya on May 26, 2013, 06:38:04 pm
I'm watching, just not playing along.  Always interested in learning new things.

Same here. I like learning new stuff.
Title: Re: Build Your Own Front End
Post by: lcmgadgets on May 26, 2013, 10:15:42 pm
Also just watching. Very interesting, & if I had the time...
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 27, 2013, 10:09:43 am
 :blank:
Title: Re: Build Your Own Front End
Post by: RoyalScam on May 28, 2013, 11:22:16 am
Following along, with some caveats,

I'm on Win7 Home Premium 64. I first had to download DirectX 9.0c from Microsoft. I used the webinstaller, it took a little while. Also when running Dark Basic, I needed to run as administrator.

As for navigating Dark Basic, I found it easiest to start a new project ( named it 'Easy' ) saved it, copy and pasted the code, and F5, compile run, that's what worked for me. Thanks for doing this CJH! This looks like it'll be a lot of fun!

Regards,
Scam
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 28, 2013, 11:32:22 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 28, 2013, 01:27:57 pm
 :blank:
Title: Re: Build Your Own Front End
Post by: blenderernz on May 28, 2013, 06:56:12 pm
This is great, thanks for this. Your comments throughout the code are very clear and easy to understand!! Look forward to following along.  ;D
Title: Re: Build Your Own Front End
Post by: headkaze on May 28, 2013, 10:01:12 pm
Hi Chris

Code: [Select]
You can post code inside "code" tags
 :cheers:
Title: Re: Build Your Own Front End
Post by: Howard_Casto on May 28, 2013, 11:11:45 pm
Glad you pulled the hardcoded nonsense... I've been biting my tongue.  Keep it up. 
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 29, 2013, 06:38:49 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 29, 2013, 06:40:24 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 29, 2013, 07:42:50 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 29, 2013, 07:45:18 am
 :blank:
Title: Build Your Own Front End
Post by: Binkles on May 29, 2013, 10:22:25 am
I'm really interested in this, having done some programming in the past, I've followed along quite easily.

What will get me into programming a front end through your tutorial, is I want to be able to set up a physical key, when it is on, a games list can be selected, games that I don't want the kids to play but I do... Think mortal kombat, street fighter etc, but when the key is off and safely in my pocket, that game list is not available, and the family friendly game list is the only one available.

Any chance you will be able to show how to do that? I haven't seen it in any front end so far.
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 29, 2013, 11:16:36 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 29, 2013, 11:23:03 am
 :blank:
Title: Build Your Own Front End
Post by: Sitnalta on May 29, 2013, 12:29:45 pm
I am looking forward to the results with images, I'm definitely follow this topic :)
Title: Build Your Own Front End
Post by: Binkles on May 29, 2013, 04:00:46 pm
I've already got a switch that is activated by a key, either momentary, or always on/off depending on the status of the key.
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on May 31, 2013, 06:32:20 am
 :blank:
Title: Re: Build Your Own Front End
Post by: RyoriNoTetsujin on May 31, 2013, 07:23:11 pm
This is great! Thank you for doing this. I'm definitely watching, learning, and looking forward to updates.

I've always been vaguely interested in learning a programming language, but all I've ever thought I'd *really* like to program is my own frontend -- so this is rather seredipitous!  :cheers:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on June 02, 2013, 02:07:34 pm
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on June 02, 2013, 02:15:25 pm
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on June 02, 2013, 03:25:34 pm
 :blank:
Title: Re: Build Your Own Front End
Post by: blenderernz on June 05, 2013, 05:36:07 pm
Thanks again CJ,

This is all coming together nicely. Just a note that there seems to be an error in the code (unless I'm doing something wrong of course) at:

font=Verdana Current_System_Name=1
font=Verdana hide mouse

I had to remove the font=Verdana from both of these lines or I would get errors when compiling.

This really is great and looking forward to continuing on.

Thanks  :cheers:

EDIT Just noticed that I had to remove the [] from those to allow them to be shown on the forum. :)
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on June 05, 2013, 06:56:42 pm
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on June 11, 2013, 03:40:30 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on June 15, 2013, 11:46:40 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on June 15, 2013, 11:52:00 am
 :blank:
Title: Re: Build Your Own Front End
Post by: Chris John Hunter on June 15, 2013, 12:56:09 pm
 :blank:
Title: Re: Build Your Own Front End (EXTENDed)
Post by: Chris John Hunter on June 17, 2013, 12:02:00 am
 :blank:
Title: Build Your Own Front End(Ended-)
Post by: Binkles on June 17, 2013, 01:09:23 am
Thanks for doing what you had done, I was following pretty easy, which is why I hadn't posted anything.

I'll have to look into the syntax of the language and will continue along with what I wanted to attempt.

Regards
Title: Re: Build Your Own Front End(Ended-)
Post by: Le Chuck on June 17, 2013, 08:11:23 am
You know what helps get people engaged?  Screenies of what your coding is accomplishing. 
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 17, 2013, 01:45:21 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 17, 2013, 01:50:28 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 17, 2013, 02:43:23 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 17, 2013, 04:12:33 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 18, 2013, 11:59:48 am
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 18, 2013, 12:12:26 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 18, 2013, 12:28:01 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 21, 2013, 02:05:13 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 25, 2013, 11:17:52 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: JOHN HOWARD on June 26, 2013, 01:07:38 am
This
Is
Awesome.

Thanks a heap for writing this and I'll be eagerly following.  :cheers:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: TheDude on June 26, 2013, 04:42:05 am
Wow !
Nice of you to take time and allow us to learn something useful !
Watching this because I think it's really cool !
Keep going  :applaud:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 26, 2013, 03:54:17 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 26, 2013, 04:53:17 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 26, 2013, 05:07:47 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 26, 2013, 05:10:59 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: kayser2008 on June 27, 2013, 07:11:07 am

Background image used: http://imageshack.us/f/593/dkv.jpg/ (http://imageshack.us/f/593/dkv.jpg/)

Right heres some code that uses the system images I grabbed earlier from my C:\HYPERSPINS\Media\Main Menu\Images\Wheel folder

N.B: The images need to be in the same folder your working in and I advise you to create a new project. Call it GFX example and put those images along with the background image you want to use in that folder. Later we will specify locations of images but its easy for now.

Code: [Select]
Rem Front End EXTEND-ed
Rem GFX example
Rem by CJ Hunter


Set Display Mode 1024,768,32
Rem this tells the program, we will say when to refresh the screen. Using the Sync command. Sync Off. And Rem Sync Rate commands are used to automate this.
Sync On
Rem hide mouse pointer
hide mouse
Rem Load images - what I've done here is RENAMED the images we grabbed from the Hyperspin folder
Rem (C:\HYPERSPINS\Media\Main Menu\Images\Wheel)
Rem As 1.png, 2.png etc, upto 20. Doesn't matter which order as long as they are named 1-20.png


Rem For Next repeats the actions between For Next commands the number of times specified, here 1-20.
Rem 20 times. If you wanted the images to be labled 10-30 you would change this. Sometimes you don't want Rem 1-20 but this time we do.


Rem we are using the word IMAGE to represent the number of the IMAGE we want to load
For IMAGE=1 to 20
Rem str$(IMAGE) tells the program to convert the NUMBER represents by IMAGE into a string ($) so that Rem it can be treaded as a line of text. +" " to join string$
Rem +".png" is used to add to the string$ the .png extension. We could change that to .bmp jpg. if that was the file type.


Rem So the program sees: Load 1.png , then the second time it runs IMAGE now represents the number 2 and Rem sees: Load 2.png Etc. Until the For Next has finished. the ,IMAGE represents the image bank where we store the image for later use. As you might have guessed they are represented again by the word IMAGE. It knows bank 1,2 etc,
Rem you could change this but it always makes sense to keep things organised and that is why each number, name and bank are the same.


Load image ""+str$(IMAGE)+".png",IMAGE,1


next


Rem this is a background image. Once again put it in your project's folder. You could download it from the link if its easier. Or use one of your images. Just remember to change the file extension if you need to


Load Image "dkv.jpg",22,1

Rem System number as used before. Will increase decrease depending on user's mouse clicks
System=1


Rem start a loop
Do
Rem clear screen
Cls
Rem Paste Image is used as it sounds to Paste an image to screen. Pasted images cannot be moved.
Rem whereas SPRITES can. We will get to sprites later on. Sprites are used in games for the baddies. Player characters etc.


Rem Use: Paste Image IMAGE NUMBER,X position on screen, Y position on screen (number of pixels)
Rem This is our BACKGROUND image. Pasted FIRST
paste image 22,0,0


Rem The next 2 lines is just me working out the centre of the screen so that the image is pasted at the centre Rem of the screen- 1024 768 are the width and height of the screen IMAGE WIDTH is the Image Width of Rem SYSTEM which is used to represent the current system Image. / is used to divide. So Screen Width divided by 2 Rem minus image width(system) divided by 2. We use these in the next line to paste our system image centrally. the ,1 means make it transparent. 0 would make it black or non transparent.


IMX=1024/2-image width(system)/2
IMY=768/2-image height(system)/2


Paste image System,IMY,IMX,1


Rem tells the program to refresh the screen
Sync
Rem sleep used to slow the program down by cant remember how long now! DOH
sleep 100
Rem were using mouse clicks easy. But we will change to the joystick code used earlier (if you've setup the controller first! and its plugged in)


if mouseclick()=2
System=System-1
If System=0
System=1
endif
endif


If mouseclick()=1
System=System+1
If System=20
System=19
endif
endif


If escapekey()
end
endif


Loop

When loading images remember to put ,1 at the end of
Load Image "Example.bmp",IMAGE_BANK_NUMBER,1
Because if you don't the graphics go a bit awry!!!

 :cheers:


Hy first i want to thank you for the great tutorial and help, this is really cool and fun , but i get stucked  in this part i put the backgroun image in the same folder GFX example and renamed it dkv.jpg as is on the script and renamed every image that whore downloaded  from the hyperspin\wheel as 1.png , 2.png >>>>  20.png, but when i run the script all i get is a black screen
i´m not a programmer just some things in Autoit  so i´m sorry if i´m doing something wrong

ps- in the Part VI , in autoit you can put the .exe that you want to open in the same folder as the compiled script  ShellExecute("mame.exe", "", @ScriptDir, "open",@SW_MINIMIZE ) is it possible in Dark Basic Professional ?

Sorry and thanks
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 29, 2013, 04:30:53 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on June 29, 2013, 04:33:39 pm
 :blank:
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: kayser2008 on June 29, 2013, 05:18:57 pm
I have compiled   the same thing with the exemple that you posted earlier  here but with joystick and works just  fine.

Maybe i wose doing something wrong.

Thanks again
Title: Re: Build Your Own Front End(EXTENDed-)
Post by: Chris John Hunter on July 02, 2013, 02:46:23 am
 :blank: