LaserGun.cpp
资源名称:g.rar [点击查看]
上传用户:laitongbao
上传日期:2021-02-20
资源大小:8176k
文件大小:1k
源码类别:
射击游戏
开发平台:
Visual C++
- // LaserGun.cpp: implementation of the LaserGun class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "LaserGun.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- LaserGun::LaserGun(NodeObject* owner,float xoffset)
- {
- this->emit = (Particle_Emit*)g_tree->AddObject( &Particle_Emit("LaserGun",4.f,20.f,"bullet\Bullet2.bmp",
- 0xffffffff,0xffffffff,VECTOR3(xoffset,0.f,0.f),0.02f),owner);
- this->damage = 10;
- }
- void LaserGun::Fire(VECTOR3 v0)
- {
- emit->Emit(v0.Normalize()*15.f);
- }
- LaserGun::~LaserGun()
- {
- if(emit)
- g_tree->DeleteObject(emit);
- }