Updated RayEngine.lua

Added a few comments
This commit is contained in:
MrPixel92
2023-04-27 22:51:39 +03:00
committed by GitHub
parent 0d228497e4
commit ac286505cc

View File

@@ -8,6 +8,8 @@ local GUI = require("GUI")
local event = require("Event")
local filesystem = require("Filesystem")
---------------------------------------------------- Управление -----------------------------------------------------------------
local inputX = 0
local inputY = 0
local inputYaw = 0
@@ -192,6 +194,7 @@ function rayEngine.rotate(angle)
rayEngine.player.rotation = constrainAngle(rayEngine.player.rotation + angle)
end
----------------- Начинаем поворачиааться ------------------------
function rayEngine.turnRight()
inputYaw = 1
--rayEngine.rotate(rayEngine.player.rotationSpeed)
@@ -202,19 +205,7 @@ function rayEngine.turnLeft()
--rayEngine.rotate(-rayEngine.player.rotationSpeed)
end
function rayEngine.stopY()
inputY = 0
end
function rayEngine.stopX()
inputX = 0
end
function rayEngine.stopYaw()
inputYaw = 0
end
----------------------- Начинаем идти -------------------------
function rayEngine.moveForward()
inputY = 1
--rayEngine.move(rayEngine.player.moveSpeed, 0)
@@ -235,6 +226,21 @@ function rayEngine.moveRight()
--rayEngine.move(0, rayEngine.player.moveSpeed)
end
--------------- Стоп --------------------------------------
function rayEngine.stopYaw()
inputYaw = 0
end
function rayEngine.stopY()
inputY = 0
end
function rayEngine.stopX()
inputX = 0
end
function rayEngine.jump()
if not rayEngine.player.jumpTimer then
local function onJumpFinished()