- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
Exploder.cpp
资源名称:g.rar [点击查看]
上传用户:laitongbao
上传日期:2021-02-20
资源大小:8176k
文件大小:1k
源码类别:
射击游戏
开发平台:
Visual C++
- // Exploder.cpp: implementation of the Exploder class.
- //
- //////////////////////////////////////////////////////////////////////
- #include "stdafx.h"
- #include "Exploder.h"
- //////////////////////////////////////////////////////////////////////
- // Construction/Destruction
- //////////////////////////////////////////////////////////////////////
- Particle_Emit *g_explode;
- P_Resistance *g_resistance;
- Exploder::Exploder(float particle_size,int numParticles,float speed)
- {
- static bool init = false;
- if(!init)
- {
- g_explode = (Particle_Emit*)g_tree->AddObject( &Particle_Emit("Exploder",5.f,2.f,"Fire/explode1.bmp",
- 0xffffffff,0x00000000,VECTOR3()),(NodeObject*)NULL);
- g_resistance = (P_Resistance*)g_tree->AddObject(new P_Resistance("exp_resis"),(NodeObject*)NULL);
- g_resistance->AddObject(g_explode);
- init = true;
- }
- g_resistance->SetPower(0.05f);
- this->emit = g_explode;
- exploded = false;
- this->particle_size =particle_size ;
- this->numParticles = numParticles;
- this->speed = speed;
- }
- Exploder::Explode(VECTOR3 pos)//只能爆炸一次,pos设置爆炸位置
- {
- if(!exploded)
- { TransitionController::SetWorldPosition(emit,pos);
- emit->SetSize(particle_size);
- emit->Emit(VECTOR3(speed,0.f,0.f),numParticles,true,1.f);
- exploded = true;
- }
- }
- void Exploder::Reset()
- {
- exploded = false;
- }
- Exploder::~Exploder()
- {
- }