0

I'm wondering what methods should i use in order to keep the cpu usage down in the game i'm making. i need to design a level and evey frame it should call a couple of arrays and check all their elements. I can do it by making several arrays and check all their elements individually, or i can make one array and extract the data by using regex in every one of the elements. the question is, what is better and what is faster?

an example of one array using regex:

levels[0] = new Array
(
    "1", "1", "1", "1", "1",
    "1", "2::1:10*10,1:172*10,1:42*30,", "3::1:30*30,64", "1", "1",
    "1", "1", "1", "4::2:30*30,64", "1",
    "1", "1", "1", "1", "1",
    "1", "1", "1", "1", "1",
    "1", "1", "1", "1", "1"
);
4

1 に答える 1