Hi all,
So, following some advice I've seen in a few places, I've decided to look through code from other games made with AGK. Some of it has been helpful. However, some of it is raising new questions/confusion.
In particular, I'm looking at the code for "SantasBadElf", a game/code that came with the bundle I purchased. Specifically, it's in the "main_menu.agc" file.
g_iBackground = CreateSprite ( LoadImage ( "main_menu.jpg" ) )
g_iInstructions = CreateSprite ( LoadImage ( "instructions.jpg" ) )
I understand what this code is doing, it's creating a sprite and assigning its image in one statement, instead of two. That's neat.
What I'm confused on, though, is that every other tutorial I've seen indicates that an ID has to be assigned to each image and sprite, as that's how they're referenced by other commands. I'm assuming in this case, the background and instructions can/would be called by their respective variable name... And that, too, makes sense. Actually, assigning IDs to each image/sprite is something I hadn't seen before AGK.
So.. my questions are:
Are IDs optional for Sprites/Images? Are they situational?
Why are they not assigned in this case?
Thanks!