World War Zombies! Kirby vs. Zombies in an endless post apocalyptic brawl!

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player

Player.h

Committer:
zjohnson31
Date:
2016-03-16
Revision:
0:4b2a1290ce3a

File content as of revision 0:4b2a1290ce3a:

#include "mbed.h"
#include "globals.h"

#ifndef PLAYER_H
#define PLAYER_H

extern uLCD_4DGL uLCD;

class Player
{
public:
    static const int WIDTH = 12;
    static const int HEIGHT = 16;
    int posX, posY,ammo;
    bool alive;
    
    Player()
    {
        posX = 3;
        posY = 127;
        ammo = 20;
        alive = true;
    }
    
    void draw()
    {
        //tan 0xddd15a
        //brown 0x895300
        //red is red
        //yellow 0xffdc08
        
        uLCD.filled_circle(posX+6, posY-10,6,0xFFC0CB); //body
        uLCD.filled_rectangle(posX, posY, posX+4, posY-4, 0x895300); //feet
        uLCD.filled_rectangle(posX+8, posY, posX+12, posY-4, 0x895300);
        uLCD.filled_rectangle(posX+2, posY-10, posX+4, posY-12, WHITE); //eyes
        uLCD.filled_rectangle(posX+8, posY-10, posX+10, posY-12, WHITE);
        uLCD.filled_circle(posX+6,posY-10,2,0xffdc08); // nose
        uLCD.filled_rectangle(posX+8, posY-4, posX+10, posY-6, 0xD3D3D3); //gun
        uLCD.filled_rectangle(posX+8, posY-7, posX+16, posY-9, 0xD3D3D3);
        
        //uLCD.filled_rectangle(posX, posY, posX+WIDTH, posY-HEIGHT, BLUE);
        //uLCD.filled_circle(posX, posY-10,5,BLUE);
        
        /*for(int i=0;i<16;i++){
            for(int j=0;j<12;j++){
                if(i==0){
                    if(j<4){
                        uLCD.filled_rectangle(posX+j, posY, posX+j,posY, 0x895300);
                    }//if
                    if(j>8){
                        uLCD.filled_rectangle(posX+j, posY, posX+j,posY, 0x895300);
                    }
                }//if
                if(i>0&&i<8){
                    uLCD.filled_rectangle(posX+j, posY+i, posX+j,posY+i, RED);
                }//if
            }//for
        }//for
        */
    }
    
    void erase()
    {
        uLCD.filled_rectangle(posX, posY, posX+16, posY-16, BLACK);
        //uLCD.filled_circle(posX, posY-10,5,BLACK);
        /*uLCD.filled_circle(posX+6, posY-10,6,BLACK); //body
        uLCD.filled_rectangle(posX, posY, posX+4, posY-4, BLACK); //feet
        uLCD.filled_rectangle(posX+8, posY, posX+12, posY-4, BLACK);
        uLCD.filled_rectangle(posX+2, posY-10, posX+4, posY-12, BLACK); //eyes
        uLCD.filled_rectangle(posX+8, posY-10, posX+10, posY-12, BLACK);
        uLCD.filled_circle(posX+6,posY-10,2,BLACK); // nose
        uLCD.filled_rectangle(posX+8, posY-4, posX+10, posY-6, BLACK); //gun
        uLCD.filled_rectangle(posX+8, posY-7, posX+16, posY-9, BLACK);*/
        }
    
    void jump(){
        
    }
    
};

#endif