The best way is to just load both images or make one bitmap and grab the images, make a sprite using a variable for the image number used for the sprite, and make an if/then statement to change the variable.
` Load the bitmap
load bitmap "Bulbs.bmp",1
` Get images
get image 1,0,0,149,235,1
get image 2,151,0,300,235,1
` Change current working bitmap to the main screen
set current bitmap 0
` Define CSprite as the first image number (Off)
CSprite=1
do
` Show Sprite
sprite 1,0,0,CSprite
if keystate(57)
` If spacebar is pressed change image used to 2
CSprite=2
else
` If the spacebar is not pressed change to image 1
CSprite=1
endif
loop
In the command "sprite 1,0,0,CSprite" the two zeros are the x and y coordinates. If you just change those numbers the bulb can be anywhere on the screen.
You can do the following to make the sprite follow the mouse (this is perfect to make your own mice... just add "hide mouse" at the top of your code if you don't want to see the normal mouse):
sprite 1,mousex(),mousey(),CSprite
Edit: Just in case you don't notice... the image loaded in this code snip is attached to this message... just hit the download button in the lower right of this box.