Conditional Execution & Games • Presenter: • Researchers: • “Some witty game quote here” Goals & Outcomes • Understanding & Practice with: • • • • • • Single IF structures Single, Sequential IF structures Single IF/ELSE (with default else) Chained IF/ELSEIF (with no default else) Chaind IF/ELSE (with default else) Switch/Case stuctures If FlowChart Game Goals & Outcomes • Same as the typical CS1 class, but with different: • Pros • Examples • Content • Motivation • Cons • Setup • Length • Complexity Summary of Lab Activities Start Did the user press left on the keyboard? False End Single IF Flowchart True Move paddle left: paddle.moveLeft(); Building Custom Versions of SmaceSmasher • After the lab is complete, look at the assignment • What about a version of this game that moves in both the x and y axis? • Or, what about a version of this game that uses two paddles and is two player? SpaceSmasher Assignment • Build 3 custom versions of the SpaceSmasher game • Version 1: UpDownLeftRightSmasher • Build a version of the game that allows the paddle to move up, down, left and right • The player can get closer to or farther away from the blocks they intend to break • What happens if the player runs into a block? • See Demonstration SpaceSmasher Assignment • Version 2: Student’s Choice • Add any feature or change to this game to make it different and custom • Requirement: you must use an IF structure in your work (which would be hard not to do) SpaceSmasher Assignment • Version 3 of SpaceSmasher: UpDownSmasher • Build a version of this game that positions the paddle on the left of the screen, and allows the user to control only up and down on the paddle • Note that this changes the “gutter” area where the player loses a life from the bottom part of the screen to the left part of the screen • See Demonstration
© Copyright 2026 Paperzz