finally properly implemented depth optimization for 2d
This commit is contained in:
@ -30,7 +30,9 @@ static void handle_input(void)
|
||||
state->bunnies[state->bunniesCount].speed.x = (float)(rand() % 500 - 250) / 60.0f;
|
||||
state->bunnies[state->bunniesCount].speed.y = (float)(rand() % 500 - 250) / 60.0f;
|
||||
state->bunnies[state->bunniesCount].color =
|
||||
(Color){(uint8_t)(rand() % 190 + 50), (uint8_t)(rand() % 160 + 80), (uint8_t)(rand() % 140 + 100), 255};
|
||||
(Color){(uint8_t)(state->bunniesCount % 190 + 50),
|
||||
(uint8_t)((state->bunniesCount + 120) % 160 + 80),
|
||||
(uint8_t)((state->bunniesCount + 65) % 140 + 100), 255};
|
||||
state->bunniesCount++;
|
||||
}
|
||||
}
|
||||
@ -46,7 +48,9 @@ static void handle_input(void)
|
||||
state->bunnies[state->bunniesCount].speed.x = (float)(rand() % 500 - 250) / 60.0f;
|
||||
state->bunnies[state->bunniesCount].speed.y = (float)(rand() % 500 - 250) / 60.0f;
|
||||
state->bunnies[state->bunniesCount].color =
|
||||
(Color){(uint8_t)(rand() % 190 + 50), (uint8_t)(rand() % 160 + 80), (uint8_t)(rand() % 140 + 100), 255};
|
||||
(Color){(uint8_t)(state->bunniesCount % 190 + 50),
|
||||
(uint8_t)((state->bunniesCount + 120) % 160 + 80),
|
||||
(uint8_t)((state->bunniesCount + 65) % 140 + 100), 255};
|
||||
state->bunniesCount++;
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "twn_game_api.h"
|
||||
|
||||
#define MAX_BUNNIES 100000 // 100K bunnies limit
|
||||
#define MAX_BUNNIES 500000 // 100K bunnies limit
|
||||
#define BUNNY_W 26
|
||||
#define BUNNY_H 37
|
||||
#define SPRITE_SCALE 1
|
||||
|
Reference in New Issue
Block a user