Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <conio.h>
- #include <Windows.h>
- #include <ctime>
- #include <iostream>
- int main()
- {
- SUV bus;
- double x=0, y=0;
- char c;
- while (1)
- {
- bus.GetPosition(x, y);
- printf("%15s : %s\n","Vehicle Type", bus.GetType());
- printf("%15s : ( %.9g , %.9g )\n", "Position (X,Y)", x, y);
- printf("%15s : %.5f\n","Remaining Fuel", bus.GetFuel());
- printf("%15s : %.5g\n","Velocity", bus.GetSpeed());
- // printf("%15s : %d\n", "Gear Position",bus.GetGearPosition());
- bus.GetDirection(x, y);
- printf("%15s : x=%.5f y=%.5f\n","Direction", x, y);
- printf("%15s : %-3d\n","Angle ^ X-axis", bus.getTotalTurnAngle());
- if (_kbhit())
- {
- c = _getch();
- cout << ">>" << c << endl;
- switch (c) {
- case 'a':
- bus.TurnLeft();
- break;
- case 'd':
- bus.TurnRight();
- break;
- case 'g':
- // bus.ShiftGearUp();
- break;
- case 'x':
- // bus.ShiftGearDown();
- break;
- case 'w':
- bus.IncreaseSpeed();
- break;
- case 's':
- bus.DecreaseSpeed();
- break;
- }
- }
- bus.Move();
- Sleep(300); // Delay Korar jonno
- system("CLS");
- }
- return 0;
- }
- // With <3 from Sazan
- // & Edited by Subangkar
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement