I'm experimenting with muzzle flash sprites.
I have this script now:

Code:
function muzzle(){
var tmpx = random(0.3)+0.5;
muzzle_pan.scale_x = tmpx;
muzzle_pan.scale_y = tmpx;
muzzle_pan.pos_x = (screen_size.x - bmap_width(muzzle_pan.bmap))/2;
muzzle_pan.pos_y = (screen_size.y - bmap_height(muzzle_pan.bmap))/2;
muzzle_pan.flags = VISIBLE | OVERLAY;
wait(-0.05);
muzzle_pan.flags = 0;
}


I also have a center screen screen script, the 2 longer lines of coding.
But the center screen script doesn't work on my random resize script, hoe can I make it so that the muzzle always displays in the center?


The best games are the games you create yourself.