What is happening:
The bullet is not centered like it is suppose to be. It is always off for some reason. I've play around with it for a half an hour trying to get it to work.
I would have taken a screenshot if I could but you can't of agk which sucks.
Tbis should be correct but it doesn't position it in the center of the image:
moveSpriteRight(Bullets[BulletCount].Sprite, GetSpriteWidth(Arrow) / 2 + GetSpriteWidth(Bullets[BulletCount].Sprite) / 2)
moveSpriteUp(Bullets[BulletCount].Sprite, GetSpriteHeight(Arrow) / 2 + GetSpriteHeight(Bullets[BulletCount].Sprite) / 2)
Function CreateRedBullet(Sprite)
Angle# = GetSpriteAngle(Sprite)
Bullets[BulletCount].Sprite = CreateSprite(RedLaser_Img)
SetSpriteScale(Bullets[BulletCount].Sprite, 0.15, 0.15)
SetSpritePosition(Bullets[BulletCount].Sprite, GetSpriteX(Arrow), GetSpriteY(Arrow))
SetSpriteAngle(Bullets[BulletCount].Sprite, Angle#)
moveSpriteRight(Bullets[BulletCount].Sprite, GetSpriteWidth(Arrow) / 2 + GetSpriteWidth(Bullets[BulletCount].Sprite) / 2)
moveSpriteUp(Bullets[BulletCount].Sprite, GetSpriteHeight(Arrow) / 2 + GetSpriteHeight(Bullets[BulletCount].Sprite) / 2)
`MoveSprite(Bullets[BulletCount].Sprite, 2.4)
`moveSprite2(Bullets[BulletCount].Sprite, 1.4, Angle - 90)
BulletCount = BulletCount + 1
EndFunction
rem moves a sprite to the right when not rotated using a positive value
function moveSprite(spriteID, amount#)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
a# = getSpriteAngle(spriteID)
x# = getSpriteXbyOffset(spriteID)
y# = getSpriteYbyOffset(spriteID)
setSpritePositionByOffset(spriteID,x#+cos(a#)*amount#,y#+sin(a#)*amount#*aspect#)
endfunction
function moveSprite2(spriteID, amount#, a#)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
`a# = getSpriteAngle(spriteID)
x# = getSpriteXbyOffset(spriteID)
y# = getSpriteYbyOffset(spriteID)
setSpritePositionByOffset(spriteID,x#+cos(a#)*amount#,y#+sin(a#)*amount#*aspect#)
endfunction
rem moves a sprite up when not rotated using a positive value
function moveSpriteUp(spriteID, amount#)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
a# = getSpriteAngle(spriteID)
x# = getSpriteXbyOffset(spriteID)
y# = getSpriteYbyOffset(spriteID)
setSpritePositionByOffset(spriteID,x#+sin(a#)*amount#,y#-cos(a#)*amount#*aspect#)
endfunction
rem moves a sprite up when not rotated using a positive value
function moveSpriteRight(spriteID, amount#)
rem get display data
dw# = getVirtualWidth()
dh# = getVirtualHeight()
aspect# = (dw# / dh#)
if aspect# = 1.0
aspect# = getDisplayAspect()
else
aspect# = 1.0
endif
a# = getSpriteAngle(spriteID) + 90
x# = getSpriteXbyOffset(spriteID)
y# = getSpriteYbyOffset(spriteID)
setSpritePositionByOffset(spriteID,x#+cos(a#)*amount#,y#+sin(a#)*amount#*aspect#)
endfunction