|
@@ -1,4 +1,4 @@
|
|
|
-import { _decorator, BoxCollider2D, CircleCollider2D, Collider2D, Component, Contact2DType, Director, director, IPhysics2DContact, Label, math, Node, PolygonCollider2D, Rect, RigidBody, RigidBody2D, Sprite, tween, Tween, UITransform, Vec2, Vec3, View } from 'cc';
|
|
|
+import { _decorator, BoxCollider2D, CircleCollider2D, Collider2D, Component, Contact2DType, Director, director, IPhysics2DContact, Label, math, Node, ParticleSystem2D, PolygonCollider2D, Rect, RigidBody, RigidBody2D, Sprite, tween, Tween, UITransform, Vec2, Vec3, View } from 'cc';
|
|
|
import { wall } from './wall';
|
|
|
import { box } from './box';
|
|
|
import { coin } from './coin';
|
|
@@ -45,6 +45,7 @@ export class car extends Component {
|
|
|
private isStartGame:Boolean = false
|
|
|
@property(Node) spr:Node = null
|
|
|
@property(Node) hp_bar:Node = null
|
|
|
+ @property(ParticleSystem2D) smoke_particle:ParticleSystem2D = null
|
|
|
private mIsReLife:boolean = false
|
|
|
public init(m:Node,cb,cb1,g:game,isReLife:boolean = false){
|
|
|
this.mIsReLife = isReLife
|
|
@@ -321,8 +322,10 @@ export class car extends Component {
|
|
|
}
|
|
|
public startGame(){
|
|
|
this.isStartGame = true
|
|
|
+ this.smoke_particle.node.active = true
|
|
|
}
|
|
|
public stopGame(){
|
|
|
+ this.smoke_particle.node.active = false
|
|
|
this.isStartGame = false
|
|
|
}
|
|
|
check(){
|
|
@@ -426,6 +429,11 @@ export class car extends Component {
|
|
|
this.speed_bei = dis / 7
|
|
|
if(this.speed_bei>5){
|
|
|
dis*=3
|
|
|
+ Tween.stopAllByTarget(this.smoke_particle.node)
|
|
|
+ tween(this.smoke_particle.node).delay(2).call(()=>{
|
|
|
+ this.smoke_particle.stopSystem()
|
|
|
+ }).start()
|
|
|
+ this.smoke_particle.resetSystem()
|
|
|
if(userDataManager.user_car_list.default_car_id==1){
|
|
|
audioManager.Instance().playSound(config.AUDIO.zi_xing_che_sha_che)
|
|
|
}else{
|