1. 04 Aug, 2016 1 commit
  2. 02 Aug, 2016 3 commits
    • Terence Martin's avatar
      Alter level 5 to be less evil · 1fbc4737
      Terence Martin authored
      This changes Level 5 so that it is less evil now that red bricks take
      multiple hits and black bricks are invincible. There are now multiple
      paths into the core and the red bricks are fewer in number.
    • Terence Martin's avatar
      Add brick invincibility and score changes · 9c6dd229
      Terence Martin authored
      This adds a new property to bricks, which makes them invincible. For
      such a brick, modifications to the life value have no effect (and so
      you should make the brick invincible AFTER you set the life, if it
      This basically just blocks modifications to the life property of the
      brick so that it can never change.
      Additionaly, to reflect how much harder a brick is to destroy when it
      has more than a single point of life, we now apply the maximum life
      value of the brick as a multiplier to the score (prior to the ball
      speed multiplier being applied).
    • Terence Martin's avatar
      Include life display for bricks · 3cb987da
      Terence Martin authored
      This gives brick entities a notion of how much life they originally
      started with, so that as they take damage they can display an overlay
      image that indicates that they are damaged, so that the player knows
      that the ball hit them but more work is required to clear them out.
      In practice this is all handled behind the scenes; when the life value
      is modified, the internal damage state is updated as needed to make
      things display appropriately.
  3. 31 Jul, 2016 5 commits
    • Terence Martin's avatar
      Fix a bug in the brick life assignment, use life · 40c080fd
      Terence Martin authored
      There was a wee bug in the form of a switch with a lack of a break
      that made every brick have a single life, which is now fixed. Whoops.
      Additionally, crude life checking is now in place; bricks are only
      removed when their lives are 0, so red bricks take more time.
      This needs to be fleshed out to make bricks invincible by type and
      have a better life spec, but we're there.
      Also, a graphical overlay need to be applied to bricks that are
      "damaged" so that the player can tell what's happening.
    • Terence Martin's avatar
      Include ability to directly get collided brick · f743b72c
      Terence Martin authored
      This modifies the getBrick() method in the BrickGrid to return the
      actual brick entity, with the requisite changes to calling code.
      Additionally the brickAtColRow() method has been changed to be
      visibleBrickAtColRow() since that is actually what it is checking.
      It's a shorthand for checking that there is a brick and then also
      checking if the color is non-NONE.
    • Terence Martin's avatar
      Give bricks the notion of a life · 823439fe
      Terence Martin authored
      This is a simple "HP" value which indicates how many collisions are
      needed before the brick is actually removed from the grid.
      Currently the brick grid is hard coded to give 3 life to all red
      bricks and 1 life to everything else (except empty bricks).
    • Terence Martin's avatar
      Integrate the new Brick entity · c07db583
      Terence Martin authored
      This ties the new brick entity in using the existing logic for brick
      handling. This is the first step to making this part of the system
    • Terence Martin's avatar
      Include new Brick entity · 915fbba4
      Terence Martin authored
      This is not compiled yet, but it is the basic entity we'll need to
      wrap a brick.
      Essentially this is just an entity wrapper that will render itself
      based on an exposed color property.
  4. 21 Jul, 2016 4 commits
  5. 20 Jul, 2016 1 commit
    • Terence Martin's avatar
      Include the beginnings of a level creation system · 3946f8a3
      Terence Martin authored
      There are now some types dedicated to the layout of a level in the
      game, along with the support code needed. A brick layout can be
      optionally passed to the reset() method of BrickGrid to use the bricks
      from that grid instead of using the default layout.
      This takes the simple tack of using strings of a single length to
      represent colors of bricks. This can be part of the type, although
      sadly the length of the arrays (to ensure the width and height are
      correct) cannot be so specified.
      Instead, the code makes sure that any extra columns or rows are thrown
      away and that any left over grid space is initialized with empty
      This works well for rows but not as much for columns, as if the
      columns are too short, that's more problematic.
      I've taken the approach of using the data as it comes, so that if the
      number of columns is short, the data from the next row will finish
      this row before starting into the next row. This means that we can do
      things like have one row missing a column if the next row has an
      It's probably very hard to visualize how that would look, so I would
      suggest being more smart about it.
  6. 07 Jul, 2016 10 commits
    • Terence Martin's avatar
      Remove the GameOver scene rendering mute icon · 20ab606d
      Terence Martin authored
      I forgot that the GameOver scene uses the Game scene for most of it's
      background rendering, and so there is no need for it to render the
      mute  state icon because that's already happening.
    • Terence Martin's avatar
      Include notes on the next exercise · 2ccd5be3
      Terence Martin authored
    • Terence Martin's avatar
      Update the ToDo to mark task 11 as done · 15b0bea9
      Terence Martin authored
    • Terence Martin's avatar
      Include attribution for new icons · 2fb9d409
      Terence Martin authored
      There is no boilerplate on game-icons.net for this so I just
      duplicated what is currently being used for the music from
    • Terence Martin's avatar
      Include a graphical mute state image · d47a8973
      Terence Martin authored
      This includes a new sprite sheet for a simple icon that shows a
      speaker either making noise or not, and uses it along with a global
      function to render the appropriate sprite depending on the current
      state of music mute.
      This is just proof of concept (maybe too big, maybe only show it when
      muted, maybe more translucent?) so I'm going to leave it as is even
      though it kind of bothers me that it's a speaker and not a musical
      note so you might think it represents all sounds even though it only
      represents music.
    • Terence Martin's avatar
      Include controls for mute · 743ca6cb
      Terence Martin authored
      The new mute controls are now mentioned in the controls page on the
      embedding web page.
    • Terence Martin's avatar
      Include persistent mute state for music · 208d7612
      Terence Martin authored
      There is now a global boolean that indicates if music should be played
      or not, and this is respected on scene changes and at mute state toggle
      points (i.e. pressing the M button).
      While muted, changing scenes does not start music playing, but toggling
      the state of mute will, and vice versa.
      The state of the mute flag is stored in local storage if possible so
      that it persists across runs.
    • Terence Martin's avatar
      Include initial music support · 1e1014c8
      Terence Martin authored
      Unlike our previous offerings, this is coming more along as a better
      music implementation.
      The game music is now all global and preloaded by main before the game
      starts, and is accessible by anywhere. Each scene can now start its
      own music playing when it gets activated and stop it when it gets
      There is currently no muting support, but this is the cleanest that
      the music has looked so far.
      In addition to the music changes, attribution for the music is now
      added to the html file, including for the Public Domain music that is
      used on the title screen.
    • Terence Martin's avatar
      Include some sounds and events for them · 543c2346
      Terence Martin authored
      We now support several sounds; gaining and losing a life, as well as
      unique ball collisions with the paddle, the walls and bricks.
      Additionally, the BallListener event API has been extended to include
      new events so that the Game scene can accurately play a sound of the
      required type when the required thing happens.
      Currently there is no event for collision with a brick because the way
      the code is currently implemented the game scene asks the ball if
      there is a brick collision, and handles it if there is, so there is
      no need for the ball to give that information back.
    • Terence Martin's avatar
      Fix some broken help messages in convert scripts · be568a70
      Terence Martin authored
      Sometimes copy and paste gets the best of us, you know?
  7. 30 Jun, 2016 8 commits
    • Terence Martin's avatar
      Mark exercise 10 as complete · 3981956f
      Terence Martin authored
    • Terence Martin's avatar
      Display the score of the next free life · 1358eabd
      Terence Martin authored
      We display the score that the next life will be awarded at; this is
      always displayed at a location that is right aligned on the screen, so
      it is pre-calculated whenever the target score changes.
    • Terence Martin's avatar
      Implement extra lives by score · e85262e7
      Terence Martin authored
      The game scene now tracks what score is needed to get a free man,
      which increases as a set interval. This hooks into code from the
      previous commits in order to blink the new life icon when it appears.
    • Terence Martin's avatar
      Include the ability to blink the first life icon · 02b79e38
      Terence Martin authored
      As a run-up on being able to indicate that a new life has been awarded
      we have the ability to blink the first life icon for a little bit. The
      idea is that it will blink when you gain a life to call attention to
      the fact.
      Once sound is implemented, that will also be an indication.
    • Terence Martin's avatar
      Constrain how many lives to display at most · 4d9ecf22
      Terence Martin authored
      This modifies the rendering for the number of lives left so that if
      there are more than a set amount, the extras do not render, thus
      constraining the display to a set amount.
    • Terence Martin's avatar
      Mark exercise 9 as complete · dfe907e7
      Terence Martin authored
    • Terence Martin's avatar
      Add back ball>paddle speed restriction · 7aad8f69
      Terence Martin authored
      It bothered my delicate sensibilities that the ball speed could speed
      up and slow down between brick and paddle collisions as a result of
      the speed change slowing down the inherent speed set by a paddle
      collision that does not compentate.
      As such, that change is back in, and for some reason it seems to work
      just dandy now; perhaps my other test code was doing something wonky?
    • Terence Martin's avatar
      Remove BrickGridInterface · cf4062cb
      Terence Martin authored
      Further inspection shows that for the paddle I was already just
      passing a paddle entity, so I might as well do that for the brick
      grid, right?
  8. 29 Jun, 2016 4 commits
    • Terence Martin's avatar
      Ball speed and score multiplier · cb86d4d6
      Terence Martin authored
      Now the ball speed kicks up on every 4th row impacted (each brick in
      the row, not just hitting that row). Additionally, there is also a
      speed increase whenever the ball impacts a pink brick.
      THere is now a score multiplier attached to the speed of the ball
      where faster == more multiplier, to reward a longer volley.
      Losing a ball causes the speed to reset.
    • Terence Martin's avatar
      Refactor the ball>brick collision code · 21b479c9
      Terence Martin authored
      The ball now reports the brick grid position of a collision with the
      brick grid (and modifies it's velocity accordingly) and then passes
      the brick location back.
      This allows the game code to know where the collision actually happend
      for speed increase purposes. This means that it is now the game code
      that is reponsible for removing the bricks, which means that it can
      handle special bricks now (later).
    • Terence Martin's avatar
      Modify bounds of paddle · 1f400cb9
      Terence Martin authored
      Since the ball now always starts at the center of the paddle, set up
      the bounds of the paddle so that it can move all the way to the
      extents of the screen again.
      This is just a visual improvement for the most part, but it does also
      add back a small measure of ball control by not artificially
      contraining the place where the ball can impact the paddle (as much).
    • Terence Martin's avatar
      Change ball launching · 8ef88423
      Terence Martin authored
      Make the ball always be centered on the paddle on serve, instead of a
      random position along its length.
      Instead, the ball now launches in a random arc from the paddle from
      210 to 330 degrees.
  9. 28 Jun, 2016 4 commits
    • Terence Martin's avatar
      Fix a problem with ball speed changes on paddle · 5d9b12c3
      Terence Martin authored
      The change a few commits back that forced the ball speed to remain
      constant when colliding with the paddle has been reversed out with an
      explanatory comment.
      In short, this causes problems because when the ball start going at a
      steep horizontal angle, if the speed is not left as it it makes the
      ball move almost excruciatingly slow and it's hard to hit it such that
      it starts moving in any way but more and more horizontal.
      Going forward, the speed of the ball will be left alone in this case
      and instead the ball speed increase (when it happens) will be a
      multiplier on the current speed at the time that things happen.
      This will allow for a more dynamic experience.
    • Terence Martin's avatar
      Clean up rendering · 90821f98
      Terence Martin authored
      This cleans up our rendering a bit.
      Firstly, the BrickGrid no longer exposes a renderOffset property, and
      instead sets it's own position to take the renderOffset into account.
      This means that external code can obtain the renderOffset by (more
      naturally) asking the grid for its position.
      Secondly, the grid is now added as a regular entity instead of getting
      its render method called separately, which makes the game render code
      a little nicer to look at. This also means that the grid rendering
      code can actually use the position it was provided instead of ignoring
      Lastly, the paddle has a visibility paramter which tells its render
      method if it should do anything or not. This allows the game code to
      turn off the paddle when the game is over so that it doesn't display
      on the game over screen while the game scene is being a proxy and
      displaying the brick grid.
    • Terence Martin's avatar
      Remove constant for brick size · 96e1239a
      Terence Martin authored
      As is appropriate, the size of bricks is now taken directly from the
      sprite sheet that provides the images instead of being hard coded.
      This was not possible before due in large part to laziness but more
      importantly lack of isolation.
    • Terence Martin's avatar
      Reposition some lamba methods · d4f64891
      Terence Martin authored
      The current TypeScript syntax from the TypeScript support plugin by
      Microsoft is broken in that when a lamba method is seen, the rest of
      the syntax hilighting becomes broken.
      Among other things (ugliness being one) this also breaks the ability
      to jump to a symbol using Ctrl+R.
      The workaround (since they don't seem overly interested in fixing
      their syntax) is to put such methods at the bottom of the class, so
      that the break doesn't hurt anything else.