problem with type usage

BlitzMax Forums/BlitzMax Programming/problem with type usage

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I tried doing this outside of a type the why I normally would, and it still wouldn't work. I checked with other lines of loading code that I've written that work, and they're identical except for the name. I tried loading another image, again in the same directory and it still didn't work. Here's my latest code, slightly changed but still not running.

Graphics 640,480
Type Tsprite
Field sprite:timage=LoadImage("sprite.jpg",0)
Field x:Int
Field y:Int
End Type

Global player:Tsprite=New Tsprite

player.x=50
player.y=50
If sprite:timage=Null
Print "null image"
End
EndIf
While Not KeyHit(key_q)
DrawImage player.sprite:timage,player.x,player.y
Flip
Wend

excuse the not indenting but this is just testing I'll clean it up as soon as it works lol.