-------------------------------------------------------------------------------- -- Function......... : updateSfx -- Author........... : -- Description...... : -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- function Car.updateSfx ( ) -------------------------------------------------------------------------------- local s = application.getCurrentUserScene ( ) if ( s ~= nil ) then local o1 = this.hWheelSfxBL ( ) local o2 = this.hWheelSfxBR ( ) local o3 = this.hWheelSfxFL ( ) local o4 = this.hWheelSfxFR ( ) if ( dynamics.getLinearSpeed ( this.getObject ( ) ) < 5 and not this.bGoFront ( ) --[[and not this.bGoBack ( )]] ) then sfx.pauseParticleEmitterAt ( o1, 0 ) sfx.pauseParticleEmitterAt ( o2, 0 ) sfx.pauseParticleEmitterAt ( o3, 0 ) sfx.pauseParticleEmitterAt ( o4, 0 ) else local x, y, z = object.getTranslation ( o1, object.kGlobalSpace ) local hit, dist, id = scene.getFirstHitCollider ( s, x, y + 1, z, 0, -1, 0, 1.1 ) if ( hit ~= nil ) then sfx.startParticleEmitterAt ( o1, 0 ) else sfx.pauseParticleEmitterAt ( o1, 0 ) end x, y, z = object.getTranslation ( o2, object.kGlobalSpace ) hit, dist, id = scene.getFirstHitCollider ( s, x, y + 1, z, 0, -1, 0, 1.1 ) if ( hit ~= nil ) then sfx.startParticleEmitterAt ( o2, 0 ) else sfx.pauseParticleEmitterAt ( o2, 0 ) end x, y, z = object.getTranslation ( o3, object.kGlobalSpace ) hit, dist, id = scene.getFirstHitCollider ( s, x, y + 1, z, 0, -1, 0, 1.1 ) if ( hit ~= nil ) then sfx.startParticleEmitterAt ( o3, 0 ) else sfx.pauseParticleEmitterAt ( o3, 0 ) end x, y, z = object.getTranslation ( o4, object.kGlobalSpace ) hit, dist, id = scene.getFirstHitCollider ( s, x, y + 1, z, 0, -1, 0, 1.1 ) if ( hit ~= nil ) then sfx.startParticleEmitterAt ( o4, 0 ) else sfx.pauseParticleEmitterAt ( o4, 0 ) end end end -------------------------------------------------------------------------------- end --------------------------------------------------------------------------------