- int testgravitation(int plattform){
- float x1,x2,y1,y2,z1,z2;
- //hier sind die einzelnen "eckkoordinaten" der plattformen angegeben
- x1=(plattformposx[plattform]);
- x2=(plattformposx[plattform]+(plattformbreite[plattform]*0.1));
- y1=(plattformposy[plattform]+(plattformhoehe[plattform]*0.1));
- y2=(y1+5);
- z1=(plattformposz[plattform]);
- z2=(plattformposz[plattform]+(plattformtiefe[plattform]*0.1));
- //hier die if abfrage ob man sich in dem "gravitationsbereich" befindet
- if(((testposx1 >= x1 && testposx1 <= x2)||(testposx1 >= x1 && testposx1 <= x2)||(testposx2 >= x1 && testposx2 <= x2)) && ((testposy1 >= y1 && testposy1 <= y2)) &&((testposz1 >= z1 && testposz1 <= z2) || (testposz2 >= z1 && testposz2 <= z2))){
- gravitation = 1; //gravitaion ist am anfang 0 wenn man in dem bereich ist wird es auf 1 gesetzt
- // testposy1 = testposy1 - 0.01; <-- die 2 zuweisungen waren die "gravitation" ohne timer
- // testposy2 = testposy2 - 0.01;
- }
- else{
- gravitation = 0; //falls man nicht im bereich ist wird gravitation auf 0 gesetzt
- }
- }