Poodletooth-iLand/toontown/effects/Drift.py
Master Jumblespeed d882959bfa switch to remote
2015-05-18 22:11:33 -04:00

30 lines
1.1 KiB
Python
Executable file

from pandac.PandaModules import *
from direct.particles import ParticleEffect
from direct.directnotify import DirectNotifyGlobal
from toontown.battle import BattleParticles
class Drift(NodePath):
def __init__(self, parent, renderParent):
NodePath.__init__(self)
notify = DirectNotifyGlobal.directNotify.newCategory('DriftParticles')
self.renderParent = renderParent.attachNewNode('driftRenderParent')
self.renderParent.setBin('fixed', 0)
self.renderParent.setDepthWrite(0)
self.assign(parent.attachNewNode('drift'))
self.effect = BattleParticles.loadParticleFile('drift.ptf')
ren = self.effect.getParticlesNamed('particles-1').getRenderer()
ren.setTextureFromNode('phase_6/models/karting/driftSmoke', '**/*')
def start(self):
self.effect.start(self, self.renderParent)
def stop(self):
self.effect.disable()
def destroy(self):
self.stop()
self.effect.cleanup()
self.renderParent.removeNode()
del self.effect
del self.renderParent