Display of Objects on Screen
COUNTERS b A horizontal counter represents the horizontal position of the monitor’s electron beam. b A vertical counter represents the vertical position of the monitor’s electron beam. b The horizontal counter is incremented each clock cycle. b The vertical counter is incremented when the horizontal counter reaches 699.
Monitor Processing H_count V_count ELECTRON BEAM
OBJECTS b Objects Include Paddles, Ball, Lives, Blocks, etc. b Each object has fixed dimensions (Length and Width). b The location of an object is determined by its upper-left corner. b When the electron beam passes over an object, the color of that pixel is changed. b Paddle = white, Ball = green, block = multicolored, background = blue
Example - Draw a Ball b Ball Location: x = 300 y = 200 b Ball Size: width = 10 height =
Example - Draw a Ball b The horizontal counter is incremented. b The next pixel is drawn.
Example - Draw a Ball b Once the width of the ball has been drawn, the color is reset to blue.
Example - Draw a Ball b After the horizontal reaches 599, the vertical counter is incremented.
Example - Draw a Ball b After the 10th row is finished, the ball has been fully drawn.
“The End”