Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java Programming Session 2. Objectives To design a range of different blocks To create the code for these blocks To test that each block rotates correctly.

Similar presentations


Presentation on theme: "Java Programming Session 2. Objectives To design a range of different blocks To create the code for these blocks To test that each block rotates correctly."— Presentation transcript:

1 Java Programming Session 2

2 Objectives To design a range of different blocks To create the code for these blocks To test that each block rotates correctly To alter the code to select random blocks

3 Block Rotation 1 piece_Toppiece_Leftpiece_Bottompiece_Right

4 Block Rotation 2 piece_Toppiece_Leftpiece_Bottompiece_Right

5 Block Coding piece_Top { BLUE, BLUE, NONE }, { BLUE, NONE, NONE }, { BLUE, NONE, NONE } piece_Left { BLUE, BLUE, BLUE }, { NONE, NONE, BLUE }, { NONE, NONE, NONE } piece_Bottom { NONE, NONE, BLUE }, { NONE, BLUE, BLUE } piece_Right { NONE, NONE, NONE }, { BLUE, NONE, NONE }, { BLUE, BLUE, BLUE }

6 Fitting Blocks Together Remember that the shapes you make must fit together without leaving gaps Some shapes are more difficult to fit together than others Dont make a shape that will be impossible for the person playing the game

7 Tasks: Design a piece Modify the code Test the piece rotates well Keep doing this until you have lots of good pieces. Switch to random piece generation and try it out.


Download ppt "Java Programming Session 2. Objectives To design a range of different blocks To create the code for these blocks To test that each block rotates correctly."

Similar presentations


Ads by Google