6

The spec says Incidentally, be sure not to let drivers pick up any freshmen (i.e., anyone whose home isn’t in js/houses.js)! So you shouldn't pick up that person. Hope that helps, Brenda


2

An elegant way to check if a certain variable was declared (or not) is the in operator. The check if a passenger is a freshman can be done like this: // check for freshmen if (!(PASSENGERS[i].house in HOUSES)) { $("#announcements").html("No freshmen, sorry. Blame the pset specs."); } PASSENGERS[i].house in HOUSES returns true if a variable of the name ...


2

In service.js, exactly in the function named initCB, when you create a new shuttle, you create it like that // instantiate shuttle shuttle = new Shuttle({ heading: HEADING, height: HEIGHT, latitude: LATITUDE, longitude: LONGITUDE, planet: earth, seats: SEATS, velocity: VELOCITY });


2

I found I needed to use code a bit like this shuttle.position.latitude = BUILDINGS[i].lat; shuttle.position.longitude = BUILDINGS[i].lng; shuttle.localAnchorCartesian = V3.latLonAltToCartesian([shuttle.position.latitude, shuttle.position.longitude, shuttle.position.altitude]); viewchange();


1

This seems to have fixed it for me, I think this is what you were talking about as your workaround number 1. Basically banish the person to 0,0 if (PASSENGERS[i].name == shuttle.seats[nextseat][0].name) { PASSENGERS[i].placemark.getGeometry().setLatitude(0); PASSENGERS[i].placemark.getGeometry().setLongitude(0); }


1

OK. Problem solve. Turned out to be I was using a VPN at my school and somehow it stopped my access to the webpage:)


1

if (HOUSES[PASSENGERS[0].house] == false) Here's how: HOUSES is a hash table underneath so when it takes in a key, I've used PASSENGERS[0].house arbitrarily, it return false if the key does not correspond to any values.


1

Success! I embedded the default announcements within the movement functions in regarding movement directions in shuttle.js. the website works good so far :)


Only top voted, non community-wiki answers of a minimum length are eligible