From 5aba1f0f337679467c18cddbcbd2ed3f378a1229 Mon Sep 17 00:00:00 2001 From: cflip Date: Sun, 27 Feb 2022 10:08:02 -0700 Subject: Make train movement smoother --- src/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index b1942c9..4fa5e47 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -85,7 +85,7 @@ int main(int argc, char **argv) Level level(32, 32); Bitmap bitmap(Width, Height); - TrainCar car(0, 0); + TrainCar car; int xOffs = 0, yOffs = 0; int xDrag, yDrag; @@ -123,8 +123,7 @@ int main(int argc, char **argv) float mx = x / Scale + xOffs; float my = y / Scale + yOffs; auto pos = screenToTile({ mx, my }); - car.x = pos.x; - car.y = pos.y; + car.setPosition(pos.x, pos.y); } }); -- cgit v1.2.3