ELEC2645 (2018/19) / Mbed 2 deprecated el17zl

Dependencies:   mbed

Fork of el17zl by Zhenwen Liao

PushingEngine/PushingEngine.h

Committer:
franklzw
Date:
2019-04-11
Revision:
7:6f8aeadc4370
Parent:
6:6b083e22cb53
Child:
8:83891ea9a5d9

File content as of revision 7:6f8aeadc4370:

#ifndef PUSHINGENGINE_H
#define PUSHINGENGINE_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"
#include "Ppl.h"
#include "Box.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);
    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);
    

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);
    

    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;
    
        //reading of bottom
    int _bb;
    int _bx;
    int _by;
    int _ba;
    int _bjoy;

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

};

#endif