From f03e780e96a913ebd4fbd2519286fb5dee031dbc Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Sun, 19 Jun 2016 01:23:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B5=D0=B1=D0=B0=D1=82=D1=8C=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BC=D0=B8=D1=82,=20=D0=B1=D0=BB=D1=8F=D0=B4=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications.txt | 110 +++++++++++------- Applications/RayWalk/RayWalk.lua | 18 ++- .../Weapons/CrosshairTextures/Angled.pic | Bin 0 -> 93 bytes .../Weapons/CrosshairTextures/Default.pic | Bin 0 -> 78 bytes .../Weapons/CrosshairTextures/Half.pic | Bin 0 -> 67 bytes .../Weapons/FireTextures/PowderFire.pic | Bin 0 -> 4287 bytes .../RayWalk/Weapons/WeaponTextures/Pistol.pic | Bin 0 -> 3870 bytes .../RayWalk/Weapons/WeaponTextures/Rifle.pic | Bin 0 -> 5065 bytes .../RayWalk/Weapons/WeaponTextures/Sniper.pic | Bin 0 -> 7190 bytes Applications/RayWalk/Weapons/Weapons.cfg | 35 ++++++ .../RayWalk/Worlds/ExampleWorld/Player.cfg | 4 + .../RayWalk/Worlds/ExampleWorld/World.cfg | 2 +- .../RayWalk/Worlds/ForeverDay/Map.cfg | 28 ----- .../RayWalk/Worlds/ForeverDay/Player.cfg | 13 --- .../RayWalk/Worlds/ForeverDay/World.cfg | 59 ---------- .../RayWalk/Worlds/SundownBeams/Player.cfg | 4 + lib/rayEngine.lua | 55 ++++++++- 17 files changed, 183 insertions(+), 145 deletions(-) create mode 100644 Applications/RayWalk/Weapons/CrosshairTextures/Angled.pic create mode 100644 Applications/RayWalk/Weapons/CrosshairTextures/Default.pic create mode 100644 Applications/RayWalk/Weapons/CrosshairTextures/Half.pic create mode 100644 Applications/RayWalk/Weapons/FireTextures/PowderFire.pic create mode 100644 Applications/RayWalk/Weapons/WeaponTextures/Pistol.pic create mode 100644 Applications/RayWalk/Weapons/WeaponTextures/Rifle.pic create mode 100644 Applications/RayWalk/Weapons/WeaponTextures/Sniper.pic create mode 100644 Applications/RayWalk/Weapons/Weapons.cfg delete mode 100644 Applications/RayWalk/Worlds/ForeverDay/Map.cfg delete mode 100644 Applications/RayWalk/Worlds/ForeverDay/Player.cfg delete mode 100644 Applications/RayWalk/Worlds/ForeverDay/World.cfg diff --git a/Applications.txt b/Applications.txt index 98a58a23..f311781d 100644 --- a/Applications.txt +++ b/Applications.txt @@ -546,45 +546,77 @@ }, }, }, - -- { - -- name="MineOS/Applications/RayWalk", - -- url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/RayWalk.lua", - -- about="IgorTimofeev/OpenComputers/master/Applications/RayWalk/About/", - -- type="Application", - -- icon="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Icon.pic", - -- createShortcut="desktop", - -- version=1.44, - -- resources={ - -- { - -- name="RayEngine.cfg", - -- url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/RayEngine.cfg", - -- }, - -- { - -- name="Worlds/ExampleWorld/Map.cfg", - -- url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/ExampleWorld/Map.cfg", - -- }, - -- { - -- name="Worlds/ExampleWorld/Player.cfg", - -- url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/ExampleWorld/Player.cfg", - -- }, - -- { - -- name="Worlds/ExampleWorld/World.cfg", - -- url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/ExampleWorld/World.cfg", - -- }, - -- { - -- name="Worlds/SundownBeams/Map.cfg", - -- url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/SundownBeams/Map.cfg", - -- }, - -- { - -- name="Worlds/SundownBeams/Player.cfg", - -- url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/SundownBeams/Player.cfg", - -- }, - -- { - -- name="Worlds/SundownBeams/World.cfg", - -- url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/SundownBeams/World.cfg", - -- }, - -- }, - -- }, + { + name="MineOS/Applications/RayWalk", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/RayWalk.lua", + about="IgorTimofeev/OpenComputers/master/Applications/RayWalk/About/", + type="Application", + icon="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Icon.pic", + createShortcut="desktop", + version=1.45, + resources={ + { + name="RayEngine.cfg", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/RayEngine.cfg", + }, +------------ + { + name="Weapons/CrosshairTextures/Angled.pic", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Weapons/CrosshairTextures/Angled.pic", + }, + { + name="Weapons/CrosshairTextures/Default.pic", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Weapons/CrosshairTextures/Default.pic", + }, + { + name="Weapons/CrosshairTextures/Half.pic", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Weapons/CrosshairTextures/Half.pic", + }, +------------ + { + name="Weapons/FireTextures/PowderFire.pic", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Weapons/FireTextures/PowderFire.pic", + }, +------------ + { + name="Weapons/WeaponTextures/Pistol.pic", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Weapons/WeaponTextures/Pistol.pic", + }, + { + name="Weapons/WeaponTextures/Sniper.pic", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Weapons/WeaponTextures/Sniper.pic", + }, + { + name="Weapons/WeaponTextures/Rifle.pic", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Weapons/WeaponTextures/Rifle.pic", + }, +------------ + { + name="Worlds/ExampleWorld/Map.cfg", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/ExampleWorld/Map.cfg", + }, + { + name="Worlds/ExampleWorld/Player.cfg", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/ExampleWorld/Player.cfg", + }, + { + name="Worlds/ExampleWorld/World.cfg", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/ExampleWorld/World.cfg", + }, + { + name="Worlds/SundownBeams/Map.cfg", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/SundownBeams/Map.cfg", + }, + { + name="Worlds/SundownBeams/Player.cfg", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/SundownBeams/Player.cfg", + }, + { + name="Worlds/SundownBeams/World.cfg", + url="IgorTimofeev/OpenComputers/master/Applications/RayWalk/Worlds/SundownBeams/World.cfg", + }, + }, + }, { name="MineOS/Applications/GuessWord", url="IgorTimofeev/OpenComputers/master/Applications/GuessWord/GuessWord.lua", diff --git a/Applications/RayWalk/RayWalk.lua b/Applications/RayWalk/RayWalk.lua index f26e4ea0..31a355f7 100644 --- a/Applications/RayWalk/RayWalk.lua +++ b/Applications/RayWalk/RayWalk.lua @@ -11,6 +11,9 @@ local libraries = { } for library in pairs(libraries) do if not _G[library] then _G[library] = require(libraries[library]) end end; libraries = nil + +---------------------------------------------------------------------------------------------------------------------------------- + local applicationPath = "MineOS/Applications/RayWalk.app/Resources/" local worldsPath = applicationPath .. "Worlds/" local rayWalkVersion = "RayWalk v3.2 closed beta" @@ -82,7 +85,8 @@ local controls = { buffer.start() -- rayEngine.intro() -rayEngine.init(applicationPath .. "RayEngine.cfg") +rayEngine.loadEngine(applicationPath .. "RayEngine.cfg") +rayEngine.loadWeapons(applicationPath .. "Weapons/") rayEngine.loadWorld(worldsPath .. "ExampleWorld") menu() rayEngine.update() @@ -92,9 +96,17 @@ while (true) do if ( e[1] ) then if e[1] == "touch" then - if e[5] == 1 then rayEngine.place(3) else rayEngine.destroy(3) end + if e[5] == 1 then + if not rayEngine.currentWeapon then rayEngine.place(3) end + else + if rayEngine.currentWeapon then rayEngine.fire() else rayEngine.destroy(3) end + end else - if controls[e[1]] and controls[e[1]][e[4]] then controls[e[1]][e[4]]() end + if e[4] > 1 and e[4] < 10 then + rayEngine.changeWeapon(e[4] - 2) + else + if controls[e[1]] and controls[e[1]][e[4]] then controls[e[1]][e[4]]() end + end end end diff --git a/Applications/RayWalk/Weapons/CrosshairTextures/Angled.pic b/Applications/RayWalk/Weapons/CrosshairTextures/Angled.pic new file mode 100644 index 0000000000000000000000000000000000000000..301892fdd6947caf10eee6486f090a3628bb9041 GIT binary patch literal 93 zcmXwvyA6Oa3;egVT dhv~;Kg60+XaTfF}kO0%`dmFBbf4D{f^#S4h5yt=k literal 0 HcmV?d00001 diff --git a/Applications/RayWalk/Weapons/CrosshairTextures/Default.pic b/Applications/RayWalk/Weapons/CrosshairTextures/Default.pic new file mode 100644 index 0000000000000000000000000000000000000000..e997c9a31f90854ce5a98bc97902e7ef90922c8f GIT binary patch literal 78 zcmW-Y!3}^g48-DGx(BOJq)NPa^p$ZCD=;C86w1%C>|@(o6s>4djJ3c literal 0 HcmV?d00001 diff --git a/Applications/RayWalk/Weapons/CrosshairTextures/Half.pic b/Applications/RayWalk/Weapons/CrosshairTextures/Half.pic new file mode 100644 index 0000000000000000000000000000000000000000..465c6f47234a6471b31c4958b632f6456df4135d GIT binary patch literal 67 zcmeZw_H<)mWpZR>{vXV!;Ks<{#K6Q5$;ikY$->0Q#KIcP_-IPA8{>Z`21cMT6Ele4 L2;;Lbf|LLNr#K9( literal 0 HcmV?d00001 diff --git a/Applications/RayWalk/Weapons/FireTextures/PowderFire.pic b/Applications/RayWalk/Weapons/FireTextures/PowderFire.pic new file mode 100644 index 0000000000000000000000000000000000000000..f91c3c47e377329c865420779734f7069e8eb676 GIT binary patch literal 4287 zcmb`KUvAq*5XRFJ^a#~a2oxyLryilYiTTho6n)bz)I1bbiXsSW5C~v6GAy=XRd{8{ z2;)aRPQUrTOcf+4Vi4wVx!j%k&9}3w@4o)_n=iil@`?P>;&a_EhhGnmug{K0!+5qG zQ)hes^RvF&y=v3hM{egv(dbK-pQ;tf4#h$&Qm`7-KWwx-uyw+ z-|+s=y^kl^L+BC(oQx>KTDNF>g2<>_mi3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xV?qHyAB=EH@*Z6 z#1N25Ov{pcQ&{8=A7#URMhQuqNWeM*>n{DJTH*aK*khB(cN4L9`HpGw!4XT#?ux`Q zj96RrEk_Q3g9Svjd^Nmb<#Oo*zWkv>@TJrdc!Y>9z2G{mQJSCFKj_P+SBR}9~>li zf8~k$s->0uHHMG!NGGpw(cm~(Rno>tOWN7p_f-!#05_MIi6&36CH52oYH3M;SfW6i zJc}3~6|Hr3lbZ4fsXi94NbfvWf^ff&8I@=H8-V~ zsE*MT<|D1(S9tENY43XiB7oZG7^1XMtOQ!ZrSia&%%rj+T2oFZ1a3Rve{SqVFd_yd HTy*{o`%T{7 literal 0 HcmV?d00001 diff --git a/Applications/RayWalk/Weapons/WeaponTextures/Sniper.pic b/Applications/RayWalk/Weapons/WeaponTextures/Sniper.pic new file mode 100644 index 0000000000000000000000000000000000000000..926953e20287dbea395a1ee716e20161b311e7a5 GIT binary patch literal 7190 zcmai(xpE!H6^3umc4y!B1s6L&fFy{81h|veRa5220mxu7G0|hlR+UpFWRde6ADhrQ{~8voe&WR7UXNa)_*3XA?|S?K;{O0O@vldme*ql@*L~N}N8wL< z!sxo^Dmqbo-QisIgvoW!^_29w<63T*UG-dd`1xhW)e5V)e4WhlqA{7()w8~OHdoK~ z@~L+`C)KOvOxvB5a{}oG$aiDXoU)?vVp5TF?*H|7za7znjvr2{c($Bb?-^LdwKZmDxZE5}YS@@md$63@uX%1` zTrjDSv7CuL3j^LGq@@{V{+c;=CuQB5RCkYYw53OA`H(qijc?NaJ^r$$*SZ zVPQ{NW!aOe!KE#iv-Ad{F;`ok45L`v*uw84#Af-uNt+iHB8zpMCcK0SD ztkz|6gfTe-h5K;QO54RD92o8{XW==L(QWiNdKY1L_+$4c=qB_5FMZxl`Y?B(MT!X- zrsNM0b>kG!eQ^GimDIkPko7<{JVGDsYDwI91{*}{)np{its}%bC?61A-CE9^FDJc< zI!ICvlh#B?X#v0Un6f@;k(Ypl&|?izL?C|1^BogVt3F~fWj14xj$IaR&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cmV?d00001 diff --git a/Applications/RayWalk/Weapons/Weapons.cfg b/Applications/RayWalk/Weapons/Weapons.cfg new file mode 100644 index 00000000..517be9f3 --- /dev/null +++ b/Applications/RayWalk/Weapons/Weapons.cfg @@ -0,0 +1,35 @@ +{ + { + name = "USP-5", + damage = 25, + weaponTexture = "WeaponTextures/Pistol.pic", + fireTexture = "FireTextures/PowderFire.pic", + firePosition = { + x = -1, + y = -4, + }, + crosshairTexture = "CrosshairTextures/Default.pic", + }, + { + name = "MAG20-USP", + damage = 48, + weaponTexture = "WeaponTextures/Rifle.pic", + fireTexture = "FireTextures/PowderFire.pic", + firePosition = { + x = 1, + y = -1, + }, + crosshairTexture = "CrosshairTextures/Half.pic", + }, + { + name = "UberSniper228", + damage = 100, + weaponTexture = "WeaponTextures/Sniper.pic", + fireTexture = "FireTextures/PowderFire.pic", + firePosition = { + x = -5, + y = 1, + }, + crosshairTexture = "CrosshairTextures/Angled.pic", + }, +} \ No newline at end of file diff --git a/Applications/RayWalk/Worlds/ExampleWorld/Player.cfg b/Applications/RayWalk/Worlds/ExampleWorld/Player.cfg index a43d74fe..777a7e19 100644 --- a/Applications/RayWalk/Worlds/ExampleWorld/Player.cfg +++ b/Applications/RayWalk/Worlds/ExampleWorld/Player.cfg @@ -3,6 +3,10 @@ x = 5, y = 5, }, + health = { + maximum = 100, + current = 100, + }, isCrouched = false, jumpHeight = 10, moveSpeed = 16, diff --git a/Applications/RayWalk/Worlds/ExampleWorld/World.cfg b/Applications/RayWalk/Worlds/ExampleWorld/World.cfg index a52f11c8..81b76a9c 100644 --- a/Applications/RayWalk/Worlds/ExampleWorld/World.cfg +++ b/Applications/RayWalk/Worlds/ExampleWorld/World.cfg @@ -1,7 +1,7 @@ { dayNightCycle = { enabled = true, - currentTime = 90, + currentTime = 100, speed = 1, length = 300, }, diff --git a/Applications/RayWalk/Worlds/ForeverDay/Map.cfg b/Applications/RayWalk/Worlds/ForeverDay/Map.cfg deleted file mode 100644 index 74dde403..00000000 --- a/Applications/RayWalk/Worlds/ForeverDay/Map.cfg +++ /dev/null @@ -1,28 +0,0 @@ -{ - { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0x0 }, - { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }, -} \ No newline at end of file diff --git a/Applications/RayWalk/Worlds/ForeverDay/Player.cfg b/Applications/RayWalk/Worlds/ForeverDay/Player.cfg deleted file mode 100644 index a43d74fe..00000000 --- a/Applications/RayWalk/Worlds/ForeverDay/Player.cfg +++ /dev/null @@ -1,13 +0,0 @@ -{ - position = { - x = 5, - y = 5, - }, - isCrouched = false, - jumpHeight = 10, - moveSpeed = 16, - rotationSpeed = 5, - crouchHeight = 10, - fieldOfView = 60, - rotation = 0, -} \ No newline at end of file diff --git a/Applications/RayWalk/Worlds/ForeverDay/World.cfg b/Applications/RayWalk/Worlds/ForeverDay/World.cfg deleted file mode 100644 index 99f62b94..00000000 --- a/Applications/RayWalk/Worlds/ForeverDay/World.cfg +++ /dev/null @@ -1,59 +0,0 @@ -{ - dayNightCycle = { - enabled = false, - currentTime = 90, - speed = 1, - length = 200, - }, - colors = { - ground = 0xEEEEEE, - clouds = 0xFFFFFF, - sky = { - 0x002440, - 0x002480, - 0x3349BF, - 0x6692FF, - 0x99DBFF, - 0x99DBFF, - 0x99DBFF, - 0x66B6FF, - 0x66B6FF, - 0xFFDB80, - 0xFFB640, - 0xCCBD00, - 0x000080, - 0x002440, - }, - brightnessMultiplyer = { - 20, - 40, - 60, - 80, - 100, - 100, - 100, - 80, - 80, - 70, - 60, - 50, - 40, - 30, - }, - tile = { - 0x000000, - 0x111111, - 0x222222, - 0x333333, - 0x444444, - 0x555555, - 0x666666, - 0x777777, - 0x888888, - 0x999999, - 0xAAAAAA, - 0xBBBBBB, - 0xCCCCCC, - }, - }, -} \ No newline at end of file diff --git a/Applications/RayWalk/Worlds/SundownBeams/Player.cfg b/Applications/RayWalk/Worlds/SundownBeams/Player.cfg index a43d74fe..777a7e19 100644 --- a/Applications/RayWalk/Worlds/SundownBeams/Player.cfg +++ b/Applications/RayWalk/Worlds/SundownBeams/Player.cfg @@ -3,6 +3,10 @@ x = 5, y = 5, }, + health = { + maximum = 100, + current = 100, + }, isCrouched = false, jumpHeight = 10, moveSpeed = 16, diff --git a/lib/rayEngine.lua b/lib/rayEngine.lua index 84339ee6..713f8f33 100644 --- a/lib/rayEngine.lua +++ b/lib/rayEngine.lua @@ -88,14 +88,39 @@ local function getBlockCoordsByLook(distance) return convertWorldCoordsToMapCoords(rayEngine.player.position.x + distance * math.sin(radRotation) * rayEngine.properties.tileWidth, rayEngine.player.position.y + distance * math.cos(radRotation) * rayEngine.properties.tileWidth) end +function rayEngine.changeWeapon(weaponID) + if rayEngine.weapons[weaponID] then + rayEngine.currentWeapon = { + damage = rayEngine.weapons[weaponID].damage, + weaponTexture = image.load(rayEngine.weaponsFolder .. rayEngine.weapons[weaponID].weaponTexture), + fireTexture = image.load(rayEngine.weaponsFolder .. rayEngine.weapons[weaponID].fireTexture), + crosshairTexture = image.load(rayEngine.weaponsFolder .. rayEngine.weapons[weaponID].crosshairTexture) + } + rayEngine.currentWeapon.xWeapon = buffer.screen.width - rayEngine.currentWeapon.weaponTexture.width + 1 + rayEngine.currentWeapon.yWeapon = buffer.screen.height - rayEngine.currentWeapon.weaponTexture.height + 1 + rayEngine.currentWeapon.xFire = rayEngine.currentWeapon.xWeapon + rayEngine.weapons[weaponID].firePosition.x + rayEngine.currentWeapon.yFire = rayEngine.currentWeapon.yWeapon + rayEngine.weapons[weaponID].firePosition.y + rayEngine.currentWeapon.xCrosshair = math.floor(buffer.screen.width / 2 - rayEngine.currentWeapon.crosshairTexture.width / 2) + rayEngine.currentWeapon.yCrosshair = math.floor(buffer.screen.height / 2 - rayEngine.currentWeapon.crosshairTexture.height / 2) + else + rayEngine.currentWeapon = nil + end +end + ---------------------------------------------------- Работа с файлами ------------------------------------------------------------------ --Грузим базовый конфиг движка -function rayEngine.init(pathToRayEnginePropertiesFile) +function rayEngine.loadEngine(pathToRayEnginePropertiesFile) rayEngine.properties = files.loadTableFromFile(pathToRayEnginePropertiesFile) rayEngine.properties.raycastQuality = rayEngine.properties.raycastQuality * rayEngine.properties.tileWidth end +function rayEngine.loadWeapons(pathToWeaponsFolder) + rayEngine.weaponsFolder = pathToWeaponsFolder + rayEngine.weapons = files.loadTableFromFile(rayEngine.weaponsFolder .. "Weapons.cfg") + rayEngine.changeWeapon(1) +end + --Загружаем все конфиг-файлы мира function rayEngine.loadWorld(pathToWorldFolder) rayEngine.world = files.loadTableFromFile(pathToWorldFolder .. "/World.cfg") @@ -381,6 +406,21 @@ function rayEngine.toggleWatch() if not rayEngine.watchEnabled then rayEngine.watchImage = nil end end +function rayEngine.drawWeapon() + if rayEngine.currentWeapon.needToFire then buffer.image(rayEngine.currentWeapon.xFire, rayEngine.currentWeapon.yFire, rayEngine.currentWeapon.fireTexture); rayEngine.currentWeapon.needToFire = false end + buffer.image(rayEngine.currentWeapon.xWeapon, rayEngine.currentWeapon.yWeapon, rayEngine.currentWeapon.weaponTexture) + buffer.image(rayEngine.currentWeapon.xCrosshair, rayEngine.currentWeapon.yCrosshair, rayEngine.currentWeapon.crosshairTexture) +end + +function rayEngine.drawStats() + local width = math.floor(buffer.screen.width * 0.3) + local height = 5 + local x, y = buffer.screen.width - width - 1, 2 + buffer.square(x, y, width, height, 0x000000, 0xFFFFFF, " ", 50) + + GUI.progressBar(x + 1, y + 4, width - 2, 1, 0x000000, 0xFF5555, rayEngine.player.health.current, rayEngine.player.health.maximum, true) +end + ---------------------------------------------------- Функции отрисовки мира ------------------------------------------------------------------ local function raycast(angle) @@ -425,6 +465,7 @@ function rayEngine.drawWorld() --Кусочек стенки tileColor = height > distanceLimit and rayEngine.world.colors.tile.byTime[#rayEngine.world.colors.tile.byTime] or rayEngine.world.colors.tile.byTime[math.floor(#rayEngine.world.colors.tile.byTime * height / distanceLimit)] + -- tileColor = 0x000000 buffer.square(math.floor(startX), math.floor(startY), 1, math.floor(height), tileColor, 0x000000, " ") end startX = startX + 1 @@ -433,11 +474,12 @@ end function rayEngine.update() rayEngine.drawWorld() + if rayEngine.currentWeapon then rayEngine.drawWeapon() end if rayEngine.minimapEnabled then rayEngine.drawMap(3, 2, 25, 13, 50) end + -- rayEngine.drawStats() local xTools, yTools = 3, buffer.screen.height - 25 if rayEngine.compassEnabled then rayEngine.compass(xTools, yTools); xTools = xTools + 30 end if rayEngine.watchEnabled then rayEngine.watch(xTools, yTools) end - --rayEngine.drawWeapon() if rayEngine.chatEnabled then rayEngine.chat() end doDayNightCycle() buffer.draw() @@ -445,4 +487,13 @@ end ---------------------------------------------------------------------------------------------------------------------------------- +function rayEngine.fire() + rayEngine.currentWeapon.needToFire = true + rayEngine.update() + os.sleep(0.1) + rayEngine.update() +end + +---------------------------------------------------------------------------------------------------------------------------------- + return rayEngine