Apologies but I've run out of ideas for this, and after consulting multiple topics I still can't figure it out.
My goal is for the root to spawn in the middle of the screen and to create a helper as a blaster/gun which can be rotated by the player using left or right buttons. Pressing another button will allow you to shoot a child helper/bullet but I can't figure out how to make the velocity change in accordance with the angle of the blaster. I tried saving the angle as a variable but I have no idea what to do with it.
I'm utterly hopeless at mathematics/physics and even programming in general so its got me completely stumped.
Here's the code for the blaster helper and the bullet helper.
;-------------------------------------------------------------------------
;blaster idle state
[statedef 773]
type = a
movetype = u
physics = n
anim = 777
sprpriority=5
[State 0, BindToRoot]
type = BindToParent
trigger1=!time
trigger2=time=640 ;safety
time = 1
pos = 35,-75
[State 0, Angle]
type = AngleDraw
trigger1=1
[State 0, ParentVarSet]
type = ParentVarSet
trigger1=!time
fv = 0
value = 3
[State 0, AngleDraw]
type = Angleadd
trigger1=root, command = "holdfwd"
value=3
[State 0, AngleDraw]
type = Angleadd
trigger1=root, command = "holdback"
value=-3
[State 0, ParentVarSet]
type = ParentVaradd
trigger1=root, command = "holdfwd"
fv = 0
value = 3
[State 0, ParentVarSet]
type = ParentVaradd
trigger1=root, command = "holdback"
fv = 0
value = -3
[State 0, ParentVarSet]
type = ParentVarSet
trigger1=parent,fvar(0) >= 360
trigger2=parent,fvar(0) <= -360
fv = 0
value = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = root, command = "c"
value = S770,0
;shooting
[State 0, ChangeState]
type = changeanim
trigger1 = root, command = "c"
value=778
[State 0, Helper]
type = Helper
trigger1 = root, command = "c"
helpertype = normal ;player
name="pea"
ID=775
stateno=775
pos = 0,5
postype = p1 ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
[State 0, DestroySelf]
type = DestroySelf
trigger1=time>500
trigger2=root,stateno=0
ignorehitpause = 1
;-------------------------------------------------------------------------
;ammo
[statedef 775]
type = a
movetype = a
physics = n
anim = 780
sprpriority=5
[state 701]
type=hitdef
trigger1=!time
attr=S,NA
getpower=0,0
damage=6+random%3,1
priority=3,Hit
hitflag=MAF
guardflag=MA
pausetime=2,9
hitsound=S700,0
guardsound=S105,0
sparkno=9999
sparkxy=9999,9999
ground.velocity=-2,0
ground.type=low
ground.hittime=10
air.velocity=-1,-1
air.hittime=12
[State 0, AssertSpecial]
type = AssertSpecial
trigger1=1
flag = noshadow
[State 0, BindToRoot]
type = BindToparent
trigger1=!time
time = 1
pos = 0,0
[State 0, ChangeState]
type = Destroyself
trigger1=pos y >= 0
trigger2=movecontact
trigger3=time>100
EDIT: Added a picture to perhaps help with context.
Any advice/help would be greatly appreciated.