1. 31 Dec, 2016 12 commits
    • Terence Martin's avatar
      Use lerping in the score · 3fb04d59
      Terence Martin authored
      Finally all of the commits come together.
      Now when a ball has stopped moving and is going to be going away,
      instead of vanishing it, we use the new score start animation, which
      is a partial animation that shows the ball starting to vanish.
      Once that animation finishes (with the ball still half visible), we
      trigger the callback, which scores the ball, telling it to lerp to the
      location where the associated score is being displayed and also finish
      the vanish.
      The result is that the ball starts to vanish and then flies over to
      the score, allowing a bit of a visual clue that you got points for
      that ball.
    • Terence Martin's avatar
      Refactor score rendering · e425b5b3
      Terence Martin authored
      This shifts the position of where the two score values are rendered on
      the stage to be point values instead of hard coded values.
    • Terence Martin's avatar
      Add partial vanish animations to the Ball entity · a722e4f7
      Terence Martin authored
      This adds two new animations that are meant to be used to allow an
      action to happen in the middle of a ball vanish. One of them starts
      the vanish and the other finishes it.
    • Terence Martin's avatar
      Give Ball a lerp ability · f1c61522
      Terence Martin authored
      This gives the ball the visual ability to alter it's position linearly
      from it's current location to a final destination. This is currently
      done over a predefined number of ticks, since we are going to use it
      for a specific purpose.
    • Terence Martin's avatar
      Add computer ball toggle · cd46bc90
      Terence Martin authored
      Instead of having keys to selectively view either ball set, on the
      player's turn they can press a key to view the computer balls instead,
      to evaluate what the computer can possibly do.
      This is handled as an extra state, so that when the computer balls are
      visible, the player cannot move or play a ball.
    • Terence Martin's avatar
      Randomly select the start player · 4ebf8b75
      Terence Martin authored
      After maze generation, instead of jumping directly to a state where we
      start the human player turn, we jump to a state where we randomly
      select who plays first and then transition to that state instead.
    • Terence Martin's avatar
      GameOver invokes update on previous scene · e8a1a969
      Terence Martin authored
      Since we're using the game scene rendering to draw the maze from the
      game over scene, also invoke it's update method so that the black
      holes will animate.
    • Terence Martin's avatar
      Reset player positions at round start · d3ba6864
      Terence Martin authored
      Ensure that at round start, the human player is at the far left and
      the computer is at the far right.
      This looks nicer visually than having the player start a new game or
      round from the last seen position.
    • Terence Martin's avatar
      Don't reset scores on maze generation · 48b264c2
      Terence Martin authored
      In a multi round game, this clears the score between rounds, which
      entirely defeats the purpose of a multi round game.
    • Terence Martin's avatar
      Set up replay properly · a6da0704
      Terence Martin authored
      This properly replays the last played game using some new GameState
    • Terence Martin's avatar
      Include a Game Over screen · ebcecd11
      Terence Martin authored
      This is also a take on the one from Devember 2015; here we display the
      game over text in the blank area at the top of the screen and allow a
      replay of the same game type as the last time or going back to the
      title screen.
    • Terence Martin's avatar
      Rename game scene · 4904b16a
      Terence Martin authored
      Rename the GameScene class to just be Game; that's what I normally do
      but in this case I appeneded the Scene name, which bothers me.
  2. 30 Dec, 2016 8 commits
    • Terence Martin's avatar
      Include a Title Screen · f512c9e8
      Terence Martin authored
      Yeah, this is also a rip from the Devember 2015 title screen, but it
      has the menu that does the stuff, so that's pretty good.
    • Terence Martin's avatar
      Include Menu and Pointer entities · e1ac9f03
      Terence Martin authored
      These are shamelessly ripped directly from Devember 2015. You know
      you do it too.
    • Terence Martin's avatar
      Log what kind of game is starting · 4053715d
      Terence Martin authored
      Just to make our debugging lives easier, include a log that allows us
      to see exactly what kind of game we're into.
    • Terence Martin's avatar
      Implement full rounds in Game state · 04943718
      Terence Martin authored
      Now when we enter the game state, we start in the begin round state,
      ensure that everything is reset, and then proceed into the game.
      The game starts in the begin round state, which checks to see if the
      game is over and either goes to the maze generation for this round or
      counts this as game over.
      At the end of the final ball drop we go to the end of round state,
      where we update the current round and then jump to the begin round
      This also makes sure that the automatic arrows generate during maze
      generation if this is the last round of a multi-round game.
    • Terence Martin's avatar
      Include new states for round bookends · ce3f0bb8
      Terence Martin authored
      This includes new states for the beginning and ending of a round, so
      that we can implement special logic to happen in those cases.
    • Terence Martin's avatar
      Include values for tracking rounds · b9fdd5b2
      Terence Martin authored
      This introduces a current round and maximum round to the game state,
      along with methods for resetting the game to a new start for a given
      number of levels, advancing levels, and seeing if it is the end of the
      game or not.
      This works such that a maximum level count of 0 or smaller counts as a
      single round game played with half balls. Any game that is more than a
      single round will report the last round condition when it's the last
      round, which can be used to turn on the automatic arrows in maze
    • Terence Martin's avatar
      Include generation option to use half balls · 028b7eec
      Terence Martin authored
      When this is enabled, only every other ball is generated into the top
      of the maze, instead of a ball in every column. This makes for an
      extra short game.
    • Terence Martin's avatar
      Fix debug wipe · f887e42e
      Terence Martin authored
      This one has been bugging me for a while; debug wipe of the maze does
      not reset the teleports since we modified the generation code. They
      keep their destinations but are not in the maze content, so you can't
      delete them.
  3. 29 Dec, 2016 3 commits
    • Terence Martin's avatar
      Unplug blocked exits to Teleport entities · 437fa4d8
      Terence Martin authored
      It is possible for a ball to exit a Teleport and then not be able to
      drop further. When this happens, the ball movement stops and the ball
      gets put back into the maze at the location of the Teleport exit.
      This clobbers the Teleport out of the maze at this location, although
      it still visually renders at this location because the render is based
      on destinations (they all share the same entity). This results in that
      being an "exit only" teleport; the ball can't enter the teleport there
      because it's not in the maze any longer.
      Now when we determine that we are about to drop the ball down, we
      check to see if the position that we're currently occupying is empty
      and also a destination in the single teleport entity.
      If this is the case, we can re-insert the teleport, which allows this
      location to be the source of a teleport operation again.
    • Terence Martin's avatar
      Enhance Teleport; select non-blocked destination · 336736d5
      Terence Martin authored
      This change adds to the Teleport entity the ability to ensure that the
      position that it returns in response to ballTouch() is a location to
      which the ball can be transported without blocking.
      This is done by conducting a pre-check to ensure that there is at
      least one valid destination to select, so that it won't loop forever
      if all of the destinations are blocked.
    • Terence Martin's avatar
      Include extra balls for testing purposes · 17284159
      Terence Martin authored
      In order to make debugging easier, we add a few extra balls to the
      pool instead of the exact number that we need. That way there are some
      left in reserve for adding to a level.
  4. 28 Dec, 2016 7 commits
    • Terence Martin's avatar
      Clear unplayed balls at the appropriate time · 770002c1
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Fix blocked player playing ball bug · ef9e9917
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Cleanup; remove redundant code · 517aaf44
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Change bonus brick generation to be per column · a51f866a
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Change gray brick generation to be per column · be1798e4
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Change arrow generation to be per column · 056d8c83
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Tweak black hole generation · 7d2bfa79
      Terence Martin authored
      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.
  5. 27 Dec, 2016 10 commits
    • Terence Martin's avatar
      Update game thumbnail · b6433ae9
      Terence Martin authored
    • Terence Martin's avatar
      Update Ball API to use new scores · 2e2bb546
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Score for blocked balls at round end · 6f1de1c6
      Terence Martin authored
      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
    • Terence Martin's avatar
      Score for balls at the goal line · 9213c393
      Terence Martin authored
      When a ball reaches the goal at the bottom of the screen (regardless
      of when this happens), score points for that ball.
    • Terence Martin's avatar
      Score for bonus bricks · 831ec388
      Terence Martin authored
      When a ball passes through a bonus brick during the regular game,
      apply a score change to the owner of that ball.
    • Terence Martin's avatar
      Update ball drop finished event handler · 9c54b987
      Terence Martin authored
      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
    • Terence Martin's avatar
      Add player property to Ball · 91733a2c
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Render scores and reset on maze generation · 9aed72e4
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Include code for tracking and rendering score · 2dc295c4
      Terence Martin authored
      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.
    • Terence Martin's avatar
      Include KenVector font · 1e2b7768
      Terence Martin authored
      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