#include "Car.h"
#include "CrossyChicken.h"


Car::Car(){  
    //different speeds of vehicles
    slow = 0.4;
    medium = 1.0;
    fast = 1.5;
    grid = 4;
    seperation = 0;
    
    screenHeight = 48;
    screenWidth = 84;
    size = 3; 
    
    // width of all vehicles
    vehicle.width = grid * size;
}

void Car::setRow(int row){
    this->row = row;
    
    // y position of all vehicles
    vehicle.y = screenHeight - grid * row;
    
    // height of all vehicles
    vehicle.height = grid;
}

void Car::setSeperation(int seperate){
    this->seperation = seperate;
    
    // intialize the vehicle size and position in lcd
    // x position of all vehicles
    vehicle.x = 8 + seperation;
}

void Car::speedSlow(){
    speed = slow;
    
    vehicle.x += slow;
}

void Car::speedMedium(int dir, int speed){     
    speed = medium;  
    
    //vehicle.x += speed;
    
    switch(dir)
    {
        case 1:
            vehicle.x += medium;
            break;
        case 2:
            vehicle.x -= medium;
            break;
    }
}

void Car::speedFast(){
    speed = fast;
    
    vehicle.x += fast;
}


