⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chloride.h

📁 c++游戏源码 素材文件 需要openAl32.dll可以在网上下载
💻 H
字号:
#ifndef CHLORIDE_H
#define CHLORIDE_H

#include "WorldObject.h"

class invasion;

class chloride : public world_object
{
public:
    // The Captain will go from one state to another
    //  depending on user input and other events.
    enum state
    {
        STATE_STAND,
        STATE_WALK_LEFT,
        STATE_WALK_RIGHT
    };

    // These are the indices into 'anim' member.
    enum anim_index
    {
        ANIM_WALK_LEFT=0,
        ANIM_WALK_RIGHT=1
    };
    
    chloride();
    
    std::string Type();
    
    bool LoadResources();

    bool Update(
        invasion *theGame);
    
    bool Render(
        invasion *theGame);

    void GetKeyboardInput();

    void Movement(
        vectorf new_velocity);

    int BitmapHeight();
    int BitmapWidth();

    void Hit( world_object &stationary);

private:
    //indexed into by chloride::anim_index enum.
    animated_sprite theCaptain;
    
    sound leftWalkSound;
    sound rightWalkSound;
    sound bonkSound; //walking into the door
    sound pickupSound;
    vectorf velocity;
    chloride::state currState;
    chloride::state lastWalkState;
    int lastStepIndex;
    bool haveKey; //need key to open door!
};


inline std::string
chloride::Type()
{
    return "chloride";
}


inline int 
chloride::BitmapHeight()
{
    return (theCaptain.BitmapHeight());
}


inline int 
chloride::BitmapWidth()
{
    return (theCaptain.BitmapWidth());
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -