-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSine-Wave.lua
More file actions
41 lines (32 loc) · 1.01 KB
/
Copy pathSine-Wave.lua
File metadata and controls
41 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
local RunService = game:FindService("RunService")
local t = 0
local amount = 0
local characters = {"*", "-", "~", ".", "o", "+", "x", "#", "%", "@", "&", "$", "^", "=", "!"}
RunService.RenderStepped:Connect(function()
local screen = {}
for i = 1, 1760 do
screen[i] = " "
end
local amplitude = 12
local frequency = 0.06
for x = 0, 80*(amount >= 1 and amount or 1) do
local y = math.floor(12 + amplitude * math.sin((x + t) * frequency))
local char = characters[(x % #characters) + 1]
for offset = -2, 2 do
local index = x + (y + offset) * 80
if index > 0 and index <= #screen then
screen[index] = char
end
end
end
local output = {}
for index = 1, #screen do
table.insert(output, screen[index])
if index % 80 == 0 then
table.insert(output, "\n")
end
end
print("\n" .. table.concat(output))
rconsoleprint("\n" .. table.concat(output))
t += 1
end)