From efc7020defa40c74a467442e6763df71c0783fd0 Mon Sep 17 00:00:00 2001 From: XaviDCR92 Date: Sun, 5 Aug 2018 18:06:49 +0200 Subject: * Increased MAX_SELECTION_DISTANCE, but this should be done according to BaseUnit instead! + BaseUnit now takes a pointer to a Camera object. + Implemented Unit basic movement. + Initial stub for Coordinates class, meant to replace all manual X/Y coordinates handling between classes. --- HumanPlayer.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'HumanPlayer.cpp') diff --git a/HumanPlayer.cpp b/HumanPlayer.cpp index b432d18..6be3f37 100644 --- a/HumanPlayer.cpp +++ b/HumanPlayer.cpp @@ -63,7 +63,9 @@ HumanPlayer::HumanPlayer(const char* const strPlayerName, const Camera& cam) : Player(strPlayerName), _eState(PLAYER_STATE_IDLE), _cam(cam), -_ABtnFrames(0) +_cursor(cam), +_ABtnFrames(0), +_BBtnFrames(0) { _unitsMap[0].create(Unit::UNIT_ID_PEASANT, 16, 16); } @@ -104,7 +106,7 @@ void HumanPlayer::drawHandler(void) Sprite cursorSpr(au8MouseSprData, false, INVERT); /* Transfer Cursor to Sprite coordinates. */ - cursorSpr.setPos(_cursor.getX(), _cursor.getY()); + cursorSpr.setPos(_cursor.getScreenX(), _cursor.getScreenY()); /* Draw cursor sprite. */ cursorSpr.draw(); @@ -137,7 +139,7 @@ enum HumanPlayer::tPlayerState HumanPlayer::selectUnit(void) /* Maximum distance, in pixels, * between unit and cursor * in order to select a unit. */ - MAX_SELECTION_DISTANCE = 8 + MAX_SELECTION_DISTANCE = 32 }; /* Extract Unit object X position. */ -- cgit v1.2.3