Hi.
I want make a cannonball game. for this I created a sprite and want when GetPointerPressed() = 1, change cannon sprite angle between (-Y - +Y). But I can\'t good do it.
Please guide Me
Thanks.
SetDisplayAspect( 4.0/3.0 )
global Player as Integer
global angle as float
Player = CreateSprite(0)
SetSpritePositionByOffset(Player,20,80)
SetSpriteSize(Player,30,5)
do
Print (angle)
angle = GetSpriteAngle(Player)
PX# = GetPointerX()
PY# = GetPointerY()
if GetSpritehittest(Player,ScreenToWorldX(PX#),ScreenToWorldY(PY#))
if GetPointerPressed() = 1
PY2# = GetPointerY()
else
if GetPointerState () = 1
VecY# = PY2# - PY#
SetSpriteAngle(Player,VecY#)
endif
endif
endif
Sync()
loop