From 8e2fd5758b00036da965effbefdc76c1d373cd23 Mon Sep 17 00:00:00 2001 From: cflip Date: Sat, 26 Mar 2022 11:50:51 -0600 Subject: Implement sprite depth sorting This algorithm draws the level in two passes; the ground and rail tiles are drawn first, then the train cars and walls. This method isn't perfect, but it'll do for now. --- src/train.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/train.h') diff --git a/src/train.h b/src/train.h index d47818e..c496db8 100644 --- a/src/train.h +++ b/src/train.h @@ -14,6 +14,7 @@ public: void draw(Bitmap&, int, int); void setPosition(int x, int y); + Point2D getSpritePosition() const; void setSpeed(float speed) { m_speed = speed; }; // Add a vehicle to the end of this train void addVehicle(Train*); -- cgit v1.2.3