I used this code for showing scores images and hiding them with visual effects as and when users clicked on certain buttons
Local tplayer1score //declare a local variable (you don't have to declare local but it helps to keep track, i think ? )
Code: Select all
if the icon of the target is 1287 then
//this is a button icon, the target is the location of what was just clicked on
set the Loc of image "yourimage.png" to the Loc of the target
//makes the (hidden) image go to the location I just clicked on
show image "yourimage.png"
//shows the image at that location
show image "pow.jpg"
//and another image, at a location where ever you have placed it
lock screen
// for visual effect, Dont want the world to see my crap coding efforts
play ac "godlike.wav"
//I know, just stop saying it :)
hide image "yourimage.png"
hide image "pow.jpg"
unlock screen with visual effect dissolve very fast
// now you see the results of my crap coding efforts, but without the in between effects
//Below, the user clicked on a hi score button and scored 10000 points
//fld "test" may or may not have a number in it.
put fld "test" + 10000 into tplayer1score
//Add numbers to fld "test" by firstly putting fld "test" +10000 into a variable" named (in this case) "tplayer1score"
put tplayer1score into fld "test"
//then put tplayer1score into fld "test", putting overwrites anything that is in fld "test"
// (you can use fld OR field)
end if ]