mirror of
https://github.com/IgorTimofeev/MineOS.git
synced 2026-04-04 15:12:46 +02:00
Updated RayEngine.lua
Added a few comments
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user