# 2020q3 render contributed by < `iamchiawei` > > [render 作業內容](https://hackmd.io/@sysprog/2020-render) > [GitHub](https://github.com/iamchiawei/raycaster) ###### tags: `sysprog2020` ## 程式原理 ### `game` 用於記錄玩家的位置,包含 X, Y 軸座標及旋轉角度,其中的 `move` 函式可調用於玩家的移動,並將玩家位置限制於 (1.01, 1.01) 及 (29.99, 29.99) 的 2D 平面當中,且旋轉角度為 $0$ ~ $2\pi$ 之間。 再看到 `Game::Move(int m, int r, float seconds)` 的參數,其中的 `m` 和 `r` 分別為前後移動方向及旋轉方向,以 -1, 0, 1 表示,並利用 `SDL_GetPerformanceCounter` 及 `SDL_GetPerformanceFrequency` 兩函式取得較精確的指令時長 `seconds`,作為實際前進 / 後退及左轉 / 右轉幅度,可見定義於`main.cpp` 中的 `ProcessEvent`。