...
 
Commits (3)
......@@ -6,7 +6,7 @@ name = AapeliBlox
optimize =-O2
hcon = -mwindows # Hide console
version = `cat version`
cflags = -lsfml-graphics -lsfml-window -lsfml-system -std=c++11
cflags = -lsfml-graphics -lsfml-window -lsfml-system -std=c++11 -Wall
all: win linux mac
......
......@@ -123,7 +123,7 @@ namespace AapeliBlox {
+ featuresNextBlockDimensions.y + featurePadding);
nextBlockHeight = 50;
undoHeight = 12;
gameTicks = 5 * 1 * ticksPerSecond; // 5 minutes
gameTicks = 5 * 60 * ticksPerSecond; // 5 minutes
// Fonts/text
scoreText.setFont(dFont);
......@@ -140,11 +140,11 @@ namespace AapeliBlox {
textColor = sf::Color(255, 255, 255, 255);
scoreText.setColor(textColor);
scoreTextNumbers.setColor(textColor);
nextShapeText.setColor(textColor);
timerText.setColor(textColor);
timerTextNumbers.setColor(textColor);
scoreText.setFillColor(textColor);
scoreTextNumbers.setFillColor(textColor);
nextShapeText.setFillColor(textColor);
timerText.setFillColor(textColor);
timerTextNumbers.setFillColor(textColor);
scoreText.setString("Score");
nextShapeText.setString("Next Block");
......@@ -311,19 +311,8 @@ namespace AapeliBlox {
if (ticks - lastMoveTicks[move] >= ((move == jump) ? 3 : 1) * minMoveTicks) {
lastMoveTicks[move] = ticks;
if (move == right || move == left || move == down) {
int mx = 0, my = 0;
switch (move) {
case right:
mx = 1;
break;
case left:
mx = -1;
break;
case down:
my = -1;
break;
}
if (canBlockGo(currentShape, Vector(currentLocation.x + mx, currentLocation.y + my))) {
int mx = (move == right) - (move == left), my = - (move == down);
if (canBlockGo(currentShape, Vector(currentLocation.x + mx, currentLocation.y + my))) {
currentLocation.x += mx;
currentLocation.y += my;
}
......
......@@ -47,7 +47,7 @@ namespace AapeliBlox {
sf::Text sfText;
sfText.setFont(sfont);
sfText.setCharacterSize(scharSize);
sfText.setColor(textColor);
sfText.setFillColor(textColor);
sfText.setString(menuEntries[i]->text);
lineHeight = std::max(int(lineHeight), int(sfText.getLocalBounds().height));
entries.push_back(MenuText(sfText, menuEntries[i]));
......@@ -80,9 +80,9 @@ namespace AapeliBlox {
int drawAt = centery - entries.size() * (lineHeight + padding) / 2 + 4 * padding;
for (int i = 0; i < entries.size(); i++) {
entries[i].sfText.setString(entries[i].entry->text);
entries[i].sfText.setColor(textColor);
entries[i].sfText.setFillColor(textColor);
if (selected == i) {
entries[i].sfText.setColor(textColorHover);
entries[i].sfText.setFillColor(textColorHover);
}
entries[i].sfText.setPosition(centerx - entries[i].sfText.getLocalBounds().width / 2, drawAt);
window.draw(entries[i].sfText);
......