Shonne sent me the actual codez, I guess this was the 'basics' of the original to try and detect the problem. Just some advice, if you have a bug popping up in your game/app, post all the codez, not just a dumb-down version of it, or you'll make it 100x harder to actually track down the bug.
The real codez:
// Project: AnnoyingTiles
// Created: 2016-06-27
// set window properties
SetWindowTitle( "AnnoyingTiles" )
SetWindowSize( 1334, 750, 0 )
width = GetDeviceWidth()
height = GetDeviceHeight()
// set display properties
SetVirtualResolution( width, height )
SetOrientationAllowed( 0, 0, 1, 0 )
//create the sprites
LoadImage ( 1, "circles/circle-blue.png" )
LoadImage ( 2, "circles/circle-green.png" )
LoadImage ( 3, "circles/circle-red.png" )
LoadImage ( 4, "circles/circle-violet.png" )
LoadImage ( 5, "circles/circle-yellow.png" )
LoadImage ( 6, "oval/oval-blue.png" )
LoadImage ( 7, "oval/oval-green.png" )
LoadImage ( 8, "oval/oval-red.png" )
LoadImage ( 9, "oval/oval-violet.png" )
LoadImage ( 10, "oval/oval-yellow.png" )
LoadImage ( 11, "rectangle/rectangle-blue.png" )
LoadImage ( 12, "rectangle/rectangle-green.png" )
LoadImage ( 13, "rectangle/rectangle-red.png" )
LoadImage ( 14, "rectangle/rectangle-violet.png" )
LoadImage ( 15, "rectangle/rectangle-yellow.png" )
LoadImage ( 16, "square/blue-square.png" )
LoadImage ( 17, "square/green-square.png" )
LoadImage ( 18, "square/red-square.png" )
LoadImage ( 19, "square/violet-square.png" )
LoadImage ( 20, "square/yellow-square.png" )
LoadImage ( 21, "triangle/triangle-blue.png" )
LoadImage ( 22, "triangle/triangle-green.png" )
LoadImage ( 23, "triangle/triangle-red.png" )
LoadImage ( 24, "triangle/triangle-violet.png" )
LoadImage ( 25, "triangle/triangle-yellow.png" )
global globalCorrect
function createProblem()
globalCorrect = Random(1,25)
DeleteText(1)
if globalCorrect = 1
CreateText ( 1, "Tap the Circle with Blue color!" )
elseif globalCorrect = 2
CreateText ( 1, "Tap the Circle with Green color!" )
elseif globalCorrect = 3
CreateText ( 1, "Tap the Circle with Red color!" )
elseif globalCorrect = 4
CreateText ( 1, "Tap the Circle with Violet color!" )
elseif globalCorrect = 5
CreateText ( 1, "Tap the Circle with Yellow color!" )
elseif globalCorrect = 6
CreateText ( 1, "Tap the Oval with Blue color!" )
elseif globalCorrect = 7
CreateText ( 1, "Tap the Oval with Green color!" )
elseif globalCorrect = 8
CreateText ( 1, "Tap the Oval with Red color!" )
elseif globalCorrect = 9
CreateText ( 1, "Tap the Oval with Violet color!" )
elseif globalCorrect = 10
CreateText ( 1, "Tap the Oval with Yellow color!" )
elseif globalCorrect = 11
CreateText ( 1, "Tap the Rectangle with Blue color!" )
elseif globalCorrect = 12
CreateText ( 1, "Tap the Rectangle with Green color!" )
elseif globalCorrect = 13
CreateText ( 1, "Tap the Rectangle with Red color!" )
elseif globalCorrect = 14
CreateText ( 1, "Tap the Rectangle with Violet color!" )
elseif globalCorrect = 15
CreateText ( 1, "Tap the Rectangle with Yellow color!" )
elseif globalCorrect = 16
CreateText ( 1, "Tap the Square with Blue color!" )
elseif globalCorrect = 17
CreateText ( 1, "Tap the Square with Green color!" )
elseif globalCorrect = 18
CreateText ( 1, "Tap the Square with Red color!" )
elseif globalCorrect = 19
CreateText ( 1, "Tap the Square with Violet color!" )
elseif globalCorrect = 20
CreateText ( 1, "Tap the Square with Yellow color!" )
elseif globalCorrect = 21
CreateText ( 1, "Tap the Triangle with Blue color!" )
elseif globalCorrect = 22
CreateText ( 1, "Tap the Triangle with Green color!" )
elseif globalCorrect = 23
CreateText ( 1, "Tap the Triangle with Red color!" )
elseif globalCorrect = 24
CreateText ( 1, "Tap the Triangle with Violet color!" )
elseif globalCorrect = 25
CreateText ( 1, "Tap the Triangle with Yellow color!" )
endif
endfunction
//circlesize
function shapeSizes(w,h)
for a=1 to 5
setSpriteSize(a,w,h)
next a
//oval
for b=6 to 10
setSpriteSize(b,w,h-40)
next b
//rectangle
for c=11 to 15
setSpriteSize(c,w,h-40)
next c
//square
for d=16 to 25
setSpriteSize(d,w,h)
next d
endfunction
//setTextSize
function textSizes()
for a=1 to 25
SetTextSize(a,30)
next a
endfunction
//createShapes
function createShapes()
x = Random(1,3)
deleteSprites()
if x=1
CreateSprite(globalCorrect,globalCorrect)
b = Random(1,25)
CreateSprite(b,b)
a = Random(1,25)
CreateSprite(a,a)
SetSpritePosition ( globalCorrect,(GetDeviceWidth()/2)-245, 75 )
SetSpritePosition ( b, (GetDeviceWidth()/2)-75, 75 )
SetSpritePosition ( a, (GetDeviceWidth()/2)+95, 75 )
elseif x=2
CreateSprite(globalCorrect,globalCorrect)
b = Random(1,25)
CreateSprite(b,b)
a = Random(1,25)
CreateSprite(a,a)
SetSpritePosition ( b, (GetDeviceWidth()/2)-75, 75 )
SetSpritePosition ( globalCorrect,(GetDeviceWidth()/2)-245, 75 )
SetSpritePosition ( a, (GetDeviceWidth()/2)+95, 75 )
elseif x=3
CreateSprite(globalCorrect,globalCorrect)
b = Random(1,25)
CreateSprite(b,b)
a = Random(1,25)
CreateSprite(a,a)
SetSpritePosition ( a,(GetDeviceWidth()/2)-245, 75 )
SetSpritePosition ( b, (GetDeviceWidth()/2)-75, 75 )
SetSpritePosition ( globalCorrect, (GetDeviceWidth()/2)+95, 75 )
endif
endfunction
//deleteallsprites
function deleteSprites()
for x=1 to 25
DeleteSprite ( x )
next x
endfunction
//mainloop
createProblem()
createShapes()
global answer
do
// find out which sprite gets hit
if ( GetPointerPressed ( ) = 1 )
answer = GetSpriteHit ( GetPointerX ( ), GetPointerY ( ) )
endif
if answer = globalCorrect
Print("You are Correct!")
createProblem()
createShapes()
endif
textSizes()
shapeSizes(150,150)
Sync()
loop
Just with a quick glance I can see a ton of issues :/ Give me a bit and I'll come up with a quick example of the way I would go about doing this..unless someone beats me to the punch.
Edit: Just to clarify, so your game/app goes as follows(?):
1) show three shapes on screen
2) ask player to select a specific colored shape
3) correctly selecting shape = win
4) incorrectly selecting shape = loose
5)reset game