I need to make a hold button for my dice game and wanted to flash on and off between to images begin light and dark, but I also wanted it to show held and bright.
Rem Project: flashobject
Rem Created: Tuesday, July 27, 2010
Rem ***** Main Source File *****
sync on
sync rate 60
set text size 42
dim holdstate(1)
rem make some images
cls rgb(0,128,0)
text 0,0,"1"
get image 1,0,0,32,42
cls rgb(87,255,87)
text 0,0,"2"
get image 2,0,0,32,42
cls rgb(255,192,0)
box 2,2,30,40,rgb(87,255,87),rgb(87,255,87),rgb(87,255,87),rgb(87,255,87)
text 0,0,"3"
get image 3,0,0,32,42
rem make the object
make object plain 1,10,10
rem set up the delay timer
delay2=500
time2=timer()
do
rem switch on and off
if timer()>time2+delay2
on=1-on
time2=timer()
endif
rem check if object been click
if holdstate(1)=1
texture object 1,3
else
rem flash object
if on=1
texture object 1,2
else
if on=0
texture object 1,1
endif
endif
endif
rem set object been clicked
if mouseclick()=1
cursorobj=(pick object(mousex(),mousey(),1,1))
endif
rem set hold state
if cursorobj=1
holdstate(1)=1
endif
sync
loop
Dark Physics makes any hot drink go cold.