diff options
author | cflip <cflip@cflip.net> | 2022-02-27 10:08:02 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-02-27 10:11:55 -0700 |
commit | 5aba1f0f337679467c18cddbcbd2ed3f378a1229 (patch) | |
tree | 924e389fbe3fa683563168bf98adab33e8c5b77b /src/main.cpp | |
parent | 000fb3cf7d5df09f9c89f619a870aecf28b82ce2 (diff) |
Make train movement smoother
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
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); } }); |