diff --git a/src/main.cpp b/src/main.cpp index 74856e0..9988320 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -683,7 +683,11 @@ void loop_achterbahn(){ lastCheckspawn=loopmillis; Serial.print("Checking Spawning, wagons "); Serial.println(wagoncount); - if (random(0,SPAWNCHANCE)==0 && wagoncount=WRAPLEDENDPOS){ - #ifdef EDGE_WRAP + #ifdef EDGE_WRAP_END _pos-=WRAPLEDENDPOS; //Wrap around edges #endif - #ifdef EDGE_BOUNCE + #ifdef EDGE_BOUNCE_END _vel*=-1; //bounce at edges #endif - #ifdef EDGE_WALL + #ifdef EDGE_WALL_END //nothing #endif - #ifdef EDGE_KILL + #ifdef EDGE_KILL_END if (_pos>=WRAPLEDENDPOS+(_trainlength*WAGONLENGTH)){ _health=0; } #endif } if (_pos