Hi all,
I am having some trouble storing my GetVirtualJoystickX() to a variable.
function shoot()
dec delay
if GetVirtualJoystickX(2) > 0
if delay <= 0
if GetSpriteExists(num_bullets[j].spr) = 0
num_bullets[j].spr = CreateSprite(0)
SetSpritePosition(num_bullets[j].spr,GetSpriteXByOffset(character)+1,GetSpriteYByOffset(character))
SetSpriteSize(num_bullets[j].spr,1,1)
num_bullets[j].y_ang = GetVirtualJoystickY(2)
num_bullets[j].x_ang = GetVirtualJoystickX(2)
print(num_bullets[j].x_ang)
print(num_bullets[j].y_ang)
if j < 9
j = j + 1
else
j = 0
endif
delay = gun_delay
endif
endif
endif
endfunction
I have no problem storing the Y vector, but for some reason the X won't store any of the negative values -- only the positive ones. This makes it so my sprite can only shoot forward haha. I've looked around the forums and tried messing around with the angles, but I feel like the problem is in the storing of the value.