The NEW Build Your Own Arcade Controls
Main => Software Forum => Topic started by: Chris John Hunter on May 25, 2013, 03:53:22 pm
-
:blank:
-
I'd be interested.
-
Count me in too. I would love to learn how to do this.
-
:blank:
-
I'm watching, just not playing along. Always interested in learning new things.
-
I'm watching, just not playing along. Always interested in learning new things.
I'm game as well
Sent from my Atari 2600
-
:blank:
-
I'm watching, just not playing along. Always interested in learning new things.
Same here. I like learning new stuff.
-
Also just watching. Very interesting, & if I had the time...
-
:blank:
-
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
-
:blank:
-
:blank:
-
This is great, thanks for this. Your comments throughout the code are very clear and easy to understand!! Look forward to following along. ;D
-
Hi Chris
You can post code inside "code" tags
:cheers:
-
Glad you pulled the hardcoded nonsense... I've been biting my tongue. Keep it up.
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
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.
-
:blank:
-
:blank:
-
I am looking forward to the results with images, I'm definitely follow this topic :)
-
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.
-
:blank:
-
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:
-
:blank:
-
:blank:
-
:blank:
-
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. :)
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
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
-
You know what helps get people engaged? Screenies of what your coding is accomplishing.
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
This
Is
Awesome.
Thanks a heap for writing this and I'll be eagerly following. :cheers:
-
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:
-
:blank:
-
:blank:
-
:blank:
-
:blank:
-
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.
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
-
:blank:
-
:blank:
-
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
-
:blank: