ELEC2645 (2018/19) / Mbed 2 deprecated el17zl

Dependencies:   mbed

Fork of el17zl by Zhenwen Liao

PushingEngine/PushingEngine.h

Committer:
franklzw
Date:
2019-04-22
Revision:
10:726c1489894e
Parent:
9:1fa7f087051e
Child:
11:f5d0ea7e4b74

File content as of revision 10:726c1489894e:

#ifndef PUSHINGENGINE_H
#define PUSHINGENGINE_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Ppl.h"
#include "Box.h"
#include "Cross.h"
#include "Menu.h"





class PushingEngine
{

public:
    PushingEngine();
    ~PushingEngine();

    void init(int box1_x,int box1_y,int box2_x,int box2_y,int ppl_x,int ppl_y,
              int cross1_x,int cross1_y,int cross2_x,int cross2_y,int menu_x,int menu_y);
    void read_input(Gamepad &pad);
    void update(Gamepad &pad,int barrier_x,int barrier_y);
    void draw(N5110 &lcd,int barrier_x,int barrier_y);
    int set_score();
    Vector2D print_menu(N5110 &lcd,Gamepad &pad);
    

private:

    void check_ppl_box1_touching(Gamepad &pad);
    void check_ppl_box2_touching(Gamepad &pad);
    void hold_ppl_box1_wall(Gamepad &pad);
    void hold_ppl_box2_wall(Gamepad &pad);
    bool ppl_cover_box(Gamepad &pad);
    void box_cover_cross1_score(Gamepad &pad);
    void box_cover_cross2_score(Gamepad &pad);

    Box _b1;
    Box _b2;

    // positions of the Boxes
    int _b1x;
    int _b2x;
    int _b1y;
    int _b2y;

    Ppl _ppl;

    // poitions of the ppl
    int _pplx;
    int _pply;
    
    Cross _c1;
    Cross _c2;
    
    // position of the crosses
    int _c1x;
    int _c2x;
    int _c1y;
    int _c2y;
    
    Menu _menu;
    
        //reading of bottom
    int _bb;
    int _bx;
    int _by;
    int _ba;
    int _bjoy;
    int _bj;
    

    //parameter for touching 
    int _s; //ppl with b1
    int _r; //ppl with b2
    int _temp;
    int _score;

};

#endif