RIP-Felix Posted June 30, 2015 Posted June 30, 2015 Has anyone rigged up a simon says game for their RGB LED arcade buttons using an LED controller (Arduino, PACLED64, whatever)? I'm looking into adding RGB LEDs buttons to my X-arcade Tankstick. I'm looking for other uses/games that could take advantage of them. I like the old simon says game and think it would be cool if that could be launched with GameEX. The screen would not even be needed, but could integrated somehow. I kind of wish I was better at programing. This gives me some neat Ideas. Wondering if anyone has heard of this somewhere. Maybe you can point me to some code. Quote
DazzleHP Posted July 3, 2015 Posted July 3, 2015 If i'm understanding correctly you want to integrate this with this? It probably can be done yes, but would take some work, and to integrate into GameEx would take even more amounts of effort as you'd need to make a program/software first.You could probably connect the Simon Says PCB to your arcade buttons quite easily though. Quote
RIP-Felix Posted July 4, 2015 Author Posted July 4, 2015 I found a JavaScript source for a simple HTML based mockup of the game here. The number of buttons is correct but I would need to know code to figure out how to map these to the button switches and LED controller. Perhaps I could rework the simple visual display to reflect the buttons and their colors to match my CP, then it would display correctly on the monitor. Of course this being HTML I would have to imbed it in a webpage (I assume). I don't have the first clue about web dev, JavaScript, and etc. I'd prefer to wrap it all up into a neat little executable.Does this sound like a daunting task for a beginner, or do the more experienced coders out there think this might be a good project for me to get my beginning code on. Quote
stigzler Posted July 4, 2015 Posted July 4, 2015 It sounds as good as any to start on, but wondering if it'll depend on what I/O board you're using. I don't know much about hardware interfaces, but this might be a tricky bit.I'd start with the game logic - that shouldn't be too difficult. From (painful) experience, I'd start with Visual Basic (either C# or VB.net - the latter's a little more beginner friendly) via Visual Studio Express (Free!). Then you could practice the game logic using timers, arrays and randoms via a form application. Place some buttons on a form and voila! Simon. Then you'd just have to do the (potentially, although not sure) difficult bit of turning a change form-button event to a light LED event instead.EDIT:And if you want to cheat, here's a small bit of vb.net that runs simon:Option Strict OnOption Explicit OnPublic Class Form1#Region "Variables"Private pnl_list As New List(Of Panel)Private play_list As New List(Of Panel)Private game_tmr As New TimerPrivate blink_tmr As New TimerPrivate clicked_pnl As PanelPrivate r As New RandomPrivate counter As Integer = 0#End Region#Region "Control Events"Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load'Set the properties of meWith Me.BackColor = Color.Black.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedToolWindow.Size = New Size(300, 300).StartPosition = FormStartPosition.CenterScreen.Text = "Simon"End With'Set the game timer & blink timer intervalsgame_tmr.Interval = 650blink_tmr.Interval = 275'Declare new instances of 4 panelsDim pnl_blue, pnl_green, pnl_red, pnl_yellow As New Panel'Add the panels to the listpnl_list.AddRange({pnl_blue, pnl_green, pnl_red, pnl_yellow})'Set the properties of the panelsWith pnl_blue.BackColor = Color.Blue.Size = New Size(CInt(Me.Width / 2 - 2), CInt(Me.Height / 2 - 2)).Location = New Point(0, 0).Tag = Color.Blue.Name = "PanelBlue"End WithWith pnl_green.BackColor = Color.Green.Size = New Size(CInt(Me.Width / 2 - 2), CInt(Me.Height / 2 - 2)).Location = New Point(CInt(Me.Width / 2 - 2), 0).Tag = Color.Green.Name = "PanelGreen"End WithWith pnl_red.BackColor = Color.Red.Size = New Size(CInt(Me.Width / 2 - 2), CInt(Me.Height / 2 - 2)).Location = New Point(0, CInt(Me.Height / 2 - 2)).Tag = Color.Red.Name = "PanelRed"End WithWith pnl_yellow.BackColor = Color.Yellow.Size = New Size(CInt(Me.Width / 2 - 2), CInt(Me.Height / 2 - 2)).Location = New Point(CInt(Me.Width / 2 - 2), CInt(Me.Height / 2 - 2)).Tag = Color.Yellow.Name = "PanelYellow"End With'Add the panels to meMe.Controls.AddRange(pnl_list.ToArray)'Generate the click event for the 4 panelsFor Each pnl As Panel In pnl_listAddHandler pnl.Click, AddressOf Panel_ClickNext'Generate the tick event for the two timersAddHandler game_tmr.Tick, AddressOf GameTimer_TickAddHandler blink_tmr.Tick, AddressOf BlinkTimer_Tick'Start a new gameCall AddItem()game_tmr.Enabled = TrueEnd SubPrivate Sub Panel_Click(sender As Object, e As EventArgs)'If the timer isn't enabled then enable itIf blink_tmr.Enabled = False Then'Set the clicked panelclicked_pnl = DirectCast(sender, Panel)'Change it's colorSelect Case clicked_pnl.BackColorCase Color.Blueclicked_pnl.BackColor = Color.DarkBlueCase Color.Greenclicked_pnl.BackColor = Color.DarkGreenCase Color.Redclicked_pnl.BackColor = Color.DarkRedCase Color.Yellowclicked_pnl.BackColor = Color.GoldEnd Select'Start the blinkblink_tmr.Enabled = True'Check if the clicked panel is a matchIf CheckMatch(clicked_pnl) Thencounter += 1Elsecounter = 0MessageBox.Show("You guessed wrong. When you click OK a new game will start.", Me.Text, MessageBoxButtons.OK)play_list.Clear()Call AddItem()game_tmr.Enabled = TrueEnd If'Check to see if we've guessed all the panelsIf counter = play_list.Count Thencounter = 0Call AddItem()game_tmr.Enabled = TrueEnd IfEnd IfEnd Sub#End Region#Region "Timers"Private Sub GameTimer_Tick(sender As Object, e As EventArgs)'Static i, or declare it as Private i outside of the subStatic i As Integer = 0'If i is less than the play_list count...If i < play_list.Count Then'Don't allow the panel's the be enabledFor Each pnl As Panel In pnl_listpnl.Enabled = FalseNext'The panel to be clicked will be the current item in the listclicked_pnl = play_list.Item(i)'Change it's colorSelect Case clicked_pnl.BackColorCase Color.Blueclicked_pnl.BackColor = Color.DarkBlueCase Color.Greenclicked_pnl.BackColor = Color.DarkGreenCase Color.Redclicked_pnl.BackColor = Color.DarkRedCase Color.Yellowclicked_pnl.BackColor = Color.GoldEnd Select'Blink!blink_tmr.Enabled = True'Increment i by 1i += 1Else'If i is equal to the playlist count...'Set i back to 0i = 0'Stop the game timergame_tmr.Enabled = False'Set the panel's back to enabledFor Each pnl As Panel In pnl_listpnl.Enabled = TrueNextEnd IfEnd SubPrivate Sub BlinkTimer_Tick(sender As Object, e As EventArgs)'Stop the timerblink_tmr.Enabled = False'Set the panel's color back to it's original colorSelect Case DirectCast(clicked_pnl.Tag, Color)Case Color.Blueclicked_pnl.BackColor = Color.BlueCase Color.Greenclicked_pnl.BackColor = Color.GreenCase Color.Redclicked_pnl.BackColor = Color.RedCase Color.Yellowclicked_pnl.BackColor = Color.YellowEnd SelectEnd Sub#End Region#Region "Private Subs/Functions"Private Sub AddItem()'Random int from 0 - 3Dim i As Integer = r.Next(0, 4)'Add the panel to the playlistplay_list.Add(pnl_list.Item(i))End SubPrivate Function CheckMatch(ByVal pnl As Panel) As BooleanIf play_list.Item(counter).Name = pnl.Name ThenReturn TrueElseReturn FalseEnd IfEnd Function#End RegionEnd Classhttp://www.vbforums.com/showthread.php?705623-vb-net-SimonMain thing this shows is it isn't a huge bit of code - break it/add to it/examine it and it;'ll give you a feel for vb.net.Good luck, brother! Quote
RIP-Felix Posted July 4, 2015 Author Posted July 4, 2015 Yeah, thats nice. I'll admit that It's not completly greek to me, but most of the commands are. If I played around with it a bit I might be able to figure out what each section is responsable for. Wish they took the effort to add more explanatory text in the code.Ultimarc's controlers also have compatability with LEDblinky and their own PACLED64 controller program. LED bliknky is popular for LED arcade buttons among MAME users. GameEX has a LEDwiz plugin too. I'm pretty unclear on how these work, but as I understand it they allow for LED CP profiles for various emulators and in MAME per game control layouts. I think these are separte from what I was talking about though, so I'd probably be stuck with the SDK and trying to Dev a program myself. Perhaps the first step would be to integrate the LED control Panel first using LEDwiz or LEDblinky first to familiarize myself with the programs.The part I'd have real trouble with is adding button mapping in the 'Simon' game's user interface so you can map the games colored buttons to your control panel's LED or Colored Buttons. And of course sending lighting control out to the controller for LED illumination as you mentioned. Ultimarc links a PacDriveSDK for devs looking to control LEDs with a custom program, info here. It does support VB.net so there's a plus! This is probably what I would have to do and make the Simon game a stand alone game launched via executable. I've puttered around wit Visual Basic before, It was nice, but I was very out of my league. I had to look up commands for everything and how to do somthing basic, when what I wanted was much harder. We'll see thoughPS:The Readme says the Pac-DriveSDK dev is none other than Ben Baker (aka Headkaze)! LOL. Small world huh? Quote
stigzler Posted July 5, 2015 Posted July 5, 2015 Well certainly sounds doable. Mapping your cab buttons will be ok, you just need a keyboard hook class. Plenty about. Dunno whats in the sdk, but if you have a dll or class to manage output then youll be golden. Quote
RIP-Felix Posted July 5, 2015 Author Posted July 5, 2015 I moved this topic from the general forum as it doesn't really fit there.cintinued...Well certainly sounds doable. Mapping your cab buttons will be ok, you just need a keyboard hook class. Plenty about. Dunno whats in the sdk, but if you have a dll or class to manage output then youll be golden.The SDK has a bunch of utilitys I don't understand yet. But when I open the Demo control code, I can at least somewhat tell where it defines buttons, timers, and controler initilization. In the SDK zip there is a readme with controller commands to dev using a PACLED64, for example.<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _Partial Class Form1 Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() Me.Button1 = New System.Windows.Forms.Button Me.Button2 = New System.Windows.Forms.Button Me.SuspendLayout() ' 'Button1 ' Me.Button1.Location = New System.Drawing.Point(12, 15) Me.Button1.Name = "Button1" Me.Button1.Size = New System.Drawing.Size(175, 35) Me.Button1.TabIndex = 0 Me.Button1.Text = "Start" Me.Button1.UseVisualStyleBackColor = True ' 'Button2 ' Me.Button2.Location = New System.Drawing.Point(12, 56) Me.Button2.Name = "Button2" Me.Button2.Size = New System.Drawing.Size(175, 35) Me.Button2.TabIndex = 1 Me.Button2.Text = "Stop" Me.Button2.UseVisualStyleBackColor = True ' 'Form1 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(200, 108) Me.Controls.Add(Me.Button2) Me.Controls.Add(Me.Button1) Me.Name = "Form1" Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Form1" Me.ResumeLayout(False) End Sub Friend WithEvents Button1 As System.Windows.Forms.Button Friend WithEvents Button2 As System.Windows.Forms.ButtonEnd ClassIf Im reading the code right. It makes a simple window displaying 2 buttons. I dont see where the buttons are defined as coming from a controller source (initilized or whatever the terminology is).BTW:what does this mean? "NOTE: The following procedure is required by the Windows Form Designer. It can be modified using the Windows Form Designer. Do not modify it using the code editor."So I guess what I need to do is this:Find a way to hide a GUI config screen behind the game via some keypress (like TAB in mame). That way if you already have the buttons setup you don't see it when the game is run, instead it just goes to the start screen. Create a GUI config screen for adding buttons and placing them where the user wants (like in CPwiz). Adding custom backgrounds and button designs, etc. Simplified of course. I Just need to be able to define "Button1.Green = something like PACLED64 pins 1-3" The part where you input the pin position on the controller into code would be by simply pressing a control in the GUI for "Learn Green Button" which then allows you to press any button on your cab and the backend automatically parses it's loaction into the code. I have no idea how that's done, I'm a noob. I'm sure there's a class for that type of control though. Create the game logic, others have done this, so all I have to do is change the appearance of the lit buttons to match the button layout the user creates in the CPwiz style CP editor. The Button mapper would also have to parse the controler pin loaction into the button locations here too (unless you can tell it to get the button location from the config and go off whatever it was set to). The real issue would be compatability. How do I set it up to recognize any input device, so that whatever controller type the user has will be recognized by the button mapper? Quote
RIP-Felix Posted July 5, 2015 Author Posted July 5, 2015 Just downloaded VB, but haven't messed with it yet.FYI: I'm moving this thread to the User Projects forum since it doesn't really fit here. Continue the thread here. Quote
nullPointer Posted July 5, 2015 Posted July 5, 2015 I moved this topic from the general forum as it doesn't really fit there.I went ahead and merged the two topics to maintain thread continuity. Quote
rockyrocket Posted July 29, 2015 Posted July 29, 2015 I don`t pretend to understand the code above, but maybe can offer some info on the Led controller side of things.Communicating directly with a LedWiz is possible via vbs, it took some time to find the old thread but some examples are here Quote
gambaman Posted February 19, 2018 Posted February 19, 2018 I made an arcade Joystick with integrated Simon Says Game. It used a Teensy++ 2.0 board, but I have also ported it to Arduino Leonardo. The project it published here: https://www.hackster.io/user3853574654/arcade-joystick-x4-plus-simon-game-384309 You can see a video of the system working here: https://www.youtube.com/watch?v=ENW7n0ni5kg&feature=youtu.be Quote
RIP-Felix Posted April 8, 2018 Author Posted April 8, 2018 That's cool. I like how you integrated it into the credit counter so you have to defeat simon to get more credits to play Mame games. An intriguing idea to create that sense of accomplishment for going as far as possible on a single credit. That value is lost by unlimited credits at the push of a button. The only thing is that I'd like it selectable as a stand alone game and have some sort of animation to display onscreen to provide feedback about the simon game while running. A neat solution however. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.