1. 01 Jan, 2017 11 commits
    • Terence Martin's avatar
      Use constant for billboard delay time · 0e059a59
      Terence Martin authored
      This seems nicer than hard coding it; it's easier to either change all
      values, or find places where specific billboards are waiting so that
      we can change them.
      
      Might be interesting to make a duration property on the Billboard
      entity and then have it set as part of the show() method and queried.
      
      Then we could say:
          this._billboard.show ("text", 35);
          if (this._state.hasElapsed (this._billboard.duration))
              this._billboard.hide ();
      
      To track per billboard timings.
      0e059a59
    • Terence Martin's avatar
      Display Billboard for no moves left · 9a60aade
      Terence Martin authored
      When either player has no moves left (which includes at the end of the
      round), we display a billboard to say that.
      
      Like the change for the start player announcement, this uses the next
      state to store where to go next, and like the final ball drop we go
      into another state to wait out the billboard timer.
      9a60aade
    • Terence Martin's avatar
      Display Billboard for the final ball drop · 1e98d8e7
      Terence Martin authored
      In this case we need to add a different state that is just for the
      billboard, since we keep returning back to the final drop state after
      ever final ball finishes dropping.
      1e98d8e7
    • Terence Martin's avatar
      Display Billboard for gray brick removal · e655fbbc
      Terence Martin authored
      Like what we did for the blocked ball removal, only this time for the
      gray bricks being removed.
      e655fbbc
    • Terence Martin's avatar
      Display Billboard for blocked ball removal · 50785b67
      Terence Martin authored
      Now when we are going to remove blocked balls, we wait for a moment
      and display a billboard so that the player knows what's about to
      happen, since it happens so fast.
      50785b67
    • Terence Martin's avatar
      Display Billboard for start player · b00e7dae
      Terence Martin authored
      At the start of the round, we display a billboard that tells the
      player who is starting first, so that they don't get all weirded out
      when the computer starts playing first.
      b00e7dae
    • Terence Martin's avatar
      Add next state to StateMachine · 68c15a88
      Terence Martin authored
      This allows the StateMachine to store a state in the state machine for
      later when it knows now what the state should be a short time from
      now.
      
      This saves having to have a bunch of extra variables to do this.
      68c15a88
    • Terence Martin's avatar
      Display Billboard for start of round · fb4f1af5
      Terence Martin authored
      This displays the text that indicates what round of the game is about
      to start. This is followed by the maze generation which kicks off the
      rest of the game as per usual.
      fb4f1af5
    • Terence Martin's avatar
      Include Billboard entity · 58911546
      Terence Martin authored
      This is a simple entity which has a visibility state and can easily
      display some text in a known font in the center of the screen.
      
      This will be used to tell the user what's going on as the various
      parts of the game play out.
      58911546
    • Terence Martin's avatar
      Fix timing on ball lerping animations · 1966abf7
      Terence Martin authored
      Instead of having the code that vanishes the ball half vanish it with
      a short animation, then lerp the ball while playing another animation,
      we instead vanish directly but apply the lerp right away as well.
      
      This way the score updates roughly at the same time as the ball
      arrives there, which makes for a nicer visual look.
      
      In the case of a blocked ball this is not entirely true, but the score
      is only updating a few frames early and there are a lot of that going
      on all at once, so it blends and fools the eye.
      1966abf7
    • Terence Martin's avatar
      Fix adding balls in debug mode · 71e5cb40
      Terence Martin authored
      I overlooked how the new keyboard shortcut for toggling between player
      and computer balls blocks you from being able to add a ball in debug
      mode.
      71e5cb40
  2. 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.
      3fb04d59
    • 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.
      e425b5b3
    • 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.
      a722e4f7
    • 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.
      f1c61522
    • 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.
      cd46bc90
    • 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.
      4ebf8b75
    • 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.
      e8a1a969
    • 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.
      d3ba6864
    • 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.
      48b264c2
    • Terence Martin's avatar
      Set up replay properly · a6da0704
      Terence Martin authored
      This properly replays the last played game using some new GameState
      functionality.
      a6da0704
    • 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.
      ebcecd11
    • 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.
      4904b16a
  3. 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.
      f512c9e8
    • 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.
      e1ac9f03
    • 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.
      4053715d
    • 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
      state.
      
      This also makes sure that the automatic arrows generate during maze
      generation if this is the last round of a multi-round game.
      04943718
    • 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.
      ce3f0bb8
    • 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
      generation.
      b9fdd5b2
    • 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.
      028b7eec
    • 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.
      f887e42e
  4. 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.
      437fa4d8
    • 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.
      336736d5
    • 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.
      17284159
  5. 28 Dec, 2016 6 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.
      770002c1
    • 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.
      ef9e9917
    • 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.
      517aaf44
    • 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.
      a51f866a
    • 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.
      be1798e4
    • 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.
      056d8c83