Lulunga

class vehicle

Jun 28th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. class Vehicle {
  2. constructor(type, model, parts, fuel){
  3. this.type = type;
  4. this.model = model;
  5. this.parts=parts;
  6. this.parts.quality=this.parts.engine * this.parts.power;
  7. this.fuel=fuel;
  8. }
  9. drive (fuelLoss) {
  10. this.fuel-=fuelLoss;
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment