hi, im making an archery game and need help with my arrow. ill show you the script but what happens is when i sometimes shoot it the arrow goes backwards in a circular motion. also when i hit the target the arrow resets but shoots without me actually shooting it. can some help?
when green falg clicked
set ArrowAngle to 90
set WindMovements to pick random -5 to 5
set ArrowSpeed to 3
when i receive Level2
forever
if right arrow pressed
change ArrowSpeed by 0.5
if left arrow pressed
change ArrowSpeed by -0.5
if up arrow pressed
change ArrowAngle by 1
turn 1 degree ( anticlockwise)
if down arrow pressed
change ArrowAngle by-1
turn 1 degree (clockwise)
if key space pressed
repeat until touching edge
if touching target
say hit
broadcast ResetArrow
else
move WindMovements
move ArrowSpeed
turn 1 degree ( clockwise )
if touching edge
say ahhh you missed
broadcast ResetArrow
when i receive ResetArrow
go to x -143 y -116
Offline
jono3814 wrote:
hi, im making an archery game and need help with my arrow. ill show you the script but what happens is when i sometimes shoot it the arrow goes backwards in a circular motion. also when i hit the target the arrow resets but shoots without me actually shooting it. can some help?
when gf clicked set [ArrowAngle v] to (90) set [WindMovements v] to (pick random (-5) to (5)) set [ArrowSpeed v] to (3) when i receive [Level2 v] forever if (key [right arrow v] pressed?) change [ArrowSpeed v] by (0.5) end if (key [left arrow v] pressed ?) change [ArrowSpeed v] by (-0.5) end if (key [up arrow v] pressed?) change [ArrowAngle v] by (1) turn ccw (1) degrees end if (key [down arrow v] pressed?) change [ArrowAngle v] by (-1) turn cw (1) degrees end if (key [space v] pressed?) repeat until <(touching [edge v]?) or (touching [target v]?)> if (touching [target v]?) say [hit] broadcast [ResetArrow v] else if <<not <(WindMovements) = (0)>> and <not <(((([abs v] of (WindMovements)) / (WindMovements)) * (90)) + (90)) = (direction)>>> turn cw ((WindMovements) / (10)) degrees end move (ArrowSpeed) steps if (touching [edge v]?) say [ahhh you missed] broadcast [ResetArrow v] end end end end when i receive [ResetArrow v] go to x: (-143) y: (-116)
I added/edited a few things to make the script work.
I hope that this helps!
Last edited by ErnieParke (2012-08-16 18:53:57)
Offline
bertdog wrote:
wow
Thanks, though I use a lot more complicated scripts in the car in Zombie Survival.
Offline