Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / Sprite Priority Question

Author
Message
MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 10th Nov 2004 22:06
You can set the priority With the Command [SET SPRITE PRIORITY],
But is there a way to tell what the priority of a Sprite is?
DaedalusX
21
Years of Service
User Offline
Joined: 10th Mar 2004
Location:
Posted: 11th Nov 2004 00:17
not sure usully what order u make the sprites is the order of them

Daedalus
MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 11th Nov 2004 01:15
Yes, But if you use [SET SPRITE PRIORITY] then you can set which sprite is displayed on top of others

I need somthing like

Value = SPRITE PRIORITY(1)

But this dosent work, so im wondering if theres some other way to do this...
Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 11th Nov 2004 05:04
you could dim a variable and everytime you change sprite priority store the new priority in the array.


The word "Gullible" cannot be found in any English Dictionary.
MSon
20
Years of Service
User Offline
Joined: 13th Jul 2004
Location: Earth, (I Think).
Posted: 11th Nov 2004 06:02 Edited at: 11th Nov 2004 06:02
Thats a Good Idea, but I have Lots of Sprites, and the Sprite numbers change a lot due to what im doing with them
Flashing Blade
22
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 11th Nov 2004 17:11 Edited at: 11th Nov 2004 17:12
supposing your game had 200 sprites

at the beggining of your program i'd have something like:

dim spritepriority(200)

then in your program make your own sprite making function something like:

function mysprite(spriteno,x,y,image,priority)

sprite spriteno,x,y,image,priority
spritepriority(spriteno)=priority

endfunction


then in your main loop every time you make a sprite use your own sprite function
eg this would make a sprite 10 with image 5 at 100,100 with priority 3:

mysprite(10,100,100,5,3)

now if you need to find the priority of sprite 10 you just look in spritepriority(10).


The word "Gullible" cannot be found in any English Dictionary.

Login to post a reply

Server time is: 2025-05-15 22:50:55
Your offset time is: 2025-05-15 22:50:55