02-04-2025, 06:00 PM
(This post was last modified: 02-04-2025, 06:06 PM by stevantosic.)
I think this part of Litdev's code (GRWW331.000) should be emphasized:
Code:
urlGet = "https://litdev.uk/apps/maze3D/maze3D.php?action=get"
urlSet = "https://litdev.uk/apps/maze3D/maze3D.php?action=set"
'Random walk
While ("True")
GetData()
'Possible directions
numdir = 0
dirs = ""
If (data["dir0"] = 1) Then
numdir = numdir+1
dirs[numdir] = 0
EndIf
If (data["dir90"] = 1) Then
numdir = numdir+1
dirs[numdir] = 90
EndIf
If (data["dir180"] = 1) Then
numdir = numdir+1
dirs[numdir] = 180
EndIf
If (data["dir270"] = 1) Then
numdir = numdir+1
dirs[numdir] = 270
EndIf
'Pick one randomly and send the animation
dir = dirs[Math.GetRandomNumber(numdir)]
TextWindow.WriteLine("Next direction will be "+dir)
LDNetwork.SendWebRequest(urlSet+"&animate="+dir) 'Valid values are 0, 90, 180 & 270
'The animations take around 1000ms to fully complete if the screen is running at 60 fps or more (smaller browser window runs faster fps)
'We can queue up new animations at any time, but they won't start until the previous finished
'Here we wait an extra second after until the previous animation finishes so we can see them clearly
Program.Delay(2000)
EndWhile