feat: SFML 3.0, music, upscale, faster animations

This commit is contained in:
kuzgoga
2025-11-01 23:02:44 +07:00
parent 33acb24e20
commit 6e1a625102
13 changed files with 381 additions and 0 deletions

23
src/mouseClickHandler.hpp Normal file
View File

@@ -0,0 +1,23 @@
#pragma once
#include <math.h>
#include <SFML/Graphics.hpp>
#include "structCandy.hpp"
#include "move.hpp"
void mouse_click(int &click, int &x0, int &y0, int tile_size, sf::Vector2i pos, bool &isSwap, int &x, int &y, candy map[][10]){
if (click == 1)
{
x0 = pos.x / tile_size + 1;
y0 = pos.y / tile_size + 1;
}
if (click == 2)
{
x = pos.x / tile_size + 1;
y = pos.y / tile_size + 1;
if (abs(x - x0)+ abs(y - y0) == 1)
{
swap(map[y0][x0], map[y][x], map); isSwap = 1; click = 0;
}
else click = 1;
}
}