sprite scale help

Blitz3D Forums/Blitz3D Programming/sprite scale help

how do i get this to work? i have a sprite that i want to scale bigger as i hold down the mouse, and scale smaller when i let go of the mouse. what is wrong with my code.

Function update_player()

For p.player=Each player
If KeyDown(200) Or KeyDown(17) MoveEntity p\ent,0,0,p\speed
If KeyDown(208) Or KeyDown(31) MoveEntity p\ent,0,0,-p\speed

If KeyDown(203) Or KeyDown(30) MoveEntity p\ent,-p\speed/2,0,0
If KeyDown(205) Or KeyDown(32) MoveEntity p\ent,p\speed/2,0,0


player_fire(p\wep,1);THIS IS THE FUNCTION THAT DOES THE SPRITE STUFF.


mouselook()
get_pos(p\ent)

If EntityY(p\ent)>10 MoveEntity p\ent,0,-.95,0
Next
End Function
;**************************************************
;**************************************************
Function player_fire(parent,q)
If KeyHit(16) Stop

beam=CreateSprite(parent)
RotateEntity beam,0,90,0

If MouseDown(1) scale=Sin(q)
If MouseDown(1)=False scale=Sin(-q)

If scale>0 Or scale<179

ScaleEntity beam,1,scale,1
MoveEntity beam,0,0,scale
End If

End Function


Try using ScaleSprite instead of ScaleEntity ?

nevermind i fixed it
i was rewriting the variable elsewhere