diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-10-21 11:20:34 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-10-21 13:12:42 +0200 |
commit | 20b189455545db5688ed4f14d2966380137ee2db (patch) | |
tree | 7504e059147cfae54fa466b8a4c0073ecbbc582c /src/interface.cpp | |
parent | 29d124b93125d7c9de762c45876f69df3acd549d (diff) |
Start working on path finding.
Diffstat (limited to 'src/interface.cpp')
-rw-r--r-- | src/interface.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/interface.cpp b/src/interface.cpp index 17c1727..0650889 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -48,7 +48,12 @@ void state_t::tick(void) return; case sf::Event::MouseButtonPressed: - if (event.mouseButton.button == 1) { + if (event.mouseButton.button == 0) { + v2f_t point = window->mapPixelToCoords( + sf::Vector2i(event.mouseButton.x, + event.mouseButton.y)); + game->debug_click(point); + } else if (event.mouseButton.button == 1) { camera.dragging = true; camera.drag_ref = window->mapPixelToCoords( sf::Vector2i(event.mouseButton.x, |