MCPcopy Create free account
hub / github.com/DruidMech/MultiplayerCourseBlasterGame / Tick

Method Tick

Source/Blaster/GameMode/BlasterGameMode.cpp:29–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27}
28
29void ABlasterGameMode::Tick(float DeltaTime)
30{
31 Super::Tick(DeltaTime);
32
33 if (MatchState == MatchState::WaitingToStart)
34 {
35 CountdownTime = WarmupTime - GetWorld()->GetTimeSeconds() + LevelStartingTime;
36 if (CountdownTime <= 0.f)
37 {
38 StartMatch();
39 }
40 }
41 else if (MatchState == MatchState::InProgress)
42 {
43 CountdownTime = WarmupTime + MatchTime - GetWorld()->GetTimeSeconds() + LevelStartingTime;
44 if (CountdownTime <= 0.f)
45 {
46 SetMatchState(MatchState::Cooldown);
47 }
48 }
49 else if (MatchState == MatchState::Cooldown)
50 {
51 CountdownTime = CooldownTime + WarmupTime + MatchTime - GetWorld()->GetTimeSeconds() + LevelStartingTime;
52 if (CountdownTime <= 0.f)
53 {
54 RestartGame();
55 }
56 }
57}
58
59void ABlasterGameMode::OnMatchStateSet()
60{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected