I have main.agc which defines my game objects:
// Object Structure.
Type GameObj
Obj_Image
Obj_Sprite
x#
y#
Obj_Width
Obj_Height
EndType
//====== Game Objects ==================
// Cards
Card_0 as GameObj
//======================================
in Media.agc I have 2 functions, 1 loads the object, the other calls that function to load each image into an object:
function LoadSprite(obj as GameObj, ImgName as string)
obj.Obj_Image = LoadImage(ImgName)
obj.Obj_Sprite = CreateSprite(obj.Obj_Image)
obj.Obj_Width = GetSpriteWidth(obj.Obj_Sprite)
obj.Obj_Height = GetSpriteHeight(obj.Obj_Sprite)
EndFunction
Function LoadCards()
LoadSprite(Card_0, "0.jpg")
EndFunction
When I call LoadCards() from Main.AGC it crashes. When I call LoadSprite(Card_0, "0.jpg") from main.agc it works fine?
Is this a compiler bug? Or am doign something wrong?
Thanks