Posted: 19th Oct 2021 15:40
I noticed that when I load in sprites and add them sprite numbers , then I also load in sprites with just names the program will get confused a lot.

So I load in the numbers first then the named sprites and it looks like there is not much more confused problems, but they still exist.

So what is everyone's practice for loading sprites do you just number each one or do you also name some?

There are some added programs that use functions that load in sprites with names and some that load in sprites with numbers so I guess it all depends on what you use.
Posted: 19th Oct 2021 15:50
What do you mean by named sprites? Sprite IDs are only assigned by an integer.
Posted: 19th Oct 2021 16:03
spikes=1171
createsprite(spikes,spiked)

that is a numbered sprite

rope_1=createsprite(0)

that is a not numbered sprite that the system numbers its self. rope_1 is its name not a number.
Posted: 19th Oct 2021 16:13
rope_1 is an integer variable, same as spikes. The only difference is AppGameKit automatically assigned its value, whereas you manually assigned the spikes variable. If you try Print(rope_1), you'll see it's just a number.
Posted: 19th Oct 2021 16:24
hendron

I understand this fact, I'm not asking what is a system assigned sprite to what is not.

What I'm asking is what' most peoples practice in loading sprites because my program has a couple problems figuring out what sprite is what in some of my program.

That is a bug in the system [Mod Edit] No, it isn't. It's a bug in your code

if I say rocks=1 to 100 then I load in just named sprites the system changes my rock numbers to something else.
Posted: 19th Oct 2021 16:30
I see. That's not a bug in AGK. It's doing exactly what you're telling it to do (each iteration of the for loop assigns rocks the next number between 1 and 100). You're not actually keeping track of the sprite IDs. You'd want to use an array in this case.

+ Code Snippet
Rocks as integer[100]

for i = 1 to 100
  Rocks[i] = CreateSprite(rockImage)
next i
Posted: 19th Oct 2021 17:28
hendron

I have a array set up but was not using it for everything like I should.

thanks for pointing this out.

my program is not getting confused any more.