|
About the allegro provided coordinate system. |
keprast
Member #16,794
January 2018
|
He is a linked list, which is very inconvenient. -------------------------------- Of course, I hope it becomes a "map" structure. -------------------------------- or,tell me 5.050*10^8 tick, need 1ghz cpu what time? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
I don't really know what you're talking about. The old SGI STL Template Guide is no longer being hosted by SGI since their acquisition by Hewlett Packard (which is BS). Luckily, I've got a copy I downloaded for reference. Extract the 7z archive, and then view STL_doc/index.html . Look at std::vector, std::map, and std::list . You can store an ALLEGRO_VERTEX in whatever data structure you wish, and then process it as an array. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
keprast
Member #16,794
January 2018
|
I am sorry.Although I use Google Translate.But obviously not easy. array[1000]{1,2,3...}; for(int i = 0;i < 1000;i++) { if(array[i] == x){ //something } }
Like this, if the array is 10000? 100000? |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Can you post more code? I need context - what are you using this with, and what for? 你能發表更多的代碼嗎? 我需要上下文 - 你在用什麼,以及為了什麼? My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
keprast
Member #16,794
January 2018
|
@Edgar Reynaldo Projectile collision.This is the structure of my code. If you can, can you give me some information? |
LennyLen
Member #5,313
December 2004
|
keprast said: But obviously, assuming I have 1000 objects and 1000 bullets, I need to count 1000 * 1000 times. The usual method is to divide your screen into sections and only check for collisions between objects in the same section. Try looking up quadtrees.
|
keprast
Member #16,794
January 2018
|
@LennyLen I lack relevant knowledge, need some literature. |
LennyLen
Member #5,313
December 2004
|
I've never needed to use them, so I only know how they work in theory. This might help, if you can translate it: Use Quadtrees to Detect Likely Collisions in 2D Space
|
keprast
Member #16,794
January 2018
|
Thanks! |
|