-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcar.h
35 lines (28 loc) · 845 Bytes
/
car.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#ifndef _car // include-guard
#define _car
#include "quad.h"
#include "vektorrechnung.h"
#include "stoppwatch.h"
const int _car_mspmove = 150;
const int _road_lenght = 250;
const float _car_zVal = -300;
class car
{
public:
/* Variablen: position, geschwindigkeit, vordermann */
int oldposition,position,speed,max_speed;
float p;
car* next_car;
glQuad image;
glQuad image_animated;
/* Konstruktoren & Destruktoren - Default... bestimmt */
car(int _speed, car* next);
~car(){if(next_car) next_car->~car();}; // nächsten Destruktor auslösen
/* Funktionen eines Autos: nächsten Zug berechnen, Zeichnen, Animieren */
int distance() {if (next_car) return next_car->position-position; else return 5;}
void move();
void draw();
void draw_animated(stopwatch & timer);
};
#endif