First off - Thanks for all the work you've put into UltraDMD.
I started creating an original table with the thought that I'd have to fudge something to make scenarios work without a DMD.
Lo and behold - UltraDMD came to the rescue with flying colors.
I've started implementing it in my table, but I'm getting some crashes.
Notably - it crashes on any time it checks of UltraDMD.IsRendering when a lot of stuff is happening all at once - such as with bumper hits.
Here's one of the relevant sections of code, but it will sometimes bomb in the Timer1 sub, or the OnScoreBoardChanged sub.
As you can see in the code, I'm getting around the errors by enclosing the IsRendering statements inside of On Error Resume Next code.
Am I doing something wrong to cause these crashes, or is the UltraDMD object simply getting overloaded?
Thanks!
Ryan
Sub Bumper1_Hit() ' Process for ALL bumpers
Dim num
If HeavyWaterTry = True Then
Timer1.Enabled = False
PlaySound "Bumper"
AddScore(5000)
numBumpers = (numBumpers + 1) MOD 100
num = " " & CStr(30-numBumpers)
On Error Resume Next
If Not UltraDMD.IsRendering Then
UltraDMD.DisplayScene00ExWithId "bumper", FALSE, "worms_00.png", num, 14, 2, "", -1, -1, UltraDMD_Animation_ScrollOnUp, 500, UltraDMD_Animation_None
End If
On Error Goto 0
'UltraDMD.CancelRenderingWithID "bumper"
'UltraDMD.DisplayScene00ExWithId "bumper", FALSE, "worms_00.png", num, 14, 2, "", -1, -1, UltraDMD_Animation_None, 500, UltraDMD_Animation_None
UltraDMD.ModifyScene00Ex "bumper", num, "", 500
If numBumpers = 30 Then
UltraDMD.CancelRenderingWithId "bumper"
BaronessSuccess = True
DMD_DisplaySceneEx "BaronessCartoon1.jpg", ".", -1, 1, "", -1, -1, 2, 10, 3
DMD_DisplayScene "", " Baroness ", 15, "", -1, 2, 800, 9
DMD_DisplayScene "", "SUCCESS!!", 15, "WORMS DEFEATED", 15, 2, 800, 9
DMD_DisplayScene "", "YOU GOT THE", 15, "HEAVY WATER", 15, 2, 800, 9
HeavyWaterLight.State = 1
HeavyWaterTry = False
numBumperStorage = numBumpers
Timer1.Enabled = True
End If
Else
PlaySound "Bumper"
intScore = 1000 * intTankBonus
AddScore(intScore)
numBumpers = (numBumpers + 1) MOD 100
num = " " & CStr(100-numBumpers)
On Error Resume Next
If Not UltraDMD.IsRendering Then
'UltraDMD.DisplayScene00ExWithId "bumper", FALSE, spaceship, num, 14, 2, "", -1, -1, UltraDMD_Animation_ScrollOnUp, 500, UltraDMD_Animation_None
'DMD_DisplayScene "HISS.jpg", "TANKS TO 1 MILLION", 15, " " & num, 15, 2, 800, 9
UltraDMD.DisplayScene00ExWithId "HISS", FALSE, "HISS.jpg", " HISS TANKS", 15, 6, " " & num, 15, 7, 2, 600, 9
Timer1.Enabled = True
End If
UltraDMD.ModifyScene00Ex "HISS", " HISS TANKS", " " & num, 500
On Error GoTo 0
End If
'MsgBox numBumpers
If numBumpers = 0 Then
intTankBonus = intTankBonus + 1
UltraDMD.CancelRendering
UltraDMD.DisplayScene00ExWithId "HissBonus", FALSE, "HISS.jpg", " TANK BONUS", 15, 6, " " & intTankBonus & " MILLION", 15, 7, 2, 600, 9
intScore = 1000000 * intTankBonus
AddScore(intScore)
End If
End Sub