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

📄 cbullet.h

📁 游戏开发人工智能技术 很好的一本书 讲解游戏中的人工智能技术 希望大家喜欢 ps 英文原版
💻 H
字号:
#ifndef CBULLET_H
#define CBULLET_H

//-----------------------------------------------------------------------
//
//  Name: CBullet.h
//
//  Author: Mat Buckland 2002
//
//	Desc: Bullet class
//
//-----------------------------------------------------------------------

#include <windows.h>
#include <vector>

#include "defines.h"
#include "utils.h"
#include "C2DMatrix.h"
#include "CParams.h"
#include "SVector2D.h"

using namespace std;



class CBullet
{
private:

    //its position in the world
    SVector2D      m_vPos;
    
    //its scale
    double         m_dScale;

    //is it active
    bool           m_bActive;

    //vertex buffer for the bullets's local coordinates
    vector<SPoint> m_vecBulletVB;

    //vertex buffer to hold the bullets's transformed vertices
    vector<SPoint> m_vecBulletVBTrans;

    //its bounding box
    RECT           m_BulletBBox;


    void WorldTransform();

public:

    CBullet();

    void Render(HDC &surface, HPEN &GreenPen);

    void Update();

    //given the X position of the gun turret this function
    //activates the bullet.
    void SwitchOn(int posX);

    //---------------------accesssor functions
    bool      Active()const{return m_bActive;}
    void      SwitchOff(){m_bActive = false;}
    SVector2D Pos()const{return m_vPos;}
    RECT      BBox()const{return m_BulletBBox;}

};


#endif

⌨️ 快捷键说明

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