mirror of
https://github.com/ProgramSnail/snake_2024.git
synced 2025-12-06 22:48:43 +00:00
some refastoring, cycled map
This commit is contained in:
parent
b4509733da
commit
1e9c70f7d8
5 changed files with 44 additions and 16 deletions
|
|
@ -49,8 +49,8 @@ public:
|
|||
|
||||
void draw(Veci offset) override {
|
||||
for (const auto &food : food_) {
|
||||
Veci food_pos = food.pos - offset;
|
||||
if (utils::is_valid_pos(food_pos) and not food.eaten) {
|
||||
Veci food_pos = utils::to_world_coord(food.pos - offset);
|
||||
if (utils::is_on_screen(food_pos) and not food.eaten) {
|
||||
paint::circle({{
|
||||
.pos = food_pos,
|
||||
.color = color::scale(config_.food_color,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue