I am back with a very quick example.
DIM array1$[5,5,10]
spriteImage = LoadImage("image.png")
sprite1 = CreateSprite(spriteImage)
firstSubcategory = 1
messageToShow$ = ""
DIM numbers[10]
firstInstance = 1
array1$[1,1,1] = "1"
array1$[1,1,2] = "1"
array1$[1,1,3] = "this is a test"
array1$[1,1,4] = "this is a test"
array1$[1,1,5] = "1"
array1$[1,1,6] = "this is a test"
array1$[1,1,7] = "starting the program"
array1$[1,1,8] = "1"
array1$[1,1,9] = "15"
array1$[1,1,10] = "1"
numbers[1] = 1
numbers[1] = 2
numbers[1] = 3
numbers[1] = 4
numbers[1] = 5
numbers[1] = 6
numbers[1] = 7
numbers[1] = 8
numbers[1] = 9
numbers[1] = 10
endExample$ = "false"
do
if GetPointerPressed()
rem inspect item
if GetSpriteExists(sprite1)
if GetSpriteHitTest(sprite1,ScreenToWorldX(GetPointerX()),ScreenToWorldY(GetPointerY()))
messageToShow$ = array1$[firstInstance,firstSubcategory,7]
rem if a trap has already been found
if array1$[firstInstance,firstSubcategory,10] = "1"
messageToShow2$ = "The program is working so far."
else
if array1$[firstInstance,firstSubcategory,8] = "1"
if Random(1,20) + numbers[9] > Val(array1$[firstInstance,firstSubcategory,9]) - 1
messageToShow2$ = "The random half is higher"
array1$[firstInstance,firstSubcategory,10] = "0"
else
messageToShow2$ = "The random half is lesser."
endif
else
messageToShow2$ = "This is the first test."
endif
endif
if array1$[firstInstance,firstSubcategory,1] = "1"
if array1$[firstInstance,firstSubcategory,2] = "1"
messageToShow3$ = "This is another test."
array1$[firstInstance,firstSubcategory,3] = "1"
else
messageToShow3$ = "End of second test."
endif
endif
endExample$ = "true"
endif
endif
endif
displayText()
sync()
loop
function displayText()
if Len(messageToShow$) > 0
print(messageToShow$)
print("press a key to continue")
messageToShow$ = ""
endif
sync()
do
if GetPointerPressed()
exit
endif
loop
endfunction
Note that the code provided above is a simple example to demonstrate the problem.
Jason