Wednesday, September 19, 2012

Pong Mod - Individual Project

For my individual Pong mod, I created a field of red and blue circles between the two paddles.  The paddles are also now colored either red or blue.  Clicking the mouse changes the player one paddle color.  Pressing the alt key changes the paddle two color if playing in two player mode.  As the ball passes through the circles it takes on the color of the circles.  The paddle must be the same color as the ball in order to deflect it.  If the paddle is a different color from the ball, the ball simply passes through it. 

Click here to play this Pong mod.  

The circles are randomly generated using code similar to the randomly generated squares from the group Pong mod.  Where I used one for loop to generate a line of squares, here I used two for loops to create a grid of circles.  Plugging randomly generated numbers into the for loops breaks up the grid into a more interesting mess of circles. 

Unlike the squares (which were hidden for a time and then revealed with a new random color), the circles are destroyed when the ball passes through them.  The destruction of a circle triggers another piece of code that creates a new circle after a few seconds in a random place.  The reason for the two different methods is that I wanted to squares to always appear in the same line, and the circles to be more unpredictable.  Not destroying the squares was the easiest way to store the screen position.  Since nothing of the original circle would be needed for the regenerated circle, it made sense to just destroy the original and create a new one.

Mod game logic:

  • Same rules as regular pong plus below
  • Circles pass their color on the ball
    • Circle disappears
    • New circle appears after a few seconds
  • Players can switch between two paddle colors
  • If the paddle and ball colors match, the ball is deflected
  • If the paddle and ball colors do not match, the ball passes through the paddle



Tuesday, September 18, 2012

Group Project - Pong Mod


 For our pong mod my two teammates and I created element effects that are transferred to the paddle from the ball.  The ball picks up the elemental effect when it passes through the row of squares in the center.  The color of the square determines the effect.  Red is for fire; yellow for lightning; and blue for ice.  White has no effect.

Fire:  Creates fire particles and causes the paddle to spin.
Ice:  Causes the paddle to slide to the side when the player stops moving the mouse.
Lightning:  Causes the paddle to vibrate.

My contributions were the lightning effect and the randomly generated line of squares in the center.

Click here to play the game  (ice currently is not compatible with Unity web player)'

In our initial meeting I put forth the idea of placing objects between the paddles which would change the color of the ball (which is also the idea I developed in my individual mod).  Brian had an idea of creating various types of paddles that would simulate various player characters (like the different types of player characters in Team Fortress 2).  Chloe expanded and combined our two ideas into a series of bricks between the paddles that confer effects on the ball which are passed on to the ball.

We settled on elemental effects because they map well to colors and provide an easily understandable framework for the player.  The rows of bricks were reduced to a single row to avoid clutter or confusion. 

Mod game logic:
  • Same rules as regular pong plus below
  • Ball "picks up" one of the blocks between the two players
  • The block transfers its color to the ball
  • Depending on the ball color, the paddle takes and effect or not
    • Red - the paddle spins 6 turns
    • Yellow - the paddle shakes for 4 seconds
    • Blue - the paddle slides for 4 seconds
  • Blocks regenerate as random colors after a certain amount of time