devember-2016:Day27 commitshttps://gitlab.com/OdatNurd/devember-2016/commits/Day272016-12-28T05:55:33Zhttps://gitlab.com/OdatNurd/devember-2016/commit/770002c12ee6777cf8302b7209714ebc0502f2b6Clear unplayed balls at the appropriate time2016-12-28T05:55:33ZTerence Martinpoindexter@nurdz.com
This ensures that if any balls are unplayed for either player (due to
being blocked), they are visually removed from the screen while all of
the blocked balls are being removed, so that they don't remain just
dangling there at the end of the run.https://gitlab.com/OdatNurd/devember-2016/commit/ef9e99179e03bb69cbc497b0d9ce0fced719f49aFix blocked player playing ball bug2016-12-28T05:43:05ZTerence Martinpoindexter@nurdz.com
This is the bug where the player can try to push the ball while its
blocked and it still works. This would get things all out of sync
and mess everything up.https://gitlab.com/OdatNurd/devember-2016/commit/517aaf44e38089c8c8a09961eb524733aadd4cc7Cleanup; remove redundant code2016-12-28T05:34:39ZTerence Martinpoindexter@nurdz.com
This removes some methods that used to be used to generate randomly
selected columns and rows. Now each method does this on their own,
so that they can customize the range if they want to.https://gitlab.com/OdatNurd/devember-2016/commit/a51f866a4f095f61c3461162b500c46d2bbf714fChange bonus brick generation to be per column2016-12-28T05:33:39ZTerence Martinpoindexter@nurdz.com
This works the same as the gray brick code. In fact, so similar that
it seems like I should actually make that one method that does both.https://gitlab.com/OdatNurd/devember-2016/commit/be1798e4388c23e269c3368bc2476360fd58bdf4Change gray brick generation to be per column2016-12-28T05:26:21ZTerence Martinpoindexter@nurdz.com
This now works the same as the arrow generation, although we now
possibly have no gray bricks in a column, where an arrow always has
at least one.https://gitlab.com/OdatNurd/devember-2016/commit/056d8c83c28c7ea5d5a07d63ef0b9ac8a35fa49bChange arrow generation to be per column2016-12-28T05:13:34ZTerence Martinpoindexter@nurdz.com
We now generate arrows by column instead of by row. This makes for a
more pleasing layout, as it ensures that the arrow are a bit less
clumpy and that there are no paths through the maze that don't take a
weird circuitious route.https://gitlab.com/OdatNurd/devember-2016/commit/7d2bfa799c042f2fefb44309628ccbd9fc1d0c99Tweak black hole generation2016-12-28T04:40:48ZTerence Martinpoindexter@nurdz.com
We now generate the black holes into a narrower band in the maze
content area; they will not populate near the top or bottom of the
grid, and they won't spawn next to the walls.
Additionally, the range between them has been extended a tile and we
ensure that there is only ever a single teleport per column at most,
to maximize the chaos of the ball jumping around in the maze.https://gitlab.com/OdatNurd/devember-2016/commit/b6433ae9a407c6660487511faec92b17ae42cf14Update game thumbnail2016-12-27T06:10:47ZTerence Martinpoindexter@nurdz.comhttps://gitlab.com/OdatNurd/devember-2016/commit/2e2bb54605de70db5996d8967f0a730c2e6a5dbfUpdate Ball API to use new scores2016-12-27T06:08:31ZTerence Martinpoindexter@nurdz.com
Now that the values for the scores are in place, the AI code has been
modified to use the proper values during it's evaluation process.https://gitlab.com/OdatNurd/devember-2016/commit/6f1de1c6f6ee973c5fc3175c990da481a97876ebScore for blocked balls at round end2016-12-27T06:05:50ZTerence Martinpoindexter@nurdz.com
Score partial points based on ball position whenever a ball is
vanished during the game without it having reached the goal line. This
can happen when a ball is blocked and removed before the final ball
drop, or when the final ball drop does not end the ball at the goal
line.https://gitlab.com/OdatNurd/devember-2016/commit/9213c393848bde50ab3ee52c26cb8ac2361707d9Score for balls at the goal line2016-12-27T05:59:27ZTerence Martinpoindexter@nurdz.com
When a ball reaches the goal at the bottom of the screen (regardless
of when this happens), score points for that ball.https://gitlab.com/OdatNurd/devember-2016/commit/831ec3886572710273eac300530b3061748d3442Score for bonus bricks2016-12-27T05:54:27ZTerence Martinpoindexter@nurdz.com
When a ball passes through a bonus brick during the regular game,
apply a score change to the owner of that ball.https://gitlab.com/OdatNurd/devember-2016/commit/9c54b98706febe9ab165fdf7f36feaae18c36bceUpdate ball drop finished event handler2016-12-27T05:48:10ZTerence Martinpoindexter@nurdz.com
The ballDropComplete() handler now takes a boolean flag that indicates
if this ball drop was finalized as part of a regular ball drop (false)
or a final ball drop (true).
This allows us to apply score to the ball when it stops, if we need
to.https://gitlab.com/OdatNurd/devember-2016/commit/91733a2ce1a28564164412f005387eba3d320958Add player property to Ball2016-12-27T05:41:45ZTerence Martinpoindexter@nurdz.com
This gives the Ball the ability to return what player owns it based on
its own type. This will be used during the score modifications to
determine who gets the points.https://gitlab.com/OdatNurd/devember-2016/commit/9aed72e4cb4b45698e3ac9eeb892288ad3d0a535Render scores and reset on maze generation2016-12-27T05:40:51ZTerence Martinpoindexter@nurdz.com
This will need to be tweaked when we have multiple rounds, but it's
good enough for now.
The scores are unadorned, but are enough for us to be able to track
what is going on.https://gitlab.com/OdatNurd/devember-2016/commit/2dc295c40a45f0f6b3bd2a028397c9070701078eInclude code for tracking and rendering score2016-12-27T05:37:05ZTerence Martinpoindexter@nurdz.com
This includes the global game state routines and values that will be
used to track the score, alter it, and render it to the screen.https://gitlab.com/OdatNurd/devember-2016/commit/1e2b77680fc3bf7ab21bf4600178d46ca712c250Include KenVector font2016-12-27T05:35:50ZTerence Martinpoindexter@nurdz.com
This is freely available and my font of choice for nice looking
monospace text.
This font is set as the default font at a set size upon activation of
the game scene, so that we don't have to keep swapping it into the
context.https://gitlab.com/OdatNurd/devember-2016/commit/ff660aec3583d7ab6510f7841ad14a008fe35889Make maze regeneration a debug key2016-12-27T05:15:56ZTerence Martinpoindexter@nurdz.com
This should only happen while in debug mode, not during game mode. If
you're trying to play a game to test and you press the key by mistake,
it's the sad maker.https://gitlab.com/OdatNurd/devember-2016/commit/0d43c88af12710429328dd2f8c48b4c1c8ee99daRefactor final ball drop flag setting2016-12-27T05:03:40ZTerence Martinpoindexter@nurdz.com
Instead of code needing to remeber to set the flag to some value, we
now just make it a parameter to the drop function.https://gitlab.com/OdatNurd/devember-2016/commit/5e7cb088edd1e72e8302726f34461dc484d326f9Fix drop ball bug introduced yesterday2016-12-27T04:58:56ZTerence Martinpoindexter@nurdz.com
Yesterday I introduced some new code where we could detect a vanished
ball but not trigger the notification that a ball drop was complete if
the ball was being vanished due to it being a blocked ball.
This was a bit flawed but unfortunatey I didn't notice it until it was
too late. Basically it would not trigger for a ball that vanished
because it got to the goal, because I used the wrong variable to track
if the event should trigger or not (_droppedBall instead of
_lastDroppedBall) and since _droppedBall gets cleared as soon as the
vanish is called, such a ball is treated like a blocked ball.
This has been fixed by using the correct variable.https://gitlab.com/OdatNurd/devember-2016/commit/f3d4974f97e0d2c1d7c42cfb3fc2dd4b9f9a37a2Add a new event for removing blocked ball2016-12-26T05:37:02ZTerence Martinpoindexter@nurdz.com
This adds in a new event that tells us when a blocked ball is being
removed (happens once when the ball is told to vanish).
This can be used to add blocked balls to the final score when that
happens.https://gitlab.com/OdatNurd/devember-2016/commit/e71e3ed43996921af867761a7c4bffd68721b8e6Tweak the ball drop event2016-12-26T05:24:36ZTerence Martinpoindexter@nurdz.com
It no longer gets the boolean indication; this can be determiend by
the caller based on the map position of the ball when it stopped.https://gitlab.com/OdatNurd/devember-2016/commit/b7594275e9466b923537ea19229d05a85ad26bc8Fix bugs in blocked ball removal2016-12-26T05:20:11ZTerence Martinpoindexter@nurdz.com
This code went through several iterations, and so some things were not
in the correct order (e.g. null test AFTER other tests).
There was also an issue where a vanished ball would trigger the ball
drop complete method and then throw an error because there is no
dropped ball, which I have currently patched away but this needs to be
handled better.https://gitlab.com/OdatNurd/devember-2016/commit/cacdab8a3d61008478809713803a162f4f963a75Implement ball removal state2016-12-26T04:51:16ZTerence Martinpoindexter@nurdz.com
This hooks into the previously created method and will continuously
try to remove blocked balls from the maze until the method tells it
that there are no further balls to remove and all that were removed
are now done with.
We skip to this state when all plays are exhausted and then to the
remove gray bricks state once this is completed.https://gitlab.com/OdatNurd/devember-2016/commit/416c2951c4f73899a5603b645f6cded21e280832Add a state for the new ball removal2016-12-26T04:25:08ZTerence Martinpoindexter@nurdz.com
Adds in a new state for the purposes of handling when we are removing
all blocked balls from the maze.https://gitlab.com/OdatNurd/devember-2016/commit/d9bc2a01dce3ad3fd9b93df5e47031057a30b7f1Include method to find and vanish blocked balls.2016-12-26T04:22:18ZTerence Martinpoindexter@nurdz.com
This will be used during end game, just prior to vanishing all of the
gray bricks and dropping the final balls.
We want to be able to find all balls that have no chance of moving
because they are either stopped on an arrow, or stopped on top of a
ball waiting on an arrow, and then remove them away like the gray
bricks do.https://gitlab.com/OdatNurd/devember-2016/commit/cd98210160f5803c68d0febc51aabea7748cef07Hide players before final ball drop2016-12-25T05:37:53ZTerence Martinpoindexter@nurdz.com
Now when we enter the phase for the final ball drop, we make sure that
the human and computer Player entities are hidden.https://gitlab.com/OdatNurd/devember-2016/commit/05a53006f8e0ea6de2759aea462f5d322c52d08fFix possible premature state change2016-12-25T05:35:52ZTerence Martinpoindexter@nurdz.com
The code for starting the next ball dropping in the final ball drop
was incorrectly only checking to see if a ball is hidden without also
checking to see if it's still actively hiding; fixed.https://gitlab.com/OdatNurd/devember-2016/commit/366ba91e5ab470495f5ea3d7802f772c5b16e29fClean up pushed ball marking2016-12-25T05:33:05ZTerence Martinpoindexter@nurdz.com
Now that we know the dropping of balls works for removing balls from
the two player arrays, remove the debug logging.
This was particulary annoying in that it would warn about pushing a
ball not in one of those arrays when the final ball drops were going
on.https://gitlab.com/OdatNurd/devember-2016/commit/c3da8655f4d4fce38fee0f0bcf3691cb4a2d6ccaFix final ball drop bug2016-12-25T05:28:22ZTerence Martinpoindexter@nurdz.com
It turns out that the reason for this failure was entirely because I
incorrectly stopped the search for balls to remove for being vanished
one column short of the edge.
This means that any final ball dropped in the last column of the maze
will vanish but not be reaped. Thus the flag for the ball being done
will never get set and everything stalls out.
Whoops.https://gitlab.com/OdatNurd/devember-2016/commit/d4a3f8177fd619b5bdaa2dd3fa1601899e5c5ffaAllow for the notion of no gray bricks2016-12-25T05:19:37ZTerence Martinpoindexter@nurdz.com
This is probably only of use when debugging, but as originally written
the code would get stuck and not be able to enter the final ball drop
if there are no gray bricks in the level because in that case there
are none to reap.
This is fixed by having the method that would normally remove such a
brick return false if there are none left to remove; when this happens
the code can immediately jump to the next phase.https://gitlab.com/OdatNurd/devember-2016/commit/4b35124412be8d42eb01bcadaa5d3d6d0417302bPut final ball drop under the control of states2016-12-24T05:32:50ZTerence Martinpoindexter@nurdz.com
This puts the final ball drop into the control of the state machine;
when we are in the final ball drop state, we select a ball and drop
it, and then return to this state once the ball is done.
There is currently a bug in this in which sometimes during the final
ball drop a ball (that is blocked?) starts dropping, but the flag that
says that it is done moving is not set.https://gitlab.com/OdatNurd/devember-2016/commit/1f9e5ca8d958674150410d0dcfd8396ae4ccc573Swap to final ball drop state when bricks gone2016-12-24T04:59:32ZTerence Martinpoindexter@nurdz.com
Now the maze will invoke a method on the listener to tell it that all
of the gray bricks have vanished out of the maze and have been reaped.
The Game state uses this to transition into the final ball drop state,
so that it can start the final ball drop of the round.https://gitlab.com/OdatNurd/devember-2016/commit/364531a8adfae33efc0d4c0eac89588eefd8a001Switch to removing gray bricks when no moves left2016-12-24T04:52:59ZTerence Martinpoindexter@nurdz.com
Now instead of swapping to the final ball drop state, we swap to the
state in which we remove all gray bricks. We handle this state by
using the state timer to slowly remove all of the gray bricks (telling
them to vanish).
Currently the code that reaps vanishing bricks is just spewing a
console log every time it knows all of the gray bricks are gone.https://gitlab.com/OdatNurd/devember-2016/commit/c0cd298d0375baf344897a85fdbfccd39c152208Clarify the usage of currently defined states2016-12-24T04:25:38ZTerence Martinpoindexter@nurdz.com
Now that we have a better idea of the exact flow that we're going for,
update the documentation comments for how all the states are used.https://gitlab.com/OdatNurd/devember-2016/commit/beb4c0db7c8a7d576d43dc918a372697de910decRemove Maze handling of removing gray bricks2016-12-24T04:15:59ZTerence Martinpoindexter@nurdz.com
The code in the Maze entity that tries to determine for itself if it
should remove all gray bricks has been removed. Now no gray brick
removal happens at all.https://gitlab.com/OdatNurd/devember-2016/commit/41bc2c3525b3cfbbb38b0defac720d5a7e02dea9Check that a play is possible before switching2016-12-23T05:57:21ZTerence Martinpoindexter@nurdz.com
We can now check to ensure that if it is to be a player's turn, that
there is a valid move for that player first. If not, we instead skip
to the next player's turn.
In the case that neither player has a valid move, we transition to the
state that handles the final ball drop, although currently that's not
how this state is handled.https://gitlab.com/OdatNurd/devember-2016/commit/86cba18816a6de71c9ebd02a62b7587e6fbcdb4dEnhance state machine2016-12-23T05:45:24ZTerence Martinpoindexter@nurdz.com
In order to handle some upcoming timing changes, make the state
machine aware of how long it has been in the current state so that we
can check it, knowing when to transition to another state or perform
an event at a set interval.https://gitlab.com/OdatNurd/devember-2016/commit/1fffad2ac835653d6a7f4fe65224e215379cb703Replace ball swapping with direct dropping2016-12-23T05:40:58ZTerence Martinpoindexter@nurdz.com
Originally, the MazeContent class would store an array that contained
the balls left to be played for both the human and computer player
along with a variable that indicated which of the two were currently
visible in the maze. We would then save the balls from the maze into
one array and restore from the other.
This actually causes a problem in that this gets the balls in the
array out of sync with reality if you don't swap right away.
For example, if the computer pushes a ball, then we check to see if
the human can play a ball and cannot (all blocked), then we check to
see if the computer can play to see if they can take another turn,
since we did not save the ball state and the check happens from the
array, it thinks it can play the ball it just played.
If that ball is the only ball that can be played, this gets us into
a situation where there is actually no move to be made.
Now we instead just restore from an array to the maze, and every time
a ball drops we check to see if it was in one of the arrays and remove
it from there, thus always keeping everything in sync.https://gitlab.com/OdatNurd/devember-2016/commit/bdde1e10eb07f7b74d996906c41d0acc738e22fbUpdate game thumbnail2016-12-22T06:32:25ZTerence Martinpoindexter@nurdz.com