Well here's my solution anyway - put the offsets into the type first. But I think the code above may have exposed a bug in AGK.
In the main file...
#include "firing.agc"
// --------------------------------------------------------------
// BULLET VARS
//---------------------------------------------------------------
///////////////////////////////////////////////////////////////////
Global gBulletArray, gBulletCount, bulletType
gBulletCount = 0
TYPE weaponDescription
damage AS FLOAT
dx AS FLOAT
dy AS FLOAT
life AS FLOAT
ox AS FLOAT
ox2 AS FLOAT
oy AS FLOAT
ENDTYPE
Global gBlaster1 AS weaponDescription
gBlaster1.dx = 15
gBlaster1.dy = 0
gBlaster1.life = 50
gBlaster1.damage = 1
gBlaster1.ox = 85
gBlaster1.ox2 = -45
gBlaster1.oy = 25
TYPE bulletType
id AS INTEGER
x# AS FLOAT
y# AS FLOAT
enabled AS INTEGER
sprite AS INTEGER
weaponType AS weaponDescription
ENDTYPE
DIM gBulletArray[20] AS bulletType
for i = 0 to 20
gBulletArray[ i ].sprite = 0
next
Global gBullet1
gBullet1 = LoadImage("bullet1.png")
///////////////////////////////////////////////////////////////////
and in firing.agc
// firing missiles
FUNCTION handleFiring
print("firing")
// turn on bullet and place at player
gBulletArray[ gBulletCount ].enabled = 1
gBulletArray[ gBulletCount ].x# = playerX + cameraX#
gBulletArray[ gBulletCount ].y# = playerY + cameraY#
// assign a weapon type based on presets
gBulletArray[ gBulletCount ].weaponType.dx = gBlaster1.dx
gBulletArray[ gBulletCount ].weaponType.dy = gBlaster1.dy
gBulletArray[ gBulletCount ].weaponType.life = gBlaster1.life
gBulletArray[ gBulletCount ].weaponType.damage = gBlaster1.damage
gBulletArray[ gBulletCount ].weaponType.ox = gBlaster1.ox
gBulletArray[ gBulletCount ].weaponType.oy = gBlaster1.oy
// create a new sprite if required
if (gBulletArray[ gBulletCount ].sprite = 0)
gBulletArray[ gBulletCount ].sprite = CreateSprite( gBullet1 )
endif
if direction$ = "facing left"
SetSpriteFlip( gBulletArray[ gBulletCount ].sprite, 1, 0 )
gBulletArray[ gBulletCount ].weaponType.dx = -gBlaster1.dx
gBulletArray[ gBulletCount ].weaponType.ox = gBlaster1.ox2
endif
if direction$ = "facing right"
SetSpriteFlip( gBulletArray[ gBulletCount ].sprite, 0, 0 )
endif
// set the depth of the sprite
SetSpriteDepth( gBulletArray[ gBulletCount ].sprite, 1 )
SetSpriteVisible ( gBulletArray[ gBulletCount ].sprite, 1 )
// increment the counter ready for next bullet
gBulletCount = gBulletCount + 1
// loop as required
if gBulletCount > 20 then gBulletCount = 0
// kill this one off - we need it next time
if gBulletArray[ gBulletCount ].enabled = 1
gBulletArray[ gBulletCount ].enabled = 0
SetSpriteVisible ( gBulletArray[ gBulletCount ].sprite, 0 )
endif
ENDFUNCTION
FUNCTION updateBullets
ft# = getFrameTime() * frameSpeed#
FOR i = 0 to 20
// is it still alive?
// position bullets if on
if gBulletArray[ i ].enabled = 1
gBulletArray[ i ].weaponType.life = gBulletArray[ i ].weaponType.life - (ft# * 1)
IF gBulletArray[ i ].weaponType.life <= 0
gBulletArray[ i ].enabled = 0
SetSpriteVisible ( gBulletArray[ i ].sprite, 0 )
ELSE
// move it
gBulletArray[ i ].x# = gBulletArray[ i ].x# + ( gBulletArray[ i ].weaponType.dx * ft# )
gBulletArray[ i ].y# = gBulletArray[ i ].y# + ( gBulletArray[ i ].weaponType.dy * ft# )
// draw it
SetSpritePosition(gBulletArray[ i ].sprite, gBulletArray[ i ].x# + gBulletArray[ i ].weaponType.ox, gBulletArray[ i ].y# + gBulletArray[ i ].weaponType.oy )
ENDIF
ENDIF
NEXT
ENDFUNCTION