Arturs Kozlovskis / Mbed 2 deprecated ELEC2645_Project_el18ak

Dependencies:   mbed

My_game_clases/Objects.h

Committer:
thestudent
Date:
2020-04-29
Revision:
14:739115711bf8
Parent:
10:f5b920a6a71a
Child:
16:e2aaef863d7c

File content as of revision 14:739115711bf8:

#ifndef OBJECTS_H
#define OBJECTS_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include <vector>



class Objects
{
public:

    Objects();//initialises variables
    void draw_base(N5110 &lcd);// draws the base
    void cannon_position(Gamepad &pad);// changes the cannon position depending of the joystick
    void draw_cannon(N5110 &lcd);//draws the cannon
    void draw_shots(N5110 &lcd,Gamepad &pad);// makes the shoting on the screen
    //ball_x: balls x position; ball_y: balls y position; delta_r: added to the inital radiuss to make the ball bigger
    void draw_ball(N5110 &lcd, int ball_x, int ball_y, int delta_r);//draws the ball
    int get_size();//gets the size of _shot_y_pos vector
    int get_x_value(int i);//gets _shot_x_pos(i)
    int get_y_value(int i);//gets _shot_y_pos(i)
    void erase_shot(int i);//erases _shot_x_pos(i) and _shot_y_pos(i)
    int get_x_cannon();

    vector <int> _shot_y_pos; //holds the shots y positions
    vector <int> _shot_x_pos;//holds the shots x positons


private:
    int _cannon_pos; //stores the positon of the cannon
    int _initial_shot_pos;//stroes the initial vertical position of the shot
    int _shot_incrementer;//increments the shot on the lcd by 2
    int _radiuss;// the initiak radiuss of the ball

};
#endif