What is the data type of a handle
-
Hello
I can get a sprite handle using createSpriteplayerSpr = createSprite()
or a image handle using loadImage
playerImg = loadImage( "Untied Games/Player ships", false )
Is the playerSpr an int? Can I use it in a struct like this?
Struct hero int sprite int image Endstruct
-
@stevenwu Yes you can do that. However as you are using sprites you can take advantage of the fact that sprites have properties and that you can also define your own.
so if you do
playerSpr = createSprite()
You can access the sprite image using
playerSpr.image
And if you want to create a property you just assign it
playerSpr.hitpoints = 10
See here for a list of built in properties https://fuzearena.com/forum/topic/521/sprite-properties
-
@pianofire It's very helpful, thank you.