Steven Mahasin / Mbed 2 deprecated DreamDungeon

Dependencies:   mbed MotionSensor

Entity/Snake/Snake.h

Committer:
el17sm
Date:
2019-04-24
Revision:
16:ddb203a74dfc
Child:
17:99e533f7f2fb
Child:
19:bfe410c82b45

File content as of revision 16:ddb203a74dfc:

#ifndef SNAKE_H
#define SNAKE_H
#include "Entity.h"

class Snake : public Entity {
    
    public:
    // Constructor
    Snake(float, float);
    
    // Functions
    virtual void move(float, float);
    virtual int * get_frame();
    
};

const float velocity_pattern[6] = {0, 0.3, 0.5, 0.7, 0.5, -0.2};

const int sprite_snake[4][6][12][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,}
        },
        {
            {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,0,0,0,0,},
            {0,0,1,0,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,1,1,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,0,0,0,},
            {0,0,1,0,0,0,},
            {0,0,1,1,0,0,}
        },
        {
            {0,1,0,0,0,0,},
            {0,0,0,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,1,1,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,0,1,0,},
            {0,0,1,0,1,0,},
            {0,1,0,0,0,1,}
        },
        {
            {0,0,0,0,1,0,},
            {0,0,0,0,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,1,1,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,0,0,0,},
            {0,0,1,0,0,0,},
            {0,0,1,1,0,0,}
        },
        {
            {0,0,0,0,0,0,},
            {0,0,0,0,0,1,},
            {0,0,1,1,0,0,},
            {0,0,1,1,1,1,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,0,1,0,},
            {0,0,1,0,1,0,},
            {0,1,0,0,0,1,}
        },
        {
            {0,0,0,0,1,0,},
            {0,0,0,0,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,1,1,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,0,0,0,},
            {0,0,1,0,0,0,},
            {0,0,1,1,0,0,}
        },
        {
            {0,0,0,0,0,0,},
            {0,0,0,0,0,1,},
            {0,0,1,1,0,0,},
            {0,0,1,1,1,1,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,0,1,0,},
            {0,0,1,0,1,0,},
            {0,1,0,0,0,1,}
        }
    },
    {   // Down
        {
            {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,}
        },
        {
            {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,}
        }
    },
    {   // Left
        {
            {0,0,0,0,0,0,},
            {0,0,0,1,0,0,},
            {0,0,1,1,0,0,},
            {1,1,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,0,1,0,0,},
            {0,0,0,1,0,0,},
            {0,0,1,1,0,0,}
        },
        {
            {0,0,0,0,1,0,},
            {0,0,1,0,0,0,},
            {0,0,1,1,0,0,},
            {1,1,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,1,0,1,0,0,},
            {0,1,0,1,0,0,},
            {1,0,0,0,1,0,}
        },
        {
            {0,1,0,0,0,0,},
            {0,0,0,0,0,0,},
            {0,0,1,1,0,0,},
            {1,1,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,0,1,0,0,},
            {0,0,0,1,0,0,},
            {0,0,1,1,0,0,}
        },
        {
            {0,0,0,0,0,0,},
            {1,0,0,0,0,0,},
            {0,0,1,1,0,0,},
            {1,1,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,1,0,1,0,0,},
            {0,1,0,1,0,0,},
            {1,0,0,0,1,0,}
        },
        {
            {0,1,0,0,0,0,},
            {0,0,0,0,0,0,},
            {0,0,1,1,0,0,},
            {1,1,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,0,1,0,0,},
            {0,0,0,1,0,0,},
            {0,0,1,1,0,0,}
        },
        {
            {0,0,0,0,0,0,},
            {1,0,0,0,0,0,},
            {0,0,1,1,0,0,},
            {1,1,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,0,1,1,0,0,},
            {0,1,0,1,0,0,},
            {0,1,0,1,0,0,},
            {1,0,0,0,1,0,}
        }
    }
};

#endif