diff options
| author | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-03-05 11:55:32 -0500 |
|---|---|---|
| committer | Alexander Pickering <Alexander.Pickering@anondomain.site90.net> | 2016-03-05 11:55:32 -0500 |
| commit | 52cf408ce832952c92804e114746b1e427576a8e (patch) | |
| tree | afcb3ec7264bb98cd992d27452bce51a3467731c /gamemode/hud/games/rubickscircle.lua | |
| parent | 8d1447d13b2ec82588f52467be56b90c8ffe9e80 (diff) | |
| download | wintersurvival2-52cf408ce832952c92804e114746b1e427576a8e.tar.gz wintersurvival2-52cf408ce832952c92804e114746b1e427576a8e.tar.bz2 wintersurvival2-52cf408ce832952c92804e114746b1e427576a8e.zip | |
Added debug data to find bug in circle minigame
Diffstat (limited to 'gamemode/hud/games/rubickscircle.lua')
| -rw-r--r-- | gamemode/hud/games/rubickscircle.lua | 84 |
1 files changed, 41 insertions, 43 deletions
diff --git a/gamemode/hud/games/rubickscircle.lua b/gamemode/hud/games/rubickscircle.lua index cd50bf2..2e81bba 100644 --- a/gamemode/hud/games/rubickscircle.lua +++ b/gamemode/hud/games/rubickscircle.lua @@ -53,7 +53,7 @@ Game.Cast = function(spelltab,difficulty) spelltab.ANIMATE_REMOVE_DURATION = 0.5 spelltab.MaxColor = 3 - spelltab.GoalNum = 5 + spelltab.GoalNum = 2 @@ -107,7 +107,7 @@ Game.Draw = function(self) if not input.IsKeyTrapping() then input.StartKeyTrapping() end - draw.DrawText( "Fill in the empty circles with the appropriate colors", "TargetID", ScrW() * 0.5, ScrH() * 0.25, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER ) + draw.DrawText( "Fill in the empty circles with the appropriate colors. Click the circle to select them, and use Q nd E to rotate the circles.", "TargetID", ScrW() * 0.5, ScrH() * 0.25, Color( 255, 255, 255, 255 ), TEXT_ALIGN_CENTER ) --Draw the rings for i = 0, self.numcircle-1 do if(self.SelectedCircle == i) then @@ -166,47 +166,45 @@ Game.Draw = function(self) surface.DrawCircle(x,y,20,nextcol) --Deal with moveing stuff - if(self.Animateingringnum != -1) then - if(CurTime() > self.Animateingstart+self.ANIMATE_MOVEING_DURATION) then - if(self.Animateingdirection == 1) then - local tmp = self.Circles[self.SelectedCircle][7] - for i = 0, 6 do - self.Circles[self.SelectedCircle][7-i]=self.Circles[self.SelectedCircle][6-i] - end - self.Circles[self.SelectedCircle][0] = tmp - self.Animateingringnum = -1 - self.Animateingdirection = 0 - --Add the new dot in, or fail if we can't - if(self.Circles[self.numcircle-1][self.NextInputDirection] != 0) then - print("self fail :(") - self.Score = 0 - self.scoreboard:Remove() - else - self.Circles[self.numcircle-1][self.NextInputDirection] = self.NextInputColor - self.NextInputDirection = math.Round(math.random(0,7)) - self.NextInputColor = math.Round(math.random(1,self.MaxColor)) - end - self.ProcessMoved(self) - elseif(self.Animateingdirection == -1) then - local tmp = self.Circles[self.SelectedCircle][0] - for i = 0, 6 do - self.Circles[self.SelectedCircle][i]=self.Circles[self.SelectedCircle][i+1] - end - self.Circles[self.SelectedCircle][7] = tmp - self.Animateingringnum = -1 - self.Animateingdirection = 0 - --Add the new dot in, or fail if we can't - if(self.Circles[self.numcircle-1][self.NextInputDirection] != 0) then - print("self fail :(") - self.Score = 0 - self.scoreboard:Remove() - else - self.Circles[self.numcircle-1][self.NextInputDirection] = self.NextInputColor - self.NextInputDirection = math.Round(math.random(0,7)) - self.NextInputColor = math.Round(math.random(1,self.MaxColor)) - end - self.ProcessMoved(self) + if(self.Animateingringnum != -1 and CurTime() > self.Animateingstart+self.ANIMATE_MOVEING_DURATION) then + if(self.Animateingdirection == 1) then + local tmp = self.Circles[self.SelectedCircle][7] + for i = 0, 6 do + self.Circles[self.SelectedCircle][7-i]=self.Circles[self.SelectedCircle][6-i] + end + self.Circles[self.SelectedCircle][0] = tmp + self.Animateingringnum = -1 + self.Animateingdirection = 0 + --Add the new dot in, or fail if we can't + if(self.Circles[self.numcircle-1][self.NextInputDirection] != 0) then + print("self fail :(") + self.Score = 0 + self.scoreboard:Remove() + else + self.Circles[self.numcircle-1][self.NextInputDirection] = self.NextInputColor + self.NextInputDirection = math.Round(math.random(0,7)) + self.NextInputColor = math.Round(math.random(1,self.MaxColor)) + end + self.ProcessMoved(self) + elseif(self.Animateingdirection == -1) then + local tmp = self.Circles[self.SelectedCircle][0] + for i = 0, 6 do + self.Circles[self.SelectedCircle][i]=self.Circles[self.SelectedCircle][i+1] + end + self.Circles[self.SelectedCircle][7] = tmp + self.Animateingringnum = -1 + self.Animateingdirection = 0 + --Add the new dot in, or fail if we can't + if(self.Circles[self.numcircle-1][self.NextInputDirection] != 0) then + print("self fail :(") + self.Score = 0 + self.scoreboard:Remove() + else + self.Circles[self.numcircle-1][self.NextInputDirection] = self.NextInputColor + self.NextInputDirection = math.Round(math.random(0,7)) + self.NextInputColor = math.Round(math.random(1,self.MaxColor)) end + self.ProcessMoved(self) end elseif(self.AnimateFalling and CurTime() > self.AnimateFallingStartTime + self.ANIMATE_FALLING_DURATION) then for k,v in pairs(self.AnimateFallingColumnNum) do @@ -285,7 +283,7 @@ end --What to do when anything moved Game.ProcessMoved = function(self) - PrintTable(self.Circles) + PrintTable(self) if(self.Circles == nil) then print("OH NO, CIRCLES WAS NIL!") return |
