|
@@ -347,10 +347,10 @@ export class car extends Component {
|
|
|
|
|
|
x = this.node.position.x-x;
|
|
|
|
|
|
-
|
|
|
- let left = this.canvas_width*0.5*-1+90*0.5;
|
|
|
- let right = this.canvas_width*0.5-90*0.5;
|
|
|
let size = this.node.getComponent(UITransform).contentSize;
|
|
|
+ let left = this.canvas_width*0.5*-1+size.width*0.5;
|
|
|
+ let right = this.canvas_width*0.5-90*0.5;
|
|
|
+
|
|
|
if(this.carDir==DirType.LEFT){
|
|
|
|
|
|
let left_x = this.game_manager.getLeftObstacles(new Rect(this.node.position.x-size.width*0.5,this.node.position.y-size.height*0.5,size.width,size.height))
|
|
@@ -360,7 +360,7 @@ export class car extends Component {
|
|
|
}
|
|
|
|
|
|
if(x<=left){
|
|
|
- x = left+size.width*0.5
|
|
|
+ x = left
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -371,7 +371,7 @@ export class car extends Component {
|
|
|
x = right_x-5
|
|
|
}
|
|
|
if(x>=right){
|
|
|
- x = right-size.width*0.5
|
|
|
+ x = right
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -430,7 +430,7 @@ export class car extends Component {
|
|
|
if(this.speed_bei>5){
|
|
|
dis*=3
|
|
|
Tween.stopAllByTarget(this.smoke_particle.node)
|
|
|
- tween(this.smoke_particle.node).delay(2).call(()=>{
|
|
|
+ tween(this.smoke_particle.node).delay(1).call(()=>{
|
|
|
this.smoke_particle.stopSystem()
|
|
|
}).start()
|
|
|
this.smoke_particle.resetSystem()
|