thanks for the reply.
heres the code:
if GetSpriteCollision ( PowerUpObj.spr, BatLeft.spr ) > 0
PowerUp = 1
if PowerUpObj.spr = PowerUp_BigBat.spr
PowerUp_BigBat.time = timer ()
PowerUp_BigBat.flag = 1
elseif PowerUpObj.spr = PowerUp_SpeedBat.spr
PowerUp_SpeedBat.time = timer ()
PowerUp_SpeedBat.flag = 1
elseif PowerUpObj.spr = PowerUp_SlowBall.spr
PowerUp_SlowBall.time = timer ()
PowerUp_SlowBall.flag = 1
endif
SetSpriteVisible ( PowerUpObj.spr, 0 )
endif
this then activates this:
if PowerUp = 1
if PowerUp_BigBat.flag = 1
if timer() - powerUp_BigBat.time < PowerUp_BigBat.MaxTime
SetSpriteScale ( BatRight.spr, 1, PowerUp_BigBat.effect)
else
SetSpriteScale ( BatRight.spr, 1, 1)
PowerUp_BigBat.flag = 0
//PowerUp = 0
endif
endif
if PowerUp_SpeedBat.flag = 1
if timer() - powerUp_SpeedBat.time < PowerUp_SpeedBat.MaxTime
BatRight.sy# = BatRight.sy# * PowerUp_SpeedBat.effect
else
PowerUp_SpeedBat.Flag = 0
endif
endif
if PowerUp_SlowBall.flag = 1
if timer() - PowerUp_SlowBall.time < PowerUp_SlowBall.MaxTime
SetPhysicsGravity ( 1, 0 )
else
SetPhysicsGravity ( 0, 0 )
PowerUp_SlowBall.flag = 0
endif
endif
endif
but only the big bat seems to work?
another small problem i have (nothing to do with the code above) is the speed for the ball. i have to sort the speed:
ball.sx# = random ( 1000, 2000 )
ball.sy# = random ( 1000, 2000 )
xflag = random (0, 1)
yflag = random (0, 1)
if xflag = 1 then ball.sx# = ball.sx# * (-1)
if yflag = 1 then ball.sy# = ball.sy# * (-1)
SetSpritePhysicsVelocity ( ball.spr, ball.sx#, ball.sy# )
but however high i put the random values it never gets any faster eg random ( 1000, 2000 ) * 1000
any suggestions on how to fix this?