# CSOLKZ排行榜 **Repository Path**: csolcreator/kz-scoreboard ## Basic Information - **Project Name**: CSOLKZ排行榜 - **Description**: No description available - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-02-01 - **Last Updated**: 2021-02-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CSOL缔造者KZ专用排行榜 ## 特性 * 自带计时器功能,可动态显示跳跃时长 * 高内聚的代码,更易于使用 * 支持多起点多终点计时装置 ## 使用 1. 把 **ScoreBoard.lua** 与 **LocalTimePainter.lua** 复制到自己的目录下,然后在 **project.json** 中引用,示例如下 ```json { "game": ["ScoreBoard.lua", "game.lua"], "ui": ["LocalTimePainter.lua", "ui.lua"] } ``` 2. 在 **ui.lua** 创建 **LocalTimePainter** 的对象 ```lua LocalTimePainter:getInstance() ``` 3. 在 **game.lua** 中创建 **ScoreBoard** 的对象, 记得在创建(调用 **new** )的时候传入游戏装置对象, 可以传入一个,也可以传入多个对象 ```lua startButton1 = Game.EntityBlock:Create({x=-6, y=-1, z = 6}) startButton2 = Game.EntityBlock:Create({x=-6, y=0, z = 6}) startButton3 = Game.EntityBlock:Create({x=-6, y=1, z = 6}) startButton4 = Game.EntityBlock:Create({x=-6, y=2, z = 6}) stopButton1 = Game.EntityBlock:Create({x=4, y=2, z = 5}) stopButton2 = Game.EntityBlock:Create({x=4, y=1, z = 5}) stopButton3 = Game.EntityBlock:Create({x=4, y=-2, z = 5}) starters = {} stopers = {} starters[0] = startButton1 starters[1] = startButton2 starters[2] = startButton3 starters[3] = startButton4 stopers[0] = stopButton1 stopers[1] = stopButton2 stopers[2] = stopButton3 ScoreBoard:getInstance(starters, stopers) ``` 这样就实现了玩家分数的保存与显示计时器的功能 ## 计划 * 实现分数排行榜 * 加入模块化特性 * 开发Kz插件的剩余部分