Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Exploder.cpp
Package: g.rar [view]
Upload User: laitongbao
Upload Date: 2021-02-20
Package Size: 8176k
Code Size: 1k
Category:
Shot Game
Development Platform:
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()
- {
- }