|
|
|
|
fabs(angle - 270.0f) < 0.4
|
|
|
|
217 122 270 218 121 360 219 121 360 220 121 360 |
|
|
https://imgur.com/wtBA4TT |
|
|
|
|
|
|
My aim for using fabs is that sometimes, angles may not be exact values such as 270.0f, 90.0f, etc. |
|
|
When you hit a wall, what direction do you rotate? I assume it's always clockwise 90 degrees. |
angle += 1
this->sprite.setRotation(dir*90); // Is this right? |
|
|
let's look at top left part of the road. First waypoint is UP and second one is RIGHT. |
the rotation is sometimes counter clockwise especially in the CROSS road tile. |
|
|
|
|
Ask your prof if you can add setNext1(), setNext2() and setNext3() members to class Waypoint. |
Why do you have a separate Car class with it's own move() method? Why not just use the vehicle class? |
Your Car::move() method doesn't meet the requirements of move() as described in the assignment. I suggest two methods: nextPos() that determines where the car will move to, and move() that actually moves it to the new location. |
|
|
|
|
|
|