Citrus vor 3 Monaten
Ursprung
Commit
22474b2d58

+ 6 - 3
assets/Script/AutoBuild.ts

@@ -22,10 +22,15 @@ export class AutoBuild extends Component {
             if (ok) {
                 console.log('初始化成功');
 
+                EventManager.instance.et.emit(EventManager.EventType.initOver);
+
                 let floorType = [FloorType.diban, FloorType.dicin]
+                this.ISbuild && this.BuildOnce(FloorType.diban);
                 this.schedule(() => {
                     this.ISbuild && this.BuildOnce(floorType[this.selectByProbability()]);
                 }, this.Time)
+
+
             }
         });
     }
@@ -43,9 +48,7 @@ export class AutoBuild extends Component {
             console.error('没有找到节点')
             return
         }
-
-        // // 加一分
-        // EventManager.instance.et.emit(EventManager.EventType.Add_Score);
+        return Node
     }
 
     ClerarNode() {

+ 52 - 25
assets/Script/DifficultyManager.ts

@@ -1,4 +1,6 @@
 import { _decorator, Component, Label, macro, Node, NodeEventType } from 'cc';
+import { EventManager } from './EventManager';
+import { DEBUG } from 'cc/env';
 const { ccclass, property } = _decorator;
 
 @ccclass('DifficultyManager')
@@ -9,38 +11,63 @@ export class DifficultyManager extends Component {
 
 
     static UpSpeed: number = 10;
-    static G: number = 20;
+    static G: number = 0;
 
-    protected start(): void {
 
+    static Left_Right_Speed: number = 20;
+    
+
+    protected onLoad(): void {
+        EventManager.instance.et.on(EventManager.EventType.initOver, this.initOver, this);
+    }
+
+    initOver() {
+        this.up()
         this.schedule(() => {
-            let num = parseInt(this.getComponent(Label).string)
-            if (num < 50) {
-                if (this.Difficulty != 0) {
-                    this.Difficulty = 0
-                    /////////////////////////
-                    DifficultyManager.UpSpeed = 10;
-                    DifficultyManager.G = 20;
-                }
-            } else if (num < 100) {
-                if (this.Difficulty != 1) {
-                    this.Difficulty = 1
-                    /////////////////////////
-                    DifficultyManager.UpSpeed = 15;
-                    DifficultyManager.G = 30;
-                }
-            } else if (num < 150) {
-                if (this.Difficulty != 2) {
-                    this.Difficulty = 2
-                    /////////////////////////
-                    DifficultyManager.UpSpeed = 20;
-                    DifficultyManager.G = 40;
-                }
-            }
+            this.up()
         }, 1, macro.REPEAT_FOREVER, 0)
     }
 
 
+    up() {
+        let num = parseInt(this.getComponent(Label).string)
+        if (num < 2000) {
+            if (this.Difficulty != 0) {
+                this.Difficulty = 0
+                /////////////////////////
+                DifficultyManager.UpSpeed = 10;
+                DifficultyManager.G = 20;
+                DifficultyManager.Left_Right_Speed = 20;
+ 
+            }
+        } else if (num < 4000) {
+            if (this.Difficulty != 1) {
+                this.Difficulty = 1
+                /////////////////////////
+                DifficultyManager.UpSpeed = 15;
+                DifficultyManager.G = 30;
+                DifficultyManager.Left_Right_Speed = 30;
+            }
+        } else if (num < 6000) {
+            if (this.Difficulty != 2) {
+                this.Difficulty = 2
+                /////////////////////////
+                DifficultyManager.UpSpeed = 20;
+                DifficultyManager.G = 40;
+                DifficultyManager.Left_Right_Speed = 40;
+            }
+        }
+    }
+
+    protected start(): void {
+        return
+
+        // EventManager.instance.et.emit(EventManager.EventType.initOver);
+
+
+    }
+
+
 
 }
 

+ 2 - 0
assets/Script/EventManager.ts

@@ -18,6 +18,8 @@ export class EventManager {
 
     Die_Role: 'Die_Role',
 
+    initOver: 'initOver',
+
 
 
     OpenUIPnael: 'OpenUIPnael',

+ 4 - 2
assets/Script/MyFrame/AD/AdManager.ts

@@ -12,9 +12,11 @@ export class AdManager {
                 AdManager._instance = new AdManager('kuaihsou');
             } else if (sys.platform == sys.Platform.WECHAT_GAME) {
                 AdManager._instance = new AdManager('wechat');
-            } else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
+            }
+            else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
                 AdManager._instance = new AdManager('douyin');
-            } else {
+            }
+            else {
                 AdManager._instance = new AdManager('wechat');
             }
         }

+ 11 - 5
assets/Script/MyFrame/HTTPS.ts

@@ -9,7 +9,7 @@ export default class HTTPS {
         }
         return this._instance;
     }
-    token = 'ffb5293a-37ce-4123-a074-df4b1450a2b6';
+    token = null;
 
     //得到现在的时间
     private GetNowTime(): string {
@@ -109,7 +109,13 @@ export default class HTTPS {
     }
 }
 
-export var Url = "https://meowtea2.maox.com.cn";
+export var Url = "https://mall.sdsfc.com.cn";
+//  "https://www.algame.online";
+
+// https://www.algame.online
+
+
+
 
 
 export var NetGet = {
@@ -124,10 +130,10 @@ export var NetGet = {
 export var NetPost = {
     /**登录 */
     Login: "/api/user/third",
-    
-    UpdateScore: "/api/user/UpdateScore",
+
+    UpdateScore: "/api/user/update_score",
 
     ranking_list: "/api/user/ranking_list",
- 
+
 
 }

+ 4 - 2
assets/Script/MyFrame/SDK/SDKManager.ts

@@ -12,9 +12,11 @@ export class SDKManager {
                 SDKManager._instance = new SDKManager('kuaihsou');
             } else if (sys.platform == sys.Platform.WECHAT_GAME) {
                 SDKManager._instance = new SDKManager('wechat');
-            } else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
+            }
+            else if (sys.platform == sys.Platform.BYTEDANCE_MINI_GAME) {
                 SDKManager._instance = new SDKManager('douyin');
-            } else {
+            }
+            else {
                 SDKManager._instance = new SDKManager('wechat');
             }
         }

+ 2 - 0
assets/Script/MyFrame/SDK/WeChatSDKManager.ts

@@ -95,6 +95,8 @@ export class WeChatSDKManager {
             }).then((resp) => {
                 console.error('999999999999');
                 console.error(resp);
+
+                HTTPS.Instance.token=resp.data.userinfo.token
             })
     }
 

+ 9 - 0
assets/Script/Prop/Base/PropBase.ts

@@ -87,9 +87,18 @@ export class PropBase extends Component {
         this.ParentSize = size
 
         let width = (size.width - (this.node.getComponent(UITransform).contentSize.width * 1.33)) / 2;
+
+        let roleNode = ParentNode[0].getChildByName('Role').getComponent(UITransform).contentSize.width
+        width -= (roleNode * 1.33) + 10
+
+        // let width = (size.width - ((this.node.getComponent(UITransform).contentSize.width * 1.33) + (10 + (roleNode * 2)))) / 2;//60是人物的宽度
+
+
         let height = -size.height / 2;
         height -= 50;
         const x = this.getRandomNumber(-width, width);
+
+
         const y = height
 
         this.node.setPosition(x, y, 0);

+ 3 - 2
assets/Script/Prop/ObjectPoolManager.ts

@@ -25,8 +25,8 @@ export class ObjectPoolManager extends Component {
         'Prefabs/dici',
     ]
     private initPoolNodeCount = [
-        3,//prefabPath 每个分别创建多少个
-        1,//prefabPath 每个分别创建多少个
+        10,//prefabPath 每个分别创建多少个
+        4,//prefabPath 每个分别创建多少个
     ]
 
     public async initializePools(): Promise<boolean> {
@@ -66,6 +66,7 @@ export class ObjectPoolManager extends Component {
     getNodeFromPool(prefabName: FloorType, ParentNode: Node): Node {
         let prefab = this.prefabs.filter(prefab => prefab.name == prefabName);
         if (!prefab) {
+            console.error('没有这个');
             debugger
         }
         if (this.pools[prefabName].size() == 0) {

+ 3 - 5
assets/Script/RoleControl.ts

@@ -18,7 +18,7 @@ export class RoleControl extends Component {
     RightBtn: Node = null;
 
 
-    private Left_Right_Speed: number = 20;
+    // private Left_Right_Speed: number = 20;
     // G: number = 20;
 
 
@@ -29,7 +29,6 @@ export class RoleControl extends Component {
 
 
 
-
         EventManager.instance.et.on(EventManager.EventType.Reset_Role, this.Reset_Role, this);
         EventManager.instance.et.on(EventManager.EventType.Die_Role, this.Die_Role, this);
 
@@ -37,7 +36,6 @@ export class RoleControl extends Component {
 
     Die_Role() {
         this.scheduleOnce(() => {
-
             this.Role.active = false
         }, 0)
     }
@@ -121,10 +119,10 @@ export class RoleControl extends Component {
                 this.Role.getComponent(RigidBody2D).linearVelocity = new Vec2(0, -DifficultyManager.G); // 速度值可以根据需要调整
                 break;
             case -1:
-                this.Role.getComponent(RigidBody2D).linearVelocity = new Vec2(-this.Left_Right_Speed, -DifficultyManager.G); // 速度值可以根据需要调整
+                this.Role.getComponent(RigidBody2D).linearVelocity = new Vec2(-DifficultyManager.Left_Right_Speed, -DifficultyManager.G); // 速度值可以根据需要调整
                 break;
             case 1:
-                this.Role.getComponent(RigidBody2D).linearVelocity = new Vec2(this.Left_Right_Speed, -DifficultyManager.G); // 速度值可以根据需要调整
+                this.Role.getComponent(RigidBody2D).linearVelocity = new Vec2(DifficultyManager.Left_Right_Speed, -DifficultyManager.G); // 速度值可以根据需要调整
                 break;
             default:
                 break;

+ 4 - 2
assets/Script/Top.ts

@@ -40,12 +40,14 @@ export class Top extends Component {
         EventManager.instance.et.emit(EventManager.EventType.Reset_Score);
     }
 
-    Add_haert() {
-
+    Add_haert(num: number) {
         if (parseInt(this.haertLabel.string) < 3) {
             this.haertLabel.string = (parseInt(this.haertLabel.string) + 1) + "";
         }
 
+        if (num) {
+            this.haertLabel.string = num + "";
+        }
     }
 
     Add_Score_Bool = true

+ 1 - 1
assets/Script/UI/UI.ts

@@ -84,7 +84,7 @@ export class UI extends Component {
 
 
     FuHuo() {
-        EventManager.instance.et.emit(EventManager.EventType.Add_haert);
+        EventManager.instance.et.emit(EventManager.EventType.Add_haert, 3);
         EventManager.instance.et.emit(EventManager.EventType.Set_Add_Score_BOOL, true);
         EventManager.instance.et.emit(EventManager.EventType.Reset_Role);
         this.close()

+ 5 - 5
assets/resources/Game.scene

@@ -585,7 +585,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 51.859375,
+      "width": 19.796875,
       "height": 52.4
     },
     "_anchorPoint": {
@@ -615,7 +615,7 @@
       "b": 0,
       "a": 255
     },
-    "_string": "111",
+    "_string": "3",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
     "_actualFontSize": 32,
@@ -814,7 +814,7 @@
     "__prefab": null,
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 242.29296875,
+      "width": 24.24609375,
       "height": 52.4
     },
     "_anchorPoint": {
@@ -844,7 +844,7 @@
       "b": 0,
       "a": 255
     },
-    "_string": "10000000111",
+    "_string": "0",
     "_horizontalAlign": 1,
     "_verticalAlign": 1,
     "_actualFontSize": 40,
@@ -1898,7 +1898,7 @@
     "_lpos": {
       "__type__": "cc.Vec3",
       "x": 0,
-      "y": 0,
+      "y": 364.131,
       "z": 0
     },
     "_lrot": {

+ 4 - 2
settings/v2/packages/engine.json

@@ -116,10 +116,10 @@
         "_value": false
       },
       "marionette": {
-        "_value": false
+        "_value": true
       },
       "procedural-animation": {
-        "_value": false
+        "_value": true
       },
       "custom-pipeline": {
         "_value": false
@@ -139,8 +139,10 @@
       "gfx-webgl",
       "gfx-webgl2",
       "intersection-2d",
+      "marionette",
       "meshopt",
       "physics-2d-box2d",
+      "procedural-animation",
       "profiler",
       "tween",
       "ui"