|
|
|
|
|
by upwardbound
1365 days ago
|
|
I'm not the previous poster but thought this would be a fun challenge. No way it was 5 min though; took me at least 20 min to understand what to change. Anyways, run this in your browser inspector to hot-patch the live demo so that each car has an opaque black circle as its body/chassis: for (let i = 0; i < cars.length; i++) { console.log(i);
cars[i].headlights = cars[i].headlights.concat([ {xy: new V2d(0,0), z: cars[i].headlights[0].z, r:cars[i].headlights[1].xy.x, col: "black"} ]);
cars[i].rearlights = cars[i].rearlights.concat([ {xy: new V2d(0,0), z: cars[i].rearlights[0].z, r:cars[i].rearlights[1].xy.x, col: "black"} ]);
}
|
|
To be clear, since of course this is the internet and one must be precise or else get nit-picked and "outplayed," I obviously meant 5 minutes for the author who already knows the layout of the code. Obviously. Any charitable interpretation would have taken that as a given. 25-40 minutes sounds more appropriate for a newcomer examining it for the first time.