xx 1 年之前
父節點
當前提交
56920b26c2
共有 2 個文件被更改,包括 9 次插入9 次删除
  1. 2 2
      assets/script/game/car.ts
  2. 7 7
      assets/script/game/game.ts

+ 2 - 2
assets/script/game/car.ts

@@ -97,7 +97,7 @@ export class car extends Component {
         this.move_speed_y = tools.game_config.car_origin_speed
         this.hp = tools.game_config.car_init_num
         this.hp_bar.getComponent(hp_bar).updateHp(this.hp)
-        // this.hp = 100000
+        this.hp = 100000
         if(isReLife){
 
         }else{
@@ -219,7 +219,7 @@ export class car extends Component {
         //     // this.node.getComponent(RigidBody2D).linearVelocity   = new Vec2(this.move_speed_x.valueOf(),30)
         // }).start()
         Tween.stopAllByTarget(this.lab_hp)
-        tween(this.lab_hp).delay(0.02).call(()=>{ this.isStopY = false}).start()
+        tween(this.lab_hp).delay(0.05).call(()=>{ this.isStopY = false}).start()
         if(this.hp<0){
             if(this.isStartGame){
                 Tween.stopAllByTarget(this.node)

+ 7 - 7
assets/script/game/game.ts

@@ -253,16 +253,16 @@ export class game extends Component {
                     isColliderBox = true
                     // let car_top_rect = new Rect(car_rect.xMin,car_rect.yMax-10,car_rect.width,20)
                     let box_bottom_rect = new Rect(rect.xMin,rect.yMin,rect.width,20)
-                    if(origin_car_pos_y<box_bottom_rect.yMin){
+                    if(origin_car_pos_y<=box_bottom_rect.yMin){
                         // if((car_top_rect.yMin-origin_car_pos_y)>20){
 
                         // }
-                        // if(car_top_rect.intersects(box_bottom_rect)){
-                            dir = config.collider_dir.top
-                        // }
+                        dir = config.collider_dir.top
+                      
                     }
-            
-
+                    // if(car_top_rect.intersects(box_bottom_rect)){
+                    //     dir = config.collider_dir.top
+                    // }
                     list.push({"node":box_node,"rect":rect,"type":0,"collider_dir":dir,"moveOffset":0})
                 }
             }
@@ -290,7 +290,7 @@ export class game extends Component {
                     //         }
                   
                     // }
-                    if(origin_car_pos_y<box_bottom_rect.yMin){
+                    if(origin_car_pos_y<=box_bottom_rect.yMin){
                             dir = config.collider_dir.top
                             if(box_bottom_rect.xMax>(car_top_rect.xMin+car_top_rect.width*0.5)){ //右边
                                 offset = (car_top_rect.width*0.5)