summaryrefslogtreecommitdiff
path: root/src/train.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/train.cpp')
-rw-r--r--src/train.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/train.cpp b/src/train.cpp
index 06c43b2..98a493f 100644
--- a/src/train.cpp
+++ b/src/train.cpp
@@ -23,7 +23,11 @@ void Train::draw(Bitmap& bitmap, int xo, int yo)
float yi = ((float)y + (float)(m_nextY - y) * m_progress) * TileSize;
int xx = (int)((xi - yi) / 2.f - (float)xo);
int yy = (int)((xi + yi) / 4.f - (float)yo);
- bitmap.blit(m_sprite, xx, yy, 0, 0, TileSize, TileSize);
+
+ int tx = 0;
+ if (m_dir == East || m_dir == West) tx = 24;
+
+ bitmap.blit(m_sprite, xx, yy, tx, 0, TileSize, TileSize);
}
void Train::setPosition(int tx, int ty)