Polish arena effects, audio and diagnostics
This commit is contained in:
1 parent
2774e625c1
commit
16a359d4af
28 files changed
+512
-257
No files matched your search
@@ -4,12 +4,15 @@ local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local RunService = game:GetService("RunService")
|
||||
local Modes = require(ReplicatedStorage:WaitForChild("ArenaModes") :: ModuleScript)
|
||||
|
||||
local Input = game:GetService("UserInputService")
|
||||
local mobile = Input.TouchEnabled and not Input.KeyboardEnabled
|
||||
local player = Players.LocalPlayer
|
||||
local playerGui = player:WaitForChild("PlayerGui")
|
||||
local arena = Modes.geometry(Modes.Procedural)
|
||||
type Arrow = {gui: Frame, chevrons: {Model}, faces: {BasePart}, edges: {BasePart}, glow: {BasePart}, color: Color3?, phase: number}
|
||||
local arrows: {[BasePart]: Arrow} = {}
|
||||
local SIZE = 156
|
||||
local flatArrows: {[BasePart]: {TextLabel}} = {}
|
||||
local SIZE = if mobile then 125 else 156
|
||||
local HEIGHT = 105
|
||||
local MAX_DISTANCE = 710
|
||||
local ANIMATION_RATE = 2 * math.pi / 4.5
|
||||
@@ -31,6 +34,26 @@ local function build(marker: BasePart)
|
||||
gui.BackgroundTransparency = 1
|
||||
gui.Visible = false
|
||||
|
||||
if mobile then
|
||||
local glyphs: {TextLabel} = {}
|
||||
for index, size in {16, 25, 33} do
|
||||
local glyph = Instance.new("TextLabel")
|
||||
glyph.BackgroundTransparency = 1
|
||||
glyph.AnchorPoint = Vector2.new(.5, .5)
|
||||
glyph.Size = UDim2.fromOffset(90, 38)
|
||||
glyph.Font = Enum.Font.GothamBlack
|
||||
glyph.Text = "⌄"
|
||||
glyph.TextSize = size
|
||||
glyph.TextStrokeTransparency = .15
|
||||
glyph.Parent = gui
|
||||
glyphs[index] = glyph
|
||||
end
|
||||
flatArrows[marker] = glyphs
|
||||
arrows[marker] = {gui = gui, chevrons = {}, faces = {}, edges = {}, glow = {}, color = nil, phase = marker.Position.X * .03}
|
||||
gui.Parent = overlay
|
||||
return
|
||||
end
|
||||
|
||||
local viewport = Instance.new("ViewportFrame")
|
||||
viewport.Name = "ArrowViewport"
|
||||
viewport.BackgroundTransparency = 1
|
||||
@@ -87,6 +110,7 @@ local function remove(instance: Instance)
|
||||
local arrow = arrows[instance]
|
||||
if not arrow then return end
|
||||
arrows[instance] = nil
|
||||
flatArrows[instance] = nil
|
||||
arrow.gui:Destroy()
|
||||
end
|
||||
|
||||
@@ -115,6 +139,13 @@ RunService:BindToRenderStep(renderName, Enum.RenderPriority.Camera.Value + 3, fu
|
||||
|
||||
arrow.gui.Position = UDim2.fromOffset(projected.X, y)
|
||||
local spacing = 1.15 + math.sin(phase - .9) * .16
|
||||
local flat = flatArrows[marker]
|
||||
if flat then
|
||||
for i, glyph in flat do
|
||||
glyph.Position = UDim2.new(.5, 0, .5, (i - 2) * 18 * spacing)
|
||||
glyph.TextColor3 = marker.Color:Lerp(Color3.new(1,1,1), .25)
|
||||
end
|
||||
end
|
||||
for index, chevron in arrow.chevrons do
|
||||
chevron:PivotTo(CFrame.new(0, (2 - index) * spacing, 0))
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user