SlideShare uma empresa Scribd logo
1 de 11
Microsoft® Small Basic Responding to Events Estimated time to complete this lesson: 1 hour
Responding to Events In this lesson, you will learn about: Creating interactive games in Small Basic that respond to events.
Fun with Shapes  And you also know that you can use these shapes, controls, and events collectively to create interactive games in Small Basic. Let’s see how… So far, you have learned to insert and animate various shapes in your Small Basic programs. You have also learned to use controls and keyboard and mouse events to include interactivity in your Small Basic program.
Make the Turtle Draw – The Game In this simple game, you tell the Turtle to draw unique shapes in the graphics window by defining the number of sides. Notice how you use the Turtle object to draw shapes and how you use mouse and keyboard events to choose the color and the number of sides.  The game demonstrates how the user can make the Turtle draw colorful, unique shapes by specifying a color and the number of sides.
Make the Turtle Draw – How to Play So how do you play this game? Steps to play the game: ,[object Object]
Next, you specify the number of sides, so you can define what the Turtle should draw.
When you click Submit, the Turtle starts drawing.,[object Object]
Bounce the Ball – The Game Let’s move to a complex game now. In this game, you keep a ball above the ground by using the mouse to click the ball to keep it afloat.  Notice how we use mouse events to keep the ball from touching the ground. The ball responds to mouse clicks and stays afloat. The objective of the game is to keep the ball afloat as long as possible.
Bounce the Ball – How to Play So how do you play this game? Steps to play the game: ,[object Object]
You click the ball to make it bounce up in the air.
You must keep the ball from touching the ground. To do so, keep clicking the ball.

Mais conteúdo relacionado

Mais procurados

An Intro to Scratch Programming for Parents
An Intro to Scratch Programming for ParentsAn Intro to Scratch Programming for Parents
An Intro to Scratch Programming for Parentsmewren
 
Computer Coding with Scratch: Lesson 2_primaryschoollessons
Computer Coding with Scratch: Lesson 2_primaryschoollessonsComputer Coding with Scratch: Lesson 2_primaryschoollessons
Computer Coding with Scratch: Lesson 2_primaryschoollessonsSeniorInfants
 
2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphicsallenbailey
 
Programming in scratch
Programming in scratchProgramming in scratch
Programming in scratchHussam Mostafa
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics windowallenbailey
 
Coding Basics with Scratch
Coding Basics with ScratchCoding Basics with Scratch
Coding Basics with ScratchNicole Baratta
 
Intro to Dimension
Intro to DimensionIntro to Dimension
Intro to DimensionAlex Hornak
 
Interactive Project - Production Reflection
Interactive Project - Production ReflectionInteractive Project - Production Reflection
Interactive Project - Production ReflectionDaisyPotter
 
Scratch programming introduction to game creation
Scratch programming  introduction to game creationScratch programming  introduction to game creation
Scratch programming introduction to game creationAnkita Shirke
 
Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsDavid Oromaner
 
learn sketchup (for the beginners)
learn sketchup (for the beginners)learn sketchup (for the beginners)
learn sketchup (for the beginners)Moksha Bhatia
 
6. production reflection(2)
6. production reflection(2)6. production reflection(2)
6. production reflection(2)rhiannah baker
 

Mais procurados (20)

An Intro to Scratch Programming for Parents
An Intro to Scratch Programming for ParentsAn Intro to Scratch Programming for Parents
An Intro to Scratch Programming for Parents
 
Computer Coding with Scratch: Lesson 2_primaryschoollessons
Computer Coding with Scratch: Lesson 2_primaryschoollessonsComputer Coding with Scratch: Lesson 2_primaryschoollessons
Computer Coding with Scratch: Lesson 2_primaryschoollessons
 
2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphics
 
3 Kodu
3 Kodu3 Kodu
3 Kodu
 
Scratch Animation
Scratch AnimationScratch Animation
Scratch Animation
 
Programming in scratch
Programming in scratchProgramming in scratch
Programming in scratch
 
Kodu
KoduKodu
Kodu
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics window
 
Coding Basics with Scratch
Coding Basics with ScratchCoding Basics with Scratch
Coding Basics with Scratch
 
Intro to Dimension
Intro to DimensionIntro to Dimension
Intro to Dimension
 
Interactive Project - Production Reflection
Interactive Project - Production ReflectionInteractive Project - Production Reflection
Interactive Project - Production Reflection
 
Scratch programming introduction to game creation
Scratch programming  introduction to game creationScratch programming  introduction to game creation
Scratch programming introduction to game creation
 
Lasso tool
Lasso toolLasso tool
Lasso tool
 
Google sketch up
Google sketch upGoogle sketch up
Google sketch up
 
Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – Basics
 
learn sketchup (for the beginners)
learn sketchup (for the beginners)learn sketchup (for the beginners)
learn sketchup (for the beginners)
 
6. production reflection(2)
6. production reflection(2)6. production reflection(2)
6. production reflection(2)
 
Presentation q4
Presentation q4Presentation q4
Presentation q4
 
Sketchup modul
Sketchup modulSketchup modul
Sketchup modul
 
Scratch an Editing App
 Scratch  an Editing App  Scratch  an Editing App
Scratch an Editing App
 

Semelhante a 4.2 responding to events

2d game engine workflow
2d game engine workflow2d game engine workflow
2d game engine workflowluisfvazquez1
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)noorcon
 
Noughts and Crosses Design Information
Noughts and Crosses Design InformationNoughts and Crosses Design Information
Noughts and Crosses Design InformationChristopher Orchard
 
Gamemaker lesson 1
Gamemaker lesson 1Gamemaker lesson 1
Gamemaker lesson 1iain bruce
 
Unity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesUnity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesNexusEdgesupport
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditBibekPandit2
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivityallenbailey
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA GameSohil Gupta
 
Work Flow for 2D Game
Work Flow for 2D GameWork Flow for 2D Game
Work Flow for 2D Gamebowes96123
 
Unity - Building your first real-time 3D project
Unity - Building your first real-time 3D projectUnity - Building your first real-time 3D project
Unity - Building your first real-time 3D projectNexusEdgesupport
 
How to start a simple animation.
How to start a simple animation.How to start a simple animation.
How to start a simple animation.TOA
 
Gaming Outline
Gaming OutlineGaming Outline
Gaming OutlineIMGTeched
 

Semelhante a 4.2 responding to events (20)

Workflow
WorkflowWorkflow
Workflow
 
2d game engine workflow
2d game engine workflow2d game engine workflow
2d game engine workflow
 
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
Introduction to Game Programming: Using C# and Unity 3D - Chapter 2 (Preview)
 
Noughts and Crosses Design Information
Noughts and Crosses Design InformationNoughts and Crosses Design Information
Noughts and Crosses Design Information
 
Street runner final
Street runner finalStreet runner final
Street runner final
 
02 unity 3_d_part_1
02 unity 3_d_part_102 unity 3_d_part_1
02 unity 3_d_part_1
 
intern.pdf
intern.pdfintern.pdf
intern.pdf
 
Gamemaker lesson 1
Gamemaker lesson 1Gamemaker lesson 1
Gamemaker lesson 1
 
Unity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All SlidesUnity - Building Your First Real-Time 3D Project - All Slides
Unity - Building Your First Real-Time 3D Project - All Slides
 
Scratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek panditScratch for kids syllabus for 5 hours by bibek pandit
Scratch for kids syllabus for 5 hours by bibek pandit
 
Lesson-6-Fruit-Slicer.pptx
Lesson-6-Fruit-Slicer.pptxLesson-6-Fruit-Slicer.pptx
Lesson-6-Fruit-Slicer.pptx
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA Game
 
Gamemaker work flow
Gamemaker work flowGamemaker work flow
Gamemaker work flow
 
Gamemaker work flow
Gamemaker work flowGamemaker work flow
Gamemaker work flow
 
Work Flow for 2D Game
Work Flow for 2D GameWork Flow for 2D Game
Work Flow for 2D Game
 
03 whack a-witch!
03 whack a-witch!03 whack a-witch!
03 whack a-witch!
 
Unity - Building your first real-time 3D project
Unity - Building your first real-time 3D projectUnity - Building your first real-time 3D project
Unity - Building your first real-time 3D project
 
How to start a simple animation.
How to start a simple animation.How to start a simple animation.
How to start a simple animation.
 
Gaming Outline
Gaming OutlineGaming Outline
Gaming Outline
 

Mais de allenbailey

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing codeallenbailey
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aidsallenbailey
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls objectallenbailey
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math objectallenbailey
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arraysallenbailey
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and outputallenbailey
 
2.6 flickr, image list, and network objects
2.6   flickr, image list, and network objects2.6   flickr, image list, and network objects
2.6 flickr, image list, and network objectsallenbailey
 
2.5 clock, desktop, and dictionary objects
2.5   clock, desktop, and dictionary objects2.5   clock, desktop, and dictionary objects
2.5 clock, desktop, and dictionary objectsallenbailey
 
2.4 sound, program, and text objects
2.4   sound, program, and text objects2.4   sound, program, and text objects
2.4 sound, program, and text objectsallenbailey
 
1.5 branching and subroutines
1.5   branching and subroutines1.5   branching and subroutines
1.5 branching and subroutinesallenbailey
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loopsallenbailey
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operationsallenbailey
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basicallenbailey
 

Mais de allenbailey (14)

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing code
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aids
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls object
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math object
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arrays
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and output
 
2.6 flickr, image list, and network objects
2.6   flickr, image list, and network objects2.6   flickr, image list, and network objects
2.6 flickr, image list, and network objects
 
2.5 clock, desktop, and dictionary objects
2.5   clock, desktop, and dictionary objects2.5   clock, desktop, and dictionary objects
2.5 clock, desktop, and dictionary objects
 
2.4 sound, program, and text objects
2.4   sound, program, and text objects2.4   sound, program, and text objects
2.4 sound, program, and text objects
 
1.5 branching and subroutines
1.5   branching and subroutines1.5   branching and subroutines
1.5 branching and subroutines
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loops
 
1.3 variables
1.3   variables1.3   variables
1.3 variables
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operations
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basic
 

Último

📞 Contact Number 8617697112 VIP East Sikkim Call Girls
📞 Contact Number 8617697112 VIP East Sikkim Call Girls📞 Contact Number 8617697112 VIP East Sikkim Call Girls
📞 Contact Number 8617697112 VIP East Sikkim Call GirlsNitya salvi
 
Ranikhet call girls 📞 8617697112 At Low Cost Cash Payment Booking
Ranikhet call girls 📞 8617697112 At Low Cost Cash Payment BookingRanikhet call girls 📞 8617697112 At Low Cost Cash Payment Booking
Ranikhet call girls 📞 8617697112 At Low Cost Cash Payment BookingNitya salvi
 
WhatsApp Chat: 📞 8617697112 Hire Call Girls Raiganj For a Sensual Sex Experience
WhatsApp Chat: 📞 8617697112 Hire Call Girls Raiganj For a Sensual Sex ExperienceWhatsApp Chat: 📞 8617697112 Hire Call Girls Raiganj For a Sensual Sex Experience
WhatsApp Chat: 📞 8617697112 Hire Call Girls Raiganj For a Sensual Sex ExperienceNitya salvi
 
𓀤Call On 6297143586 𓀤 Park Street Call Girls In All Kolkata 24/7 Provide Call...
𓀤Call On 6297143586 𓀤 Park Street Call Girls In All Kolkata 24/7 Provide Call...𓀤Call On 6297143586 𓀤 Park Street Call Girls In All Kolkata 24/7 Provide Call...
𓀤Call On 6297143586 𓀤 Park Street Call Girls In All Kolkata 24/7 Provide Call...rahim quresi
 
Navi Mumbai Call Girls -📞9833754194-Call Girls Number Vashi-Nerul Call Girls ...
Navi Mumbai Call Girls -📞9833754194-Call Girls Number Vashi-Nerul Call Girls ...Navi Mumbai Call Girls -📞9833754194-Call Girls Number Vashi-Nerul Call Girls ...
Navi Mumbai Call Girls -📞9833754194-Call Girls Number Vashi-Nerul Call Girls ...priyasharma62062
 
Model VVIP Call Girls In Porur 👉 Chennai 🍬 7427069034 Escort Service & Hotel ...
Model VVIP Call Girls In Porur 👉 Chennai 🍬 7427069034 Escort Service & Hotel ...Model VVIP Call Girls In Porur 👉 Chennai 🍬 7427069034 Escort Service & Hotel ...
Model VVIP Call Girls In Porur 👉 Chennai 🍬 7427069034 Escort Service & Hotel ...hotbabesbook
 
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With... Shivani Pandey
 
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)amitlee9823
 
Verified Trusted Call Girls Egmore Chennai ✔✔7427069034 Independent Chennai ...
Verified Trusted Call Girls Egmore Chennai ✔✔7427069034  Independent Chennai ...Verified Trusted Call Girls Egmore Chennai ✔✔7427069034  Independent Chennai ...
Verified Trusted Call Girls Egmore Chennai ✔✔7427069034 Independent Chennai ... Shivani Pandey
 
Thane West \ Escort Service in Mumbai - 450+ Call Girl Cash Payment 983332523...
Thane West \ Escort Service in Mumbai - 450+ Call Girl Cash Payment 983332523...Thane West \ Escort Service in Mumbai - 450+ Call Girl Cash Payment 983332523...
Thane West \ Escort Service in Mumbai - 450+ Call Girl Cash Payment 983332523...hotbabesbook
 
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...rajveermohali2022
 
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...SUHANI PANDEY
 
Hire 💕 8617697112 Pauri Garhwal Call Girls Service Call Girls Agency
Hire 💕 8617697112 Pauri Garhwal Call Girls Service Call Girls AgencyHire 💕 8617697112 Pauri Garhwal Call Girls Service Call Girls Agency
Hire 💕 8617697112 Pauri Garhwal Call Girls Service Call Girls AgencyNitya salvi
 
Mumbai ] Call Girls Service Mumbai ₹7.5k Pick Up & Drop With Cash Payment 983...
Mumbai ] Call Girls Service Mumbai ₹7.5k Pick Up & Drop With Cash Payment 983...Mumbai ] Call Girls Service Mumbai ₹7.5k Pick Up & Drop With Cash Payment 983...
Mumbai ] Call Girls Service Mumbai ₹7.5k Pick Up & Drop With Cash Payment 983...hotbabesbook
 
(Verified Models) Airport Kolkata Escorts Service (+916297143586) Escort agen...
(Verified Models) Airport Kolkata Escorts Service (+916297143586) Escort agen...(Verified Models) Airport Kolkata Escorts Service (+916297143586) Escort agen...
(Verified Models) Airport Kolkata Escorts Service (+916297143586) Escort agen...rahim quresi
 
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser... Shivani Pandey
 
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingAlmora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingNitya salvi
 
Mira Road | Call Girls Service Mumbai | ₹,9500 Pay Cash 9833325238 Free Home ...
Mira Road | Call Girls Service Mumbai | ₹,9500 Pay Cash 9833325238 Free Home ...Mira Road | Call Girls Service Mumbai | ₹,9500 Pay Cash 9833325238 Free Home ...
Mira Road | Call Girls Service Mumbai | ₹,9500 Pay Cash 9833325238 Free Home ...hotbabesbook
 
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034 Independent Chenna... Shivani Pandey
 

Último (20)

📞 Contact Number 8617697112 VIP East Sikkim Call Girls
📞 Contact Number 8617697112 VIP East Sikkim Call Girls📞 Contact Number 8617697112 VIP East Sikkim Call Girls
📞 Contact Number 8617697112 VIP East Sikkim Call Girls
 
Ranikhet call girls 📞 8617697112 At Low Cost Cash Payment Booking
Ranikhet call girls 📞 8617697112 At Low Cost Cash Payment BookingRanikhet call girls 📞 8617697112 At Low Cost Cash Payment Booking
Ranikhet call girls 📞 8617697112 At Low Cost Cash Payment Booking
 
WhatsApp Chat: 📞 8617697112 Hire Call Girls Raiganj For a Sensual Sex Experience
WhatsApp Chat: 📞 8617697112 Hire Call Girls Raiganj For a Sensual Sex ExperienceWhatsApp Chat: 📞 8617697112 Hire Call Girls Raiganj For a Sensual Sex Experience
WhatsApp Chat: 📞 8617697112 Hire Call Girls Raiganj For a Sensual Sex Experience
 
𓀤Call On 6297143586 𓀤 Park Street Call Girls In All Kolkata 24/7 Provide Call...
𓀤Call On 6297143586 𓀤 Park Street Call Girls In All Kolkata 24/7 Provide Call...𓀤Call On 6297143586 𓀤 Park Street Call Girls In All Kolkata 24/7 Provide Call...
𓀤Call On 6297143586 𓀤 Park Street Call Girls In All Kolkata 24/7 Provide Call...
 
Navi Mumbai Call Girls -📞9833754194-Call Girls Number Vashi-Nerul Call Girls ...
Navi Mumbai Call Girls -📞9833754194-Call Girls Number Vashi-Nerul Call Girls ...Navi Mumbai Call Girls -📞9833754194-Call Girls Number Vashi-Nerul Call Girls ...
Navi Mumbai Call Girls -📞9833754194-Call Girls Number Vashi-Nerul Call Girls ...
 
Model VVIP Call Girls In Porur 👉 Chennai 🍬 7427069034 Escort Service & Hotel ...
Model VVIP Call Girls In Porur 👉 Chennai 🍬 7427069034 Escort Service & Hotel ...Model VVIP Call Girls In Porur 👉 Chennai 🍬 7427069034 Escort Service & Hotel ...
Model VVIP Call Girls In Porur 👉 Chennai 🍬 7427069034 Escort Service & Hotel ...
 
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
 
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
Call Girls Bellandur ☎ 7737669865☎ Book Your One night Stand (Bangalore)
 
Verified Trusted Call Girls Egmore Chennai ✔✔7427069034 Independent Chennai ...
Verified Trusted Call Girls Egmore Chennai ✔✔7427069034  Independent Chennai ...Verified Trusted Call Girls Egmore Chennai ✔✔7427069034  Independent Chennai ...
Verified Trusted Call Girls Egmore Chennai ✔✔7427069034 Independent Chennai ...
 
Thane West \ Escort Service in Mumbai - 450+ Call Girl Cash Payment 983332523...
Thane West \ Escort Service in Mumbai - 450+ Call Girl Cash Payment 983332523...Thane West \ Escort Service in Mumbai - 450+ Call Girl Cash Payment 983332523...
Thane West \ Escort Service in Mumbai - 450+ Call Girl Cash Payment 983332523...
 
CHEAP Call Girls in Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in  Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in  Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Malviya Nagar, (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
 
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
 
Hire 💕 8617697112 Pauri Garhwal Call Girls Service Call Girls Agency
Hire 💕 8617697112 Pauri Garhwal Call Girls Service Call Girls AgencyHire 💕 8617697112 Pauri Garhwal Call Girls Service Call Girls Agency
Hire 💕 8617697112 Pauri Garhwal Call Girls Service Call Girls Agency
 
Mumbai ] Call Girls Service Mumbai ₹7.5k Pick Up & Drop With Cash Payment 983...
Mumbai ] Call Girls Service Mumbai ₹7.5k Pick Up & Drop With Cash Payment 983...Mumbai ] Call Girls Service Mumbai ₹7.5k Pick Up & Drop With Cash Payment 983...
Mumbai ] Call Girls Service Mumbai ₹7.5k Pick Up & Drop With Cash Payment 983...
 
(Verified Models) Airport Kolkata Escorts Service (+916297143586) Escort agen...
(Verified Models) Airport Kolkata Escorts Service (+916297143586) Escort agen...(Verified Models) Airport Kolkata Escorts Service (+916297143586) Escort agen...
(Verified Models) Airport Kolkata Escorts Service (+916297143586) Escort agen...
 
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Velappanchavadi WhatsApp Booking 7427069034 call girl ser...
 
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment BookingAlmora call girls 📞 8617697112 At Low Cost Cash Payment Booking
Almora call girls 📞 8617697112 At Low Cost Cash Payment Booking
 
Mira Road | Call Girls Service Mumbai | ₹,9500 Pay Cash 9833325238 Free Home ...
Mira Road | Call Girls Service Mumbai | ₹,9500 Pay Cash 9833325238 Free Home ...Mira Road | Call Girls Service Mumbai | ₹,9500 Pay Cash 9833325238 Free Home ...
Mira Road | Call Girls Service Mumbai | ₹,9500 Pay Cash 9833325238 Free Home ...
 
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034 Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034  Independent Chenna...Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034  Independent Chenna...
Verified Trusted Call Girls Ambattur Chennai ✔✔7427069034 Independent Chenna...
 

4.2 responding to events

  • 1. Microsoft® Small Basic Responding to Events Estimated time to complete this lesson: 1 hour
  • 2. Responding to Events In this lesson, you will learn about: Creating interactive games in Small Basic that respond to events.
  • 3. Fun with Shapes And you also know that you can use these shapes, controls, and events collectively to create interactive games in Small Basic. Let’s see how… So far, you have learned to insert and animate various shapes in your Small Basic programs. You have also learned to use controls and keyboard and mouse events to include interactivity in your Small Basic program.
  • 4. Make the Turtle Draw – The Game In this simple game, you tell the Turtle to draw unique shapes in the graphics window by defining the number of sides. Notice how you use the Turtle object to draw shapes and how you use mouse and keyboard events to choose the color and the number of sides. The game demonstrates how the user can make the Turtle draw colorful, unique shapes by specifying a color and the number of sides.
  • 5.
  • 6. Next, you specify the number of sides, so you can define what the Turtle should draw.
  • 7.
  • 8. Bounce the Ball – The Game Let’s move to a complex game now. In this game, you keep a ball above the ground by using the mouse to click the ball to keep it afloat. Notice how we use mouse events to keep the ball from touching the ground. The ball responds to mouse clicks and stays afloat. The objective of the game is to keep the ball afloat as long as possible.
  • 9.
  • 10. You click the ball to make it bounce up in the air.
  • 11. You must keep the ball from touching the ground. To do so, keep clicking the ball.
  • 12.
  • 13. Let’s Summarize… Congratulations! Now you know how to: Create interactive games in Small Basic that respond to events.
  • 14.
  • 15. Create a series of statements to be displayed on the screen.
  • 16. For any statement, the user will click True or False.
  • 17. The user scores points by guessing correctly.

Notas do Editor

  1. Solution:' Copyright (c) Microsoft Corporation. All rights reserved.GraphicsWindow.Hide()gw = 500gh = 350scoreBoxLeft = 200passedQuestion = 0score = 0Clicked = ""i = 1Q[1] = "Nile is the longest river in the world."Q[2] = "The highest mountain in the world is Mount Everest."Q[3] = "Zambia is also known as the 'Country of Copper'."Q[4] = "The coldest place on the earth is in Siberia."Q[5] = "Sydney is the capital of the USA."Q[6] = "The river Jordan flows out into the Dead sea."Q[7] = "Mumbai is the capital of India."Q[8] = "Africa is the largest coffee growing continent in the world."Q[9] = "The largest desert in the world is Sahara Desert."Q[10] = "London is the capital of the UK."A[1] = "True"A[2] = "True"A[3] = "True"A[4] = "True"A[5] = "False"A[6] = "True"A[7] = "False"A[8] = "False"A[9] = "True"A[10] = "True"ArrayRandom[1] = "5234162"ArrayRandom[2] = "1896523"ArrayRandom[3] = "5974216"ArrayRandom[4] = "2756194"randomNumber = Math.GetRandomNumber(Array.GetItemCount(ArrayRandom))GraphicsWindow.CanResize = "False"GraphicsWindow.Width = gwGraphicsWindow.Height = ghGraphicsWindow.Top = (Desktop.Height - gh) / 2GraphicsWindow.Left = (Desktop.Width - gw) / 2GraphicsWindow.Title = "True or False"GraphicsWindow.Show()Controls.ButtonClicked = OnButtonClickedCreateUI()Sub CreateUIGraphicsWindow.BrushColor = "Purple"GraphicsWindow.FontName = "Verdana"GraphicsWindow.FontSize = 14GraphicsWindow.DrawRectangle(10, 10, 480, 330) trueButton = Controls.AddButton("True", 30, 210) falseButton = Controls.AddButton("False", 320, 210) Controls.SetSize(trueButton, 150, 100)Controls.SetSize(falseButton, 150, 100)GraphicsWindow.DrawText(220, 300, "Result")resultTextBox = Shapes.AddText("")Shapes.Move(resultTextBox, 220, 250)scoreTextBox = Shapes.AddText("Score: 0")Shapes.Move(scoreTextBox, 404, 15)StartGame() EndSubSub StartGamepassedQuestion = Text.GetSubText(ArrayRandom[randomNumber], i, 1) If i <= 7 Thenqx = 60qy = 90 GraphicsWindow.BrushColor = "LightBlue"GraphicsWindow.FillRectangle(200, 220, 100, 80) GraphicsWindow.FillRectangle(20, 50, 460, 100) GraphicsWindow.BrushColor = "Blue"GraphicsWindow.DrawBoundText(qx - 20, qy, 420 "" + Q[passedQuestion])currentAnswer = A[passedQuestion]Else Program.Delay(1000)GraphicsWindow.ShowMessage("Your Score is " + score, "Game Over")Program.End()EndIfi = i + 1EndSubSub OnButtonClickedclickedButtonCaption = Controls.GetButtonCaption(Controls.LastClickedButton)If currentAnswer = clickedButtonCaption Then lastAnswer = "Correct"Shapes.Move(resultTextBox, 220, 250) score = score + 1ElselastAnswer = "Incorrect"Shapes.Move(resultTextBox, 212, 250)EndIfShapes.SetText(resultTextBox, lastAnswer) Shapes.SetText(scoreTextBox, "Score: " + score)StartGame()EndSub