1 / 27

GAME:IT Junior

GAME:IT Junior. BreakOut. Objectives:. Using old and new skills, develop a game similar to the original “BreakOut” Destroy blocks and gain points . Create a game that transitions from room to room, once all the blocks are gone. After 3 balls are lost, the game will end.

kami
Download Presentation

GAME:IT Junior

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GAME:IT Junior BreakOut Objectives: • Using old and new skills, develop a game similar to the original “BreakOut” • Destroy blocks and gain points. • Create a game that transitions from room to room, once all the blocks are gone. • After 3 balls are lost, the game will end.

  2. Before you start, you must go into “Advanced Mode”. Create 11 sprites for Game4. They are located in the Game4 Resources folder. NAME THEM AS INSTRUCTED. spr_paddle spr_ball spr_block_yellowspr_block_blue spr_block_green spr_block_hotpinkspr_block_orange spr_block_purple spr_block_red spr_wall spr_miss *All sprites should have the Precise Collision Checked

  3. We are just going to learn a few basic “BreakOut” skills and the assignment will be for you to expand these skills. Start by creating these 11 objects: • obj_paddle – Visible and Solid should be checked • obj_wall - Visible and Solid should be checked • obj_ball - Visible and Solid should be checked • obj_block_yellow - Visible and Solid should be checked • obj_block_blue – Visible and Solid should be checked • obj_block_green – Visible and Solid should be checked • obj_block_orange – Visible and Solid should be checked • obj_block_hotpink – Visible and Solid should be checked • obj_block_purple – Visible and Solid should be checked • obj_block_red – Visible and Solid should be checked • obj_miss - Only Solid should be checked

  4. Create a simple room using only the blue and yellow blocks at first. Later you will be able to start adding the other color blocks to every room, but for now use only those colors. You can use as many of those as you would like in this first room It does NOT have to look like this one:

  5. The paddle, wall and miss are programmed similar to the skills you learned in paddle ball and ping pong. obj_miss: No programming obj_wall: No programming obj_block_yellow: No programming obj_block_blue: No programming obj_block_purple: No programming obj_block_red: No programming obj_block_green: No programming obj_block_hotpink: No programming

  6. obj_paddle: Add 4 Events Event 1: Collision with obj_wall Action: Move FixedApplies to: SelfSelect center button only Speed = 0Relative is NOT checked Event 2: Keyboard Event - Select <No Key> Action: Move FixedApplies to: SelfSelect center button only Speed = 0Relative is NOT checked

  7. obj_paddle (continued): Event 3: Keyboard Event - Select <Left> Action: Move FixedApplies to: SelfSelect Left Arrow only Speed = 5Relative is NOT checked Event 4: Keyboard Event - Select <Right> Action: Move FixedApplies to: SelfSelect Right Arrow only Speed = 5Relative is NOT checked Now it’s time to program the ball. This will involve a number of new Events and Actions! In “BreakOut”, the first new action you will learn is how to destroy blocks and accumulate points.

  8. obj_ball: This object will need 8 Events: Event 1: Create Action 1: Move FixedApplies to: SelfSelect the Up Arrow, Upper Left Corner & Upper Right Corner Arrows Speed = 7Relative is NOT checked

  9. obj_ball (continued): Event 2: Collision with obj_paddle Action 1: Bounce against solid objectsApplies to: SelfPrecise = PreciselyAgainst = Solid Objects Action 2: Set VariableApplies to: SelfVariable: SpeedValue: .2Relative IS checked What does the Set Variable action do? It increases ball speed each time it collides with paddle by a speed of .2

  10. obj_ball (continued): Event 3: Collision with obj_wall Action 1: Bounce against solid objectsApplies to: SelfPrecise = PreciselyAgainst = Solid Objects Event 4: Collision with obj_block_blue Action 1: Bounce against solid objectsApplies to: SelfPrecise = PreciselyAgainst = Solid Objects Action 2: Set ScoreNew Score: 10Relative IS checked

  11. obj_ball (continued): Event 4: Collision with obj_block_blue (continued)Action 3: Destroy InstanceApplies to: Other If you selected Applies to: Self, the ball would be destroyed. If you selected Applies to: Object and select obj_block_blue from the drop down, all instances of that object in the room will be destroyed. Selecting Applies to: Other destroys only the block that the ball collides with.

  12. obj_ball (continued): Event 5: Collision with obj_block_yellow Action 1: Bounce against solid objectsApplies to: SelfPrecise = PreciselyAgainst = Solid Objects Action 2: Set ScoreNew Score: 15Relative IS checkedAction 3: Destroy InstanceApplies to: Other

  13. How do you program the game to move to a 2nd or 3rd room when all blocks are gone? The key is a new action we haven’t used calledTest Instance Count: When this action is true, it acts as a gateway to allow you change something within the game. If it comes back false, it just continues on with the original program. Test Instance Count False True Continue with what you are doing! Go to a New Room

  14. But how do you get it to check it—and check it continuously? A new Event called Step. Stepallows something to be checked every step (or millisecond)—continuously. The only way it could be stoppedis if the item is destroyed, so don’t attach the Step Event to the blocks. So what we want to check is if there are any blocks left in the room. Because there are multiple items that need to be checked (different colored blocks), you will need to create what is called a “nested” loop. See the next page for an example.

  15. This will check to see if the number of obj_block_blue is equal to 0. If this is true (it equals 0), it will check the next Test Instance Count (which will be for obj_block_yellow). Are there any blue blocks? Are there any yellow blocks? When all Test Instance Counts come back true, it checks If next room exists—if it does—it will Go to next room! NOTE: Each of the “loops” contains a Startblock and an Endblock

  16. obj_ball (continued): Event 6: Step Action 1: Test Instance Countobject: obj_block_blue (select from dropdown)number: 0operation: Equal to (select from dropdown) Action 2: Start Block Action 3: Test Instance Countobject: obj_block_yellow (select from dropdown)number: 0operation: Equal to (select from dropdown)Action 4: Start Block

  17. obj_ball (continued): Event 6: Step (continued) Action 5: Check NextAction 6: Next Room Action 7: End Block.Action 8: End Block(to close the check blue blocks loop)

  18. obj_ball (continued): “After 3 balls are lost, the game will end and the score will be displayed on the high score table.” This will require 2 more events. Event 7: Other > Game start Action 1: Set Score New Score = 0Relative is NOT checked Action 2: Set lives Lives: 3Relative is NOT checked FYI - Balls equates to “lives”

  19. obj_ball (continued): Event 8: Collision with obj_miss There are 9 Actions for this object Action 1: Set lives Lives: -1Relative IS checked(this reduces the lives as balls are lost) Action 2: Test lives Value: 0Operation: equal to (this checks to see if there are any remaining lives) Action 3: Start Block

  20. Event 8: Collision with obj_miss (continued) Action 4: End Game Action 5: End Block (remember, every timethere is a Start Block, you will need an End Block)

  21. Event 8: Collision with obj_miss (continued)Action 6: Jump to Start Position Applies to: Object - select obj_paddle from menu Action 7: Jump to Start Position Applies to: Self These two actions put the paddle and ball back to the start position once the ball is lost if there are any lives remaining.

  22. Action 8: Execute a piece of code This will be typed into the /// Create the pause object, pausing the game instance_create(0,0,obj_pause); Copy and paste this into the box that pops up Action 9: Move Fixed Applies to: Self Directions: the 3 up arrows Speed: 7 Relative is NOT checked

  23. obj_ball (continued): Event 9: Draw GUI Action 1: Draw the Value of Score. X value of 200 and Y value of 20. Caption is Score: Action 2: Draw the number of lives. X value is 40 and the Y value is 20. Caption is Lives:

  24. Create obj_pause – will have four events 1st – Create Event - • Action: Execute a piece of code – (type this into the script) • If you forget this action gor to slide 22 to find it /// Create surface, draw everything to it, deactivate all other objects surf = surface_create( room_width, room_height ); surface_set_target(surf); draw_clear_alpha(c_black, 0); // Clears surface. with(all) { if (visible == true) { event_perform(ev_draw,0); } } // Draws every visible object to surface. surface_reset_target(); instance_deactivate_all(true); visible = true;

  25. obj_pause (continued) 2nd Event – Draw Action – Execute a piece of code (type this into the script) /// Draw the surface to the screen draw_surface(surf, 0, 0); 3rd Event – Draw GUI Action 1 – Draw Text Applies to self X = 200 Y = 100 Action 2 – Set the color Select a color that stands out (like blue)

  26. obj_pause (continued): 4th Event – Keyboard– Space Bar Action 1 – Execute a piece of code (type this into the script) /// Unpause, clear surface, re-activate all objects. surface_free(surf); instance_activate_all(); // Activate all the objects again Action 2 – Destroy the instance Applies to Object: obj_pause This object makes a pause in between each ball you miss. First event keeps everything the same. Second event draws a pause scree. Third event gives you the text saying press the space bar. And the fourth event gets rid of the pause on the ball and making the game resume.

  27. Assignment Complete this game to play as described: The game has at least 3 rooms. When you destroy all blocks from Room 1, you go to Room 2 and then onto Room 3 etc. It has to test all the color blocks Utilize all color blocks (total of 7) – each with a different point value Remember the shortcut for the collision with the blocks. There should be a collision event with every block. After 3 balls are lost, the game ends. Save as Game4

More Related