Player movement and sprites

BlitzMax Forums/BlitzMax Beginners Area/Player movement and sprites

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

- an image variable (TImage); this points to one of the animations that you loaded as global variables


I notice "TImage" is referred to a lot by the BlitzMax community. Is there something special about that particular variable name? I tried typing it and it did not highlight itself, so I highly doubt the possibility of it being a built-in variable with BlitzMax, something I heard from a tutorial website.

Without further ado, here is the new 'player' type, used in the functional version of my code:
' Create the player type
Type t_player
	Field x_pos: Int' x_pos is an integer
	Field y_pos: Int' y_pos is an integer
	Field c_frame: Int' the current frame of the sprite
	Field c_state: spr_s' the current sprite (spr_s for now)
End Type

If I should replace "c_state" with "TImage then please let me know.

EDIT: I tried defining and calling functions the old BlitzBasic way, but it failed. My style of coding usually involves a very sparse main loop which mainly just calls the proper functions to do more complex actions such as updating the sprite, checking collisions, etc. and ideally I would update the animations/sprites in a function rather than in the main loop...that is just my style, that's all.

If you can tell me how to properly use functions in BlitzMax then I'm greatly appreciate it :)