Mario Editor: add tool highlighting + WSAD controls

This commit is contained in:
2021-05-29 19:17:45 +02:00
parent 3cb36fe180
commit 58974f8a7e
3 changed files with 159 additions and 38 deletions
+3 -2
View File
@@ -3,7 +3,7 @@
#include "blocks.hpp"
#include "sprites.hpp"
ToolBox::ToolBox(int x, int y, double start_x, double start_y, std::shared_ptr<SDLPP::Renderer> renderer) : SDLPP::RectangleRender(start_x + x*BLOCK_SIZE, start_y + y*BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, renderer) {
ToolBox::ToolBox(int x, int y, double start_x, double start_y, std::shared_ptr<SDLPP::Renderer> renderer, bool coliders) : SDLPP::RectangleRender(start_x + x*BLOCK_SIZE, start_y + y*BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, renderer) {
_x = x;
_y = y;
setId(EDITOR_TOOL_ID);
@@ -11,7 +11,8 @@ ToolBox::ToolBox(int x, int y, double start_x, double start_y, std::shared_ptr<S
setColor("#FFFFFF88");
setPermanent();
setAlignment(SDLPP::OBJ_CENTER, SDLPP::OBJ_CENTER);
addCollision(SDLPP::RectColider(0,0,1,1));
if(coliders)
addCollision(SDLPP::RectColider(0,0,1,1));
}
SDLPP::Vec2D<int> ToolBox::getIndexes() const {