Skip to content

Commit

Permalink
Fixes lel?
Browse files Browse the repository at this point in the history
  • Loading branch information
max-bacon committed Aug 14, 2023
1 parent 7f2c33e commit 698858f
Show file tree
Hide file tree
Showing 11 changed files with 911 additions and 889 deletions.
Binary file modified .lune/map.rbxl
Binary file not shown.
Binary file modified assets/Workspace/Extras.rbxm
Binary file not shown.
Binary file modified assets/Workspace/Obstacles.rbxm
Binary file not shown.
1,734 changes: 876 additions & 858 deletions sourcemap.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions src/Server/Components/Checkpoint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ function Checkpoint:_onTouched(hit: BasePart)
if not hum then
return
end

if not (hum.Health > 0) then
return
end

local Player = game:GetService("Players"):GetPlayerFromCharacter(hum.Parent)

Expand Down
30 changes: 12 additions & 18 deletions src/Server/Components/FireMonsterObstacle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ local FireMonsterObstacle = Component.new({
})

function FireMonsterObstacle:_onTouched(hit: BasePart)
if not self.Active then
return
end

assert(hit.Parent)
local hum = hit.Parent:FindFirstChild("Humanoid")
if not hum then
Expand All @@ -24,20 +28,14 @@ function FireMonsterObstacle:_onTouched(hit: BasePart)
end
end

function FireMonsterObstacle:_scanForTouchingParts()
self._trove:Add(RunService.Heartbeat:Connect(function(dt: number)
if not self.Active then
return
function FireMonsterObstacle:_initializeTouchedConnections()
for _, p in self.Instance.Hitboxes:GetDescendants() do
if p:IsA("BasePart") then
self._trove:Add(p.Touched:Connect(function(hit)
self:_onTouched(hit)
end))
end
for _, touch in self.Instance.Hitboxes:GetDescendants() do
if not touch:IsA("BasePart") then
continue
end
for _, part in workspace:GetPartsInPart(touch, self.OverlapParams) do
self:_onTouched(part)
end
end
end))
end
end

function FireMonsterObstacle:setEmitters(value: boolean)
Expand All @@ -50,10 +48,6 @@ function FireMonsterObstacle:setEmitters(value: boolean)
end

function FireMonsterObstacle:Construct()
self.OverlapParams = OverlapParams.new()
self.OverlapParams.FilterType = Enum.RaycastFilterType.Exclude
self.OverlapParams.FilterDescendantsInstances = { self.Instance }

self._trove = Trove.new()
self.Active = false

Expand All @@ -67,7 +61,7 @@ function FireMonsterObstacle:Construct()
end
end

self:_scanForTouchingParts()
self:_initializeTouchedConnections()
end

function FireMonsterObstacle:Start()
Expand Down
16 changes: 6 additions & 10 deletions src/Server/Components/SpinningYingYang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,27 @@ local Component = require(ReplicatedStorage.Packages.Component) :: any
local Promise = require(ReplicatedStorage.Packages.Promise) :: any
local Trove = require(ReplicatedStorage.Packages.Trove)

local TIME_PER_SPIN = 1
local ANGULAR_VELO = Vector3.new(0, 5, 0)

local SpinningYingYang = Component.new({
Tag = "SpinningYingYang",
})

function SpinningYingYang:Construct()
self._trove = Trove.new()
self._alignPosition = self.Instance.AlignPosition
self._angVelo = self.Instance.AngularVelocity
end

function SpinningYingYang:Start()
local directionSign = CollectionService:HasTag(self.Instance, "1") and 1
or CollectionService:HasTag(self.Instance, "2") and -1
or error("No 1 or 2 tag")

local spinTween = TweenService:Create(
self.Instance,
TweenInfo.new(TIME_PER_SPIN, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, -1),
{ Rotation = directionSign * Vector3.new(0, 360, 0) }
)
spinTween:Play()

self._trove:Add(function()
spinTween:Cancel()
end)
self._alignPosition.Position = self.Instance.Position

self._angVelo.AngularVelocity = ANGULAR_VELO * directionSign
end

function SpinningYingYang:Stop()
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Modules/SpawnModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function SpawnModule.spawn(player: Player, char: Model?, awaitChange: boolean?)

local spawn = checkpoint:FindFirstChild("Spawn") or checkpoint:FindFirstChild("Teleport")
wait()
character.PrimaryPart.CFrame = spawn.CFrame * CFrame.new(0, 2, 0)
character.PrimaryPart.CFrame = spawn.CFrame * CFrame.new(0, 3, 0)
end

return SpawnModule
2 changes: 1 addition & 1 deletion src/Server/Modules/StatsModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function StatsModule.initialize(player: Player)

local level = Instance.new("IntValue")
level.Name = "Stage"
level.Value = 0
level.Value = 10
level.Parent = leaderstats

local wins = Instance.new("IntValue")
Expand Down
9 changes: 9 additions & 0 deletions src/Server/ServerInit.server.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
local CollectionService = game:GetService("CollectionService")
local PhysicsService = game:GetService("PhysicsService")
local ServerScriptService = game:GetService("ServerScriptService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
Expand All @@ -22,10 +23,18 @@ for _, c in ServerScriptService.Components:GetChildren() do
Components[c.Name] = require(c) :: any
end

PhysicsService:RegisterCollisionGroup("PlayerCharacter")
PhysicsService:CollisionGroupSetCollidable("PlayerCharacter", "PlayerCharacter", false)

Players.PlayerAdded:Connect(function(player: Player)
StatsModule.initialize(player)

player.CharacterAdded:Connect(function(character: Model)
for _, p in character:GetChildren() do
if p:IsA("BasePart") then
p.CollisionGroup = "PlayerCharacter"
end
end
SpawnModule.spawn(player, character, true)
end)
end)
Expand Down
3 changes: 2 additions & 1 deletion src/Shared/FusionMaterial/CheckpointNotification.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type State = State.State
local Fusion = require(Packages.Fusion)

local Images = require(ReplicatedStorage.Assets.Images).UI
local Sounds = require(ReplicatedStorage.Assets.Sounds)

local rotTime = 2
local degPerSec = 360 / rotTime
Expand Down Expand Up @@ -76,7 +77,7 @@ return function(checkpointTransparency: Fusion.Value<number>)
Fusion.New("Sound")({
Name = "CheckpointSound",
Volume = 0,

SoundId = Sounds.Checkpoint
})
},

Expand Down

0 comments on commit 698858f

Please sign in to comment.