From ac286505ccfafbddf2caca343b1c767fcb241e44 Mon Sep 17 00:00:00 2001 From: MrPixel92 <35262174+MrPixel92@users.noreply.github.com> Date: Thu, 27 Apr 2023 22:51:39 +0300 Subject: [PATCH] Updated RayEngine.lua Added a few comments --- Applications/RayWalk.app/RayEngine.lua | 32 +++++++++++++++----------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/Applications/RayWalk.app/RayEngine.lua b/Applications/RayWalk.app/RayEngine.lua index 648a1bb4..5da0dbe5 100755 --- a/Applications/RayWalk.app/RayEngine.lua +++ b/Applications/RayWalk.app/RayEngine.lua @@ -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()