Snake vs Block Game to be run upon K64F.

Dependencies:   mbed

GameObjects/Blocks/Blocks.h

Committer:
AhmedPlaymaker
Date:
2019-05-06
Revision:
81:4c1641e10dcd
Parent:
54:20abd16c7d74
Child:
83:329da564799a

File content as of revision 81:4c1641e10dcd:

#ifndef BLOCKS_H
#define BLOCKS_H

#include "mbed.h"
#include "N5110.h"
#include "Gamepad.h"


class Blocks
{
    public:
    Blocks();
    ~Blocks();
    /** Initialise Blocks
    *
    *   This function initialises the Blocks library.
    */
    void init();
    
    /** Draw
    *
    *   This function draws the Blocks onto the screen.
    */
    void draw(N5110 &lcd, int length);
    
    /** Draw Frame
    *
    *   This function draws the Blocks' sides onto the screen.
    */
    void DrawFrame(N5110 &lcd);
    
    /** Choose Blocks
    *
    *   This function chooses the correct block using a case structure and draws them onto the screen.
    */
    void ChooseBlocks(N5110 &lcd);
    
    /** Update
    *
    *   This function updates the position of the Blocks as they move down the screen.
    */
    void update(int blocknum, int blockgap, int srn, int send_block_number);
    
    /** Get Position
    *
    *   This function obtains the coordinates of the top-left pixel in the Blocks sprites.
    */
    Vector2D get_pos();
    
    /** Get Number
    *
    *   This function obtains the number inside the Blocks sprite at a specefic location.
    */
    int * get_number();
    
    /** Set Position
    *
    *   This function is used to change the position of the sprite to specific coordinates when called.
    */
    void set_pos(Vector2D p);
    double round; //used to save the rounded number to set the value inside the block.
    int caseselect[5];
    int send;
    Vector2D velocity;
    
    

    private:
    int _length;
    int reset;
    int _bx;  //block x
    int _by;  //block y

};
#endif