Hi, I have a little problem with lists & sorting function.
First of all: I have 2 lists that have in part the same object, Object_list and Blob_list.
In the first list I add everything while the second is used only for checking events (collisions and so on...).
So reading from the object_list permit to draw on the screen all the entities, while to check collision beetwen the current-entity and other possibilities I use the other list.
My problem is: I need a z-order for the the blob/sprite drawing...and here I have problems.
If I do SORTLIST (blob_list) It could be ok, but If I do SortList Object_list I sort ALL the objects...and this is wrong.
I think to create a manual function to sort the entities in blob_list and (with the link) in object_list, but at the moment I melted my brain...
I hope you understand the problem...
My first approach was to use a personal Compare() function with tipo=0 specified, but it doesn't work.
My second approach (current WIP...) is to create a Function Sort() to sort both the lists: I need to understand correctly the Link, Link._pred and Link._succ....
First of all: I have 2 lists that have in part the same object, Object_list and Blob_list.
In the first list I add everything while the second is used only for checking events (collisions and so on...).
So reading from the object_list permit to draw on the screen all the entities, while to check collision beetwen the current-entity and other possibilities I use the other list.
My problem is: I need a z-order for the the blob/sprite drawing...and here I have problems.
If I do SORTLIST (blob_list) It could be ok, but If I do SortList Object_list I sort ALL the objects...and this is wrong.
I think to create a manual function to sort the entities in blob_list and (with the link) in object_list, but at the moment I melted my brain...
I hope you understand the problem...
Type Tentity'generic entity type field xpixel,ypixel field tipo' 0 - is a 'sprite, 1 is a basic element... field ogg_link:tlink ' the link to Object_list '... End Type
My first approach was to use a personal Compare() function with tipo=0 specified, but it doesn't work.
My second approach (current WIP...) is to create a Function Sort() to sort both the lists: I need to understand correctly the Link, Link._pred and Link._succ....