--pavetr.top/ds local a, b = Color(185, 185, 185), Color(60, 60, 60) local c, d = KEY_UP, KEY_DOWN; local e, f = 800, 600; local g = ScrH() / 600 * Vector(1, 1, 1) local h = (ScrW() - 800) * 800 / ScrW() * .5; local i = 200; local j = Sound('garrysmod/balloon_pop_cute.wav') local k = { l = -16, r = 16, t = -64, b = 64 } local l = { l = -16, r = 16, t = -16, b = 16 } local m = { y = 300, x = 760, score = 0, name = GetConVarString('name') } local n = { y = 300, x = 40, score = 0, name = 'Bot01', nextthink = 0, move = 0 } local o = { x = 400, y = 300, velx = 0, vely = 0 } local p = RealTime() + 3; local q = false; local r = 250; local s = 1; local t = 0; local u = 1 / 30; local function v(w, x, y, z, A, B, C, D) return w < B and A < x and y < D and C < z end; local function E() m.y = 300; n.y = 300; o.x = 400; o.y = 300; p = RealTime() + 3; q = false; wind = 1 end; local function F() local G, H = math.min(u, RealFrameTime()), RealTime() if p > H then return end; if q == false then o.velx = r * s; o.vely = math.random(-r, r) q = true end; local I = (input.IsKeyDown(c) and -i or input.IsKeyDown(d) and i or 0) * G; m.y = math.Clamp(m.y + I, 64, 536) if H > n.nextthink then if o.velx < 0 then local J = o.y + o.vely * G * (o.x - n.x) * .5 - n.y; n.move = J > 55 and 1 or J < -55 and -1 or 0 else local J = m.y - n.y; n.move = J > 55 and 1 or J < -55 and -1 or 0 end; n.nextthink = H + .016 end; n.y = math.Clamp(n.y + n.move * i * G, 64, 536) o.x = o.x + o.velx * G; o.y = o.y + o.vely * G; local K, L, M, N = o.x + l.l, o.x + l.r, o.y + l.t, o.y + l.b; if o.vely > 0 and o.y > 584 then o.vely = -math.abs(o.vely) surface.PlaySound(j) t = t + .5 elseif o.vely < 0 and o.y < 16 then o.vely = math.abs(o.vely) surface.PlaySound(j) t = t + .5 end; if o.velx > 0 then local O, P, Q, R = m.x + k.l, m.x + k.r, m.y + k.t, m.y + k.b; if v(K, L, M, N, O, P, Q, R) then o.velx = -o.velx; o.vely = math.floor(o.y - m.y) * 5; surface.PlaySound(j) t = t + .5 elseif o.x > 784 then s = -1; n.score = n.score + 1; E() end elseif o.velx < 0 then local O, P, Q, R = n.x + k.l, n.x + k.r, n.y + k.t, n.y + k.b; if v(K, L, M, N, O, P, Q, R) then o.velx = -o.velx; o.vely = math.floor(o.y - n.y) * 5; surface.PlaySound(j) t = t + .5 elseif o.x < 16 then s = 1; m.score = m.score + 1; E() end end end; surface.CreateFont('Pong.Large', { font = 'Roboto Lt', size = 94, antialias = true }) surface.CreateFont('Pong.Medium', { font = 'Roboto Lt', size = 69, antialias = true }) surface.CreateFont('Pong.Small', { font = 'Roboto Lt', size = 32, antialias = true, extended = true }) local function S() cam.Start2D() local T = Matrix() T:Identity() T:SetScale(g) local U = RealTime() * 15; t = math.min(1.5, t) local V = Vector(math.sin(U) * t, math.cos(U) * t) t = math.Approach(t, 0, RealFrameTime() * 3) local W = math.sin(U) * t * .25; T:SetTranslation(V + Vector(math.cos(W) * h, math.sin(W) * 300)) T:Rotate(Angle(0, W, 0)) cam.PushModelMatrix(T) render.Clear(60, 60, 60, 255) surface.SetDrawColor(30, 30, 30, 255) surface.DrawRect(0, 0, 800, 600) draw.SimpleText(m.score, 'Pong.Medium', 600, 300, b, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText(n.score, 'Pong.Medium', 200, 300, b, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText(m.name, 'Pong.Small', 600, 24, b, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText(n.name, 'Pong.Small', 200, 24, b, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) surface.SetDrawColor(60, 60, 60, 255) surface.DrawRect(392, 0, 16, 600) surface.SetDrawColor(a) local X, Y, e, f = m.x + k.l, m.y + k.t, k.r - k.l, k.b - k.t; surface.DrawRect(X, Y, e, f) local X, Y = n.x + k.l, n.y + k.t; surface.DrawRect(X, Y, e, f) local X, Y, e, f = o.x + l.l, o.y + l.t, l.r - l.l, l.b - l.t; surface.DrawRect(X, Y, e, f) local Z = p - RealTime() if Z > 0 then draw.SimpleTextOutlined(math.floor(Z) + 1, 'Pong.Large', 400, 300, a, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER, 2, b) end; draw.SimpleText("PRESS BACKSPACE TO CLOSE", "Pong.Small", 10, 10, Color(255, 255, 255)) cam.PopModelMatrix() cam.End2D() end; local function _() if input.IsKeyDown(KEY_BACKSPACE) then hook.Remove('RenderScene', 'LoadingScreen') end; F() S() return true end; hook.Add('RenderScene', 'LoadingScreen', _)