pull/2/head
jaysunxiao 2022-01-02 19:22:59 +08:00
parent 642f48fec6
commit 9d60fad901
1 changed files with 26 additions and 1 deletions

View File

@ -1,13 +1,38 @@
# 1. 场景树
![Image text](image/scene-tree.png) ![Image text](image/scene-tree.png)
![Image text](image/场景循环.png) ![Image text](image/场景循环.png)
# 2. 帧率
- 帧率 Framerate ,指画面每秒更新多少次 (FPS, Frames Per Second)
```
比如,
FPS = 50 , 即每 20ms 秒更新一次
FPS = 60, 约 16.7ms 秒更新一次
通过代码可以设置,要求 godot 引擎尽量以此帧率运行 ,但实际帧率还是会有偏差
Engine.target_fps = 120
```
![Image text](image/场景帧.png) ![Image text](image/场景帧.png)
- delta time上一帧的间隔
```
匀速移动的优化:
var step = 0.8f * deltaTime;
其中,
0.8f 表示每秒位移 0.8 单位
```
![Image text](image/delta.png) ![Image text](image/delta.png)
![Image text](image/delta-1.png) ![Image text](image/delta-1.png)
![Image text](image/godot_process.jpg) ![Image text](image/godot_process.jpg)
![Image text](image/godot_node.jpg) ![Image text](image/godot_node.jpg)
![Image text](image/godot_lifecycle.jpg) ![Image text](image/godot_lifecycle.jpg)
![Image text](image/process.png) ![Image text](image/process.png)
![Image text](image/process-1.png) ![Image text](image/process-1.png)
![Image text](image/physics.png) ![Image text](image/physics.png)