Ok, unsure, but i've given it ago. What i want, is the user to be presented with a list of options, and then upon picking their chosen character, that'll be the one they'll use.
Only way i could think about doing this is via:
function userPlane()
redP = CreateText("red")
SetTextSize(redP,60)
SetTextPosition(redP,sW / 2,100)
SetTextAlignment(redP,1)
blueP = CreateText("blue")
SetTextSize(blueP,60)
SetTextPosition(blueP,sW / 2,200)
SetTextAlignment(blueP,1)
yellowP = CreateText("yellow")
SetTextSize(yellowP,60)
SetTextPosition(yellowP,sW / 2,300)
SetTextAlignment(yellowP,1)
greenP = CreateText("green")
SetTextSize(greenP,60)
SetTextPosition(greenP,sW / 2,400)
SetTextAlignment(greenP,1)
if GetPointerPressed()=1 and GetTextHitTest (redP,ScreenToWorldX(GetPointerX ()),ScreenToWorldY(GetPointerY ()))
createsprite(2,0)
AddSpriteAnimationFrame ( 2, LoadImage ("planes/planeRed1.png") )
AddSpriteAnimationFrame ( 2, LoadImage ("planes/planeRed2.png") )
AddSpriteAnimationFrame ( 2, LoadImage ("planes/planeRed3.png") )
playsprite(2)
endif
if GetPointerPressed()=1 and GetTextHitTest (blueP,ScreenToWorldX(GetPointerX ()),ScreenToWorldY(GetPointerY ()))
createsprite(1,0)
AddSpriteAnimationFrame ( 1, LoadImage ("planes/planeBlue1.png") )
AddSpriteAnimationFrame ( 1, LoadImage ("planes/planeBlue2.png") )
AddSpriteAnimationFrame ( 1, LoadImage ("planes/planeBlue3.png") )
endif
if GetPointerPressed()=1 and GetTextHitTest (yellowP,ScreenToWorldX(GetPointerX ()),ScreenToWorldY(GetPointerY ()))
createsprite(3,0)
AddSpriteAnimationFrame ( 3, LoadImage ("planes/planeYellow1.png") )
AddSpriteAnimationFrame ( 3, LoadImage ("planes/planeYellow2.png") )
AddSpriteAnimationFrame ( 3, LoadImage ("planes/planeYellow3.png") )
endif
if GetPointerPressed()=1 and GetTextHitTest (greenP,ScreenToWorldX(GetPointerX ()),ScreenToWorldY(GetPointerY ()))
createsprite(4,0)
AddSpriteAnimationFrame ( 4, LoadImage ("planes/planeGreen1.png") )
AddSpriteAnimationFrame ( 4, LoadImage ("planes/planeGreen2.png") )
AddSpriteAnimationFrame ( 4, LoadImage ("planes/planeGreen3.png") )
endif
endfunction
do
userPlane()
Sync()
loop
that lets the user pick, but how would i SAVE their pick? I assumed it'll be saved within a variable, and then whenever you call that variable up, that'll be the users earlier pick, but i'm unsure how to do it.
I also believe the code above, is extremely messy, and i'm sure there's an easier and correct way of putting it.
also, once you've clicked on the four colours, you're no longer able to pick. Anyway i can cycle through them until i click a confirm button.
Thanks.
EDIT Update. Now i pick the plane, and it moves to a new screen via
function userPlane()
redP = CreateText("red")
SetTextSize(redP,60)
SetTextPosition(redP,sW / 2,100)
SetTextAlignment(redP,1)
blueP = CreateText("blue")
SetTextSize(blueP,60)
SetTextPosition(blueP,sW / 2,200)
SetTextAlignment(blueP,1)
yellowP = CreateText("yellow")
SetTextSize(yellowP,60)
SetTextPosition(yellowP,sW / 2,300)
SetTextAlignment(yellowP,1)
greenP = CreateText("green")
SetTextSize(greenP,60)
SetTextPosition(greenP,sW / 2,400)
SetTextAlignment(greenP,1)
if GetPointerPressed()=1 and GetTextHitTest (redP,ScreenToWorldX(GetPointerX ()),ScreenToWorldY(GetPointerY ()))
createsprite(2,0)
setviewoffset(sW,0)
SetSpritePosition(2,sW,0)
AddSpriteAnimationFrame ( 2, LoadImage ("planes/planeRed1.png") )
AddSpriteAnimationFrame ( 2, LoadImage ("planes/planeRed2.png") )
AddSpriteAnimationFrame ( 2, LoadImage ("planes/planeRed3.png") )
playsprite(2)
endif
if GetPointerPressed()=1 and GetTextHitTest (blueP,ScreenToWorldX(GetPointerX ()),ScreenToWorldY(GetPointerY ()))
createsprite(1,0)
setviewoffset(sW,0)
SetSpritePosition(1,sW,0)
AddSpriteAnimationFrame ( 1, LoadImage ("planes/planeBlue1.png") )
AddSpriteAnimationFrame ( 1, LoadImage ("planes/planeBlue2.png") )
AddSpriteAnimationFrame ( 1, LoadImage ("planes/planeBlue3.png") )
endif
if GetPointerPressed()=1 and GetTextHitTest (yellowP,ScreenToWorldX(GetPointerX ()),ScreenToWorldY(GetPointerY ()))
createsprite(3,0)
setviewoffset(sW,0)
SetSpritePosition(3,sW,0)
AddSpriteAnimationFrame ( 3, LoadImage ("planes/planeYellow1.png") )
AddSpriteAnimationFrame ( 3, LoadImage ("planes/planeYellow2.png") )
AddSpriteAnimationFrame ( 3, LoadImage ("planes/planeYellow3.png") )
endif
if GetPointerPressed()=1 and GetTextHitTest (greenP,ScreenToWorldX(GetPointerX ()),ScreenToWorldY(GetPointerY ()))
createsprite(4,0)
setviewoffset(sW,0)
SetSpritePosition(4,sW,0)
AddSpriteAnimationFrame ( 4, LoadImage ("planes/planeGreen1.png") )
AddSpriteAnimationFrame ( 4, LoadImage ("planes/planeGreen2.png") )
AddSpriteAnimationFrame ( 4, LoadImage ("planes/planeGreen3.png") )
endif
endfunction
do
userPlane()
Sync()
loop
So i suppose i'm getting there - But if someone could explain how to cycle through the options, and stream line the code above, that would be great. I'll continue messing with it myself, and post here.
Khadin