How to design Video Game Characters

how does video game design work and how to learn video game design and how to do video game design and how video game makers design characters
Dr.MohitBansal Profile Pic
Dr.MohitBansal,Canada,Teacher
Published Date:26-10-2017
Your Website URL(Optional)
Comment
CREA TING A CLASSIC PONG-STYLE VIDEOGAME IS THE GAME DESIGN EQUIVALENT TO STICK-FIGURE ANIMATION. It’s not so much about creating an awesome game as it is about covering the basic game design elements that you will need to create your awesome game. Most ball sports videogames (think tennis and soccer) evolved from Pong, so this is the per fect project for those of you who eventually want to design your own football, volleyball, basketball, or hockey game. CREA TE A NEW PROJECT B ecause the name Pong is short for Ping‐Pong and a bunch of people have been sued (by the inventors of Pong ) for calling their 0002672146.INDD 7 February 23, 2016 2:46 PM PROJECT DESIGN A CLASSIC 1 VIDEOGAME8 Project Design a Classic Videogame 1 games Pong, why not call your game Ping‐Pong. (See how super‐ creative I am?) Go to scratch.mit.edu and open the Scratch 2 Offline 1 Editor. If you are online, click Create. If you’re offline, choose 2 File ➪ New. Name your project. (If online, select the title and type 3 Ping‐Pong. If offline, chose File ➪ Save As and type Ping‐Pong.) Delete that cat by selecting the Scissors and clicking the 4 cat or by Shift‐clicking the cat and choosing Delete. With the cat gone, you have a world of possibilities CHANGE THE BACKGROUND COLOR Paint your backdrop dark green, just like a classic ping‐pong table. Click the Backdrops tab. (You may need to click the Stage 1 icon if you have any sprites selected in your project.) Click the Fill with Color tool. 2 Click the Fill option to the left of the color swatches. 3 Click the color swatch you wish to use. 4 Click inside the Paint Editor canvas to fill the backdrop 5 with the new color.9 ADD A BOUNCING BALL Even though it is not difficult to draw a ball, using the sprite named Ball in the Sprite Library will ensure everybody starts with the same sized sprite. In the New Sprite area beneath the Stage, click the first 1 icon: Choose Sprite from Library. Under Category, click Things. 2 Click the sprite named Ball and then click the OK button. 3 10 Project Design a Classic Videogame 1 CHANGE THE BALL COLOR On the Costumes tab delete all but the original orange costume, which looks more like a real ping‐pong ball. Click the costume you wish to delete. 1 Click the X that appears on the top‐left corner of the 2 costume. Repeat for the other costumes you’re deleting. 3 MAKE THE BALL MOVE One block can move a sprite across the screen. Click the Scripts tab. 1 Click the Motions category. 2 Click the MOVE 10 STEPS block, drag it into the Scripts 3 Area, and then release the mouse or trackpad button. Click the block one time while watching the ball on the 4 Stage. Each time you click the block, the ball should move ten steps to the right.11 To start the game when the Green Flag is clicked: On the Scripts tab, click the Events category. 1 Click and drag the WHEN GREEN FLAG CLICKED block 2 into the Scripts Area. Snap the block onto the top of the MOVE block. 3 When you click the Green Flag button, the ball should move ten steps. MAKE BLOCKS REPEAT Several blocks can make something happen over and over. Which one should you try? In the Control category, find the FOREVER block. 1 Click and drag the FOREVER block over to snap beneath 2 the WHEN GREEN FLAG CLICKED block. Notice how the FOREVER block stretches to surround the MOVE block. Click the Green Flag button to test your code. 3 Any blocks inside the FOREVER block will keep running as long as the Green Flag is on. But your ball will move only until it reaches the right side of the Stage. You haven’t given the ball the instruction to bounce12 Project Design a Classic Videogame 1 BOUNCE OFF EDGES You just need one more block to make the ball bounce between edges of the Stage. Click and drag the IF ON EDGE, BOUNCE block from the 1 Motion category to the Scripts Area. Snap it into place inside the FOREVER block, just beneath 2 the MOVE block. Click the Green Flag button to test your code. 3 Placing the IF ON EDGE, BOUNCE block inside the FOREVER block should make your ball bounce back and forth. But it’s kinda boring to keep bouncing in a straight line. CHANGE THE BOUNCE ANGLE By default, all sprites are pointing in the same direction, to the right, but you are not stuck with this direction. Click and drag the POINT IN DIRECTION block into the 1 Scripts Area. Snap the POINT IN DIRECTION block between WHEN 2 GREEN FLAG CLICKED and FOREVER. Click 90 to select it and type 45. 3 13 If you click the Green Flag button to test your code, the ball should now start traveling diagonally and then bounce in a different direction each time it reaches the edge of the Stage. SET THE BALL STARTING POSITION AND SIZE The ball should begin in the center of the screen and look a bit too large. On the Scripts tab, click the Motion category, drag a GO 1 TO X Y block into the Scripts Area, and then snap the GO TO X Y block to the bottom of the WHEN GREEN FLAG CLICKED block. Change each number value to 0 (so the ball will start at 2 X: 0, Y: 0). Click the Looks category and drag a SET SIZE TO block 3 into the Scripts Area. Snap the SET SIZE TO block between WHEN GREEN FLAG 4 CLICKED and GO TO blocks. Change the SET SIZE TO value to 40 to decrease the ball’s 5 size from 100% to 40%. Click the Green Flag button to test your code. 6 14 Project Design a Classic Videogame 1 The ball should be smaller and begin at the center of the screen when the Green Flag button is pressed. ADD THE PADDLES If you are getting used to sprites and code blocks, you can pick up the pace a little when adding the game’s paddles. Beneath the Stage, click the Choose Sprite from 1 Library icon. Chose the Things category. 2 Click the sprite named Paddle and then click the OK 3 button. Click the Costumes tab, click the Color a Shape tool, 4 choose a color swatch (I’ll choose brown), and click inside the paddle.15 The paddle is the right shape and size, but needs to be rotated. On the Costumes tab, click the Select tool. 1 On the Paint Editor canvas, click the paddle. 2 Click the small circle that appears directly above the 3 paddle and rotate the paddle into a vertical position. MOVE PADDLE WITH THE KEYBOARD To play the game, players will use one key to move their paddle up and another key to move their paddle down. Before adding the code to enable this, you should position one paddle along one side of the screen. On the Scripts tab, drag the WHEN GREEN FLAG CLICKED 1 block into the Scripts Area. From the Motion category, drag and snap a GO TO X Y 2 block to the bottom of the WHEN GREEN FLAG CLICKED block. Change the block values to X: 200 and Y: 0. 3 Click the Green Flag button to test your code. 4 16 Project Design a Classic Videogame 1 Your paddle should move to the middle of the right side of the screen, leaving a gap between the paddle and the edge of the screen so there is room for the ball to zoom by. Now comes the really cool part: interactivity Drag these blocks into the paddle’s Scripts Area: 1 Inside the WHEN KEY PRESSED block, click the drop‐ 2 down menu and choose Up Arrow. Change the CHANGE Y BY block’s value to 10. 3 Instead of dragging more code blocks over for the Down‐Arrow key, try this: Shift‐click the WHEN UP ARROW KEY PRESSED block 1 inside the Scripts Area and select Duplicate. Drag the duplicate away from the original and then 2 release the mouse or trackpad to drop the set of blocks. Change Up Arrow to Down Arrow in the new WHEN KEY 3 PRESSED block and change 10 to –10 in the new CHANGE Y BY block.17 Test your Up‐ and Down‐Arrow keys to make sure your paddle moves up and down. MAKE THE BALL BOUNCE OFF THE PADDLE When you click the Green Flag button, the ball bounces off the edges but passes right through the paddle. Similar to the way you instruct the ball to bounce off the edge of the Stage, you must also instruct the ball to bounce off other objects. Click the Ball sprite and then click the Scripts tab. 1 Drag an IF THEN block from the Control category and a 2 TOUCHING? block from the Sensing category into the Scripts Area. Insert the TOUCHING? block into the IF THEN block. 3 Click the drop‐down menu inside the TOUCHING? block 4 and choose Paddle. Drag and snap a TURN CLOCKWISE block from the Motion 5 category into the Scripts Area and inside the IF THEN block. Change the TURN value to 180 (so the ball will move in 6 the opposite direction). Click and drag the IF THEN block inside the FOREVER 7 block, just beneath the IF ON EDGE BOUNCE block.18 Project Design a Classic Videogame 1 When you click the Green Flag to test your game, the ball should bounce right off the paddle. ADD A SECOND PLAYER The game will surely be more fun with an opponent. Remember how to Shift‐click a chunk of code to duplicate it? You can use the same technique to duplicate sprites, too. And, when you duplicate a sprite, all the code inside it is also duplicated. So it should be easy to create a second player. Shift‐click the paddle sprite, choose Info, and change the 1 name to Player Right (since it is on the right side of the Stage). Click the blue triangle to exit Info. 2 Shift‐click Player Right and choose Duplicate. 3 Shift click the new sprite, choose Info, and change the 4 name to Player Left. Click the blue triangle to exit Info. 5 Go to the Scripts tab for Player Left. All the scripts from Player Right should be there.19 UPDATE THE PLAYER LEFT CODE BLOCKS Change the GO TO X Y block’s X value to –200. 1 Change WHEN UP ARROW KEY PRESSED to WHEN W KEY 2 PRESSED. Change WHEN DOWN ARROW KEY PRESSED to WHEN S 3 KEY PRESSED. Click the Green Flag button to test your game. 4 You probably noticed there’s a problem: The ball bounces off Player Right but passes right through Player Left. UPDATE THE BALL CODE Scratch updated the TOUCHING? block when you changed the name of the sprite from Paddle to Player Right. But the IF THEN block is only checking whether the ball is touching Player Right, not Player Left. Shift‐click the IF THEN block, choose Duplicate, and drag 1 the copy to snap beneath the original IF THEN block. In the duplicate blocks, change Player Right to Player 2 Left. Click the Green Flag to test your code. 3 20 Project Design a Classic Videogame 1 The ball should bounce off both rackets. MAKE THE BOUNCE MORE RANDOM You can use the PICK RANDOM block to choose a number between two different values. Click the Ball sprite. 1 Click the Scripts tab. 2 Drag a PICK RANDOM block inside each TURN 3 CLOCKWISE block (replacing the 180 values inside each) and change the values to match the following image:21 Now when you click the Green Flag button to test your code, the ball should bounce off each racket at a slightly different angle. KEEP TRACK OF PLAYER SCORES So far, you have Player Right controlling one paddle and Player Left controlling a second paddle, with the ball just bouncing all over the place. If I am Player Right and you are Player Left, how do you score against me? Click the Ball sprite and then click the Scripts tab. 1 Drag these three blocks into the Scripts Area: 2 Player1’s X position is 200 and the maximum value is 240, so your IF THEN block could check whether the ball’s X position is greater than 230 (it’s good to have a little leeway). Type 230 inside the second slot (IF X 230). CREATE SCORE VARIABLES Variables provide a place for Scratch to keep track of the score for each player. With the Ball sprite selected, click the Data category on 1 the Scripts tab. Click the Make a Variable button. 2 Name the variable Player Right Score, leave For All Sprites 3 checked, and click OK.22 Project Design a Classic Videogame 1 Repeat Steps 2 and 3 to create a second variable named 4 Player Left Score. Both variables should appear on the Stage and you should now see several VARIABLE blocks listed under the Data category. Double‐click variables on the Stage to change how they display and click‐and‐drag to change where they display. INCREASE THE SCORE If Player Left misses the ball, then Player Right’s score should change by 1. Drag and snap the CHANGE BY block from the Data 1 category into the IF THEN block and change the values to Player Left Score and 1. Drag the IF THEN block into the FOREVER block so 2 Scratch will continually check whether the ball has made it past Player Right. Click the Green Flag button to test your code. 3 www.allitebooks.com 23 You must reset the position of the ball after adding a point or the score will keep increasing: Drag and snap a GO TO X Y block to the bottom of the 1 CHANGE BY block and set the values to X: 0 and Y: 0. Drag and snap a WAIT SECS block from the Control 2 category to the bottom of the GO TO X Y block and change the value to 1. Click the Green Flag button to test your game. 3 Player 2’s score should increase by 1 whenever the ball reaches the right side. Then the ball should jump to the center and wait 1 second before moving again. Follow the same steps to enable Player 1’s score whenever Player 2 misses the ball. Or you can take a shortcut by duplicating the previous code and changing the values. (Be sure to replace the block with a block)24 Project Design a Classic Videogame 1 RESET SCORES WHEN THE GAME STARTS You will want to reset the score whenever somebody clicks the Green Flag button to start a new game. This is an easy one Click the Ball sprite and then click the Scripts tab. 1 Drag and snap these blocks into the Scripts Area beneath 2 a WHEN GREEN FLAG CLICKED block and change the values to Player Right Score and Player Left Score: CHECK FOR THE WINNING SCORE Create a new sprite named Game Over, which will check the score, display a “Game Over” message when either player score reaches 11, and then end the game. Click the Paint New Sprite icon beneath the Stage. 1 Click the Costumes tab. 2 Click the Convert to Vector button. 3 25 Click the Text tool. 4 Select a font. (I’ll select Helvetica.) 5 Choose a bright color swatch. (I’ll choose orange to 6 match the score color.) Click near the center of the Paint Editor canvas and type 7 Game Over On the Stage, you will need to click and drag the message into the correct position (centered and a bit above the ball). ADD AN END-OF-GAME CODE When one of the player’s score reaches 11, the winning message should appear. Click the Scripts tab for the Game Over sprite. 1 Add these blocks to the Scripts Area: 2 26 Project Design a Classic Videogame 1 When you click the Green Flag button to test your code, you should be able to play the game until one of the players reaches 11, then the Game Over message should be displayed and the code should stop running. (Reduce the winning score if you want to check your code quickly without having to reach 11.)

Advise: Why You Wasting Money in Costly SEO Tools, Use World's Best Free SEO Tool Ubersuggest.