Inspiration YouTube
- Self-driving car - No libraries
- Self Driving Car Neural Network (Python and NEAT)
- Python Pong AI NEAT
- Car learns to RACE using A.I.
- Self-driving AI car Simulation in Python
2024-02-15
Add traffic2024-02-13
Collision detection2024-02-12
Polygon inner and outer track; Raycasting
for(let i=0; i<traffic.length; i++){
traffic[i].update(road.borders);
}
traffic.forEach(vehicle => vehicle.update(road.borders));
for(let i=0; i<roadBorders.length; i++){
if(polyIntersect(this.polygon, roadBorders[i])) {
return true;
}
}
if (roadBorders.some(border => polyIntersect(this.polygon, border)))
return true;
#assesDamage(roadBorders, traffic){
if(roadBorders.some(border => polyIntersect(this.polygon, border)))
return true;
if(traffic.some(car => polyIntersect(this.polygon, car.polygon)))
return true;
return false;
}
#assesDamage(roadBorders, traffic){
return roadBorders.some(border => polyIntersect(this.polygon, border)) ||
traffic.some(car => polyIntersect(this.polygon, car.polygon));
}