summaryrefslogtreecommitdiff
path: root/HumanPlayer.cpp
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2018-08-05 18:06:49 +0200
committerXaviDCR92 <xavi.dcr@gmail.com>2018-08-05 18:06:49 +0200
commitefc7020defa40c74a467442e6763df71c0783fd0 (patch)
treefa3f7cf7648e7e05ed0483cf25ead7712f2fc0da /HumanPlayer.cpp
parent6ecb59761ac940e66c9670d23dd65696df3df7cf (diff)
downloadpocketempires-efc7020defa40c74a467442e6763df71c0783fd0.tar.gz
* Increased MAX_SELECTION_DISTANCE, but this should be done according to BaseUnit instead!HEADmaster
+ 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.
Diffstat (limited to 'HumanPlayer.cpp')
-rw-r--r--HumanPlayer.cpp8
1 files changed, 5 insertions, 3 deletions
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. */