1. 01 Jan, 2017 1 commit
    • 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
  2. 30 Dec, 2016 2 commits
    • 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
  3. 28 Dec, 2016 5 commits
    • 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
    • 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.
      7d2bfa79
  4. 27 Dec, 2016 2 commits
    • 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.
      2e2bb546
    • 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
      line.
      6f1de1c6
  5. 23 Dec, 2016 1 commit
    • Terence Martin's avatar
      Replace ball swapping with direct dropping · 1fffad2a
      Terence Martin authored
      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.
      1fffad2a
  6. 21 Dec, 2016 3 commits
    • Terence Martin's avatar
      Fix bug in MazeContents · f37c720c
      Terence Martin authored
      In favor of pasing a parameter to the swap function that swaps balls
      between the computer and the player that says if it should save the
      ball state or not, instead allow setting the visible ball state to
      clobber the existing ball row.
      
      This will be futher enhanced in the immediate future, but this causes
      a problem in that we want the player balls to be visible first, but
      because that is the default, the swap function swaps them and displays
      the wrong one.
      f37c720c
    • Terence Martin's avatar
      Fix ball visiblity during generation and swaps · 59c03a4a
      Terence Martin authored
      Now when balls are generated, they are generated hidden. Saving the
      balls to the appropriate array in the MazeContent class hides them and
      restoring them shows them again.
      
      This means that when we swap balls, we automatically hide and show
      everything as needed.
      59c03a4a
    • Terence Martin's avatar
      MazeGenerator now generates dual sets of balls · 05ae7e09
      Terence Martin authored
      When the maze is generated, we now fill out the generated balls into the
      appropriate arrays and then restore the default ones to the top row,
      which gets everything ready to go.
      05ae7e09
  7. 15 Dec, 2016 1 commit
    • Terence Martin's avatar
      Refactor Maze generation · f0224daa
      Terence Martin authored
      This shifts the code that generates the maze into its own class, which
      shortens up and clarifies the Maze code itself and also makes it
      easier to tweak generation in the future, since it will be self
      contained.
      f0224daa