Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MotionSensor
Entity/Mobs/Headless/Headless.h
- Committer:
- el17sm
- Date:
- 2019-05-06
- Revision:
- 34:1d5b4da3935e
- Parent:
- 33:4f3948dcd2f7
- Child:
- 56:ef9521b7ed78
File content as of revision 34:1d5b4da3935e:
#ifndef HEADLESS_H
#define HEADLESS_H
#include "Entity.h"
class Headless : public Entity
{
public:
// Constructor
Headless(float, float);
// Functions
virtual void move(float player_x, float player_y, char * map, bool * doorways);
virtual void draw(N5110 &lcd);
virtual void take_damage(int damage);
private:
// Private Functions
char * get_frame();
};
const char sprite_headless[4][4][9][6] = { // Player [Face][SpriteAnimationFrame][Size_Y][Size_X]
{
// Up
{
{0,0,0,0,0,0,},
{1,0,0,0,0,0,},
{0,1,1,1,1,0,},
{1,0,1,1,0,1,},
{0,0,1,1,0,0,},
{0,0,1,1,0,0,},
{0,1,0,0,1,0,},
{0,1,0,0,1,0,},
{0,1,0,0,1,0,}
},
{
{0,0,0,0,0,0,},
{0,0,0,1,0,0,},
{0,1,1,1,1,0,},
{1,0,1,1,0,1,},
{0,0,1,1,0,0,},
{0,0,1,1,0,0,},
{0,1,0,0,1,0,},
{0,1,0,0,1,0,},
{0,0,0,0,1,0,}
},
{
{0,0,0,0,1,0,},
{0,0,1,0,0,0,},
{0,1,1,1,1,0,},
{1,0,1,1,0,1,},
{0,0,1,1,0,0,},
{0,0,1,1,0,0,},
{0,1,0,0,1,0,},
{0,1,0,0,1,0,},
{0,1,0,0,1,0,}
},
{
{0,1,0,0,0,0,},
{0,0,0,0,0,0,},
{0,1,1,1,1,0,},
{1,0,1,1,0,1,},
{0,0,1,1,0,0,},
{0,0,1,1,0,0,},
{0,1,0,0,1,0,},
{0,1,0,0,1,0,},
{0,1,0,0,0,0,}
}
},
{
// Right
{
{0,0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