Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Game Load
- START
- IF Directory Doesnt Exist 'AppData\MatchGame'
- Create it
- ENDIF
- Build Buttons
- Load Stats
- For Every Button That Is A MatchButton
- Disable Them
- EndIF
- END
- Build Buttons
- START
- Fill Up DataTable with numbers from 1 - 18 twice
- For Every Built Button in a 6x6 Cell
- Give them a number each
- Do Until Proposed Value is NOT Taken THEN
- Use Proposed Value
- Loop
- Actual Value = Proposed Value
- Proposed Value = '???'
- Adjust Default Settings
- Bring Buttons to Front
- Add them to control list
- ENDFOR
- END
- ______
- Save Stats
- START
- Copy Without DataGridView Header
- Select All Entries In DataGridView
- Write Them to Directory 'Appdata\MatchGame'
- Clear Selected Entries
- END
- ______
- Load Stats
- START
- Clear DataGridView
- IF Directory Does Exist 'AppData\MatchGame'
- For Each Row And Column In DataGridView
- Add Seperated Data As Row To DataGridView
- ENDFOR
- ENDIF
- END
- ______
- Match Timer Tick
- START
- INPUT: TimeLeft, StreakCount, Matches
- Subtract 100ms FROM TimeLeft
- Time Left Label = TimeLeft
- IF TimeLeft Is EqualTo or Less Than 0 THEN
- For Every MatchButton In Controls
- Disable MatchButton
- Time Left Label = 'Times Up!'
- Stop Timer Ticking
- Output: Date, Score, TimeLeft To DataGridView New Row
- Save Stats
- ENDFOR
- ELSEIF TimeLeft Is Greater Than 0 THEN
- IF Matches Are Equal To 18
- Stop Timer Ticking
- Output Date, Score, TimeLeft to DataGridView New Row
- Save Stats
- ENDIF
- ENDIF
- END
- __________
- Handling Point Calculation
- START
- INPUT: StreakStart, StreakCount, TimeLeft
- IF StreakStart - TimeLeft Is Greater Than 3 Then
- StreakCount + 1
- Score + 1000 * TimeLeft * 0.1 * StreakCount
- ELSE
- StreakCount = 0
- Score += 1000 * TimeLeft * 0.1
- ENDIF
- Output: Matches + 1, StreakStart = TimeLeft
- END
- __________
- MatchButtonClick
- START
- IF Selected Data Is Not Nothing Then
- MatchButton = ActualValue
- Disable MatchButton
- MatchButton Background Color = White
- IF ActualValue = DataSelected THEN
- Handle Point Calculation
- For Each MatchButton In Controls
- IF MatchButton Actual Value = Selected Data THEN
- Disable MatchButton
- MatchButton SuccessfullyMatched = True
- MatchButton Background Color = LimeGreen
- MatchButton Foreground Color = White
- END
- ENDFOR
- ELSE
- Selected Data = MatchButton ActualValue
- IF LastSelectedMatchButton Is NOT SuccessFullyMatched THEN
- Enable LastSelectedMatchButton
- LastSelectedMatchButton Text = '???'
- LastSelectedMatchButton Background Color = Default
- END
- LastSelectedMatchButton = MatchButton
- END
- ELSE
- MatchButton = ActualValue
- MatchButton Background Color = White
- Selected Data = MatchButton Text
- LastSelectedMatchButton = MatchButton
- Disable LastSelectedMatchButton
- ENDIF
- END
- _________________
- BtnStart Click
- START
- IF NOT Already Started Once THEN
- Reset Data
- Start Timer Tick
- Started Once = True
- ELSE
- Restart Form
- END
- END
- _________________
- BtnPauseContinue Click
- START
- IF Button Text = 'Pause' THEN
- Stop Timer Tick
- Button Text = 'Continue'
- For Each MatchButton In Controls
- Disconnect MatchButton Handler
- ENDFOR
- ELSE
- Start Timer Tick
- Button Text = 'Pause'
- For Each MatchButton In Controls
- Reconnect MatchButton Handler
- ENDFOR
- END
- END
- _________________
- ResetData
- START
- INPUT: All Variables
- For Each MatchButton In Controls
- IF MatchButton Is Matched Then
- MatchButton Text = '???'
- MatchButton Background Color = Default
- MatchButton Foreground Color = Default
- ENDIF
- ENDFOR
- OUTPUT: All Variables To Default States
- END
- _________________
- BtnMinimize Click
- START
- Game WindowState = Minimized
- END
- _________________
- BtnClose
- START
- Exit Application
- END
- _________________
- FormHandle Mouse Down
- START
- MoveWindow
- END
- _________________
- Move Window
- START
- IF Button Is MouseButton Left THEN
- Release Capture
- Send Message To Move Form With Handle
- END
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement