Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

597

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
597
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
7
0
Likes
0
Embeds 0
No embeds

No notes for slide
• Solution:&apos; Copyright (c) Microsoft Corporation. All rights reserved.GraphicsWindow.Hide()GraphicsWindow.Height = 450GraphicsWindow.Width = 600GraphicsWindow.Top = ( Desktop.Height - 450 ) / 2GraphicsWindow.Left = ( Desktop.Width - 600 ) / 2GraphicsWindow.CanResize = &quot;False&quot;GraphicsWindow.Show()paddleImage = Program.Directory + &quot;
• ### Transcript

• 1. Microsoft® Small Basic
Estimated time to complete this lesson: 1 hour
In this lesson, you will learn how to:
Create advanced games by using basic elements, objects, and other advanced concepts of Small Basic.
• 3. Advanced Games in Small Basic
Let’s see how we can use all these concepts in Small Basic to create advanced games.
Congratulations! You are now well acquainted with programming fundamentals as well as advanced concepts of Small Basic.
You have learned to use basic programming concepts in Small Basic. You have also been introduced to Small Basic objects and advanced concepts.
• 4. Tic-Tac-Toe – The Game
You are familiar with the popular Tic-Tac-Toe game. Let’s see how we can create a Small Basic version of this popular game.
Notice how you use the Shapes object to draw various game elements. You use mouse events to enable the user to place Xs on the graphics window.
The user and the computer try to win the game by placing Xs or Os in a horizontal, vertical, or diagonal row before the other does.
• 5. Tic-Tac-Toe – How to Play
So how do you play this game?
Steps to play the game:
• This game involves 2 players, the user and the computer. Each player takes a turn placing an X or an O on the 3x3 playing area. The game starts with the user placing an X on the board.
• 6. The players alternately place Xs and Os and on the playing area.
• 7. The player who first places three Xs or three Os in a horizontal, vertical, or diagonal line wins the game.
• Tic-Tac-Toe – The Code
Now let’s understand the code for the game in detail…
• Use the GraphicsWindowto create the game interface.
• 8. Use the Shapes object to create the playing area for the Xs and Os on the graphics window.
• 9. Use mouse events and conditions like If-Else to describe various actions performed by the user and the computer during the game.
• Let’s Summarize…
Congratulations! Now you know how to:
Create advanced games in Small Basic by using basic elements, objects, and advanced concepts of Small Basic.
• 10. It’s Time to Apply Your Learning…
Create a game that involves the following objects: a wall of colored and grey blocks, a ball, and a paddle. The wall is slowly moving downwards, towards the paddle. Using the ball, you must get rid of all the colored blocks before the wall hits the paddle.
You use the mouse to move the paddle; the paddle controls the movement of the ball. The ball will bounce off grey blocks. You win the game if you get rid of all the colored blocks. You lose the game if the paddle misses the ball or if the grey blocks hit the paddle before you can remove all the blocks.