SlideShare ist ein Scribd-Unternehmen logo
1 von 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.

Weitere ähnliche Inhalte

Was ist angesagt?

2.2 turtle graphics
2.2   turtle graphics2.2   turtle graphics
2.2 turtle graphics
allenbailey
 
2.1 graphics window
2.1   graphics window2.1   graphics window
2.1 graphics window
allenbailey
 
Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – Basics
David Oromaner
 

Was ist angesagt? (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
 

Ähnlich wie 4.2 responding to events

Noughts and Crosses Design Information
Noughts and Crosses Design InformationNoughts and Crosses Design Information
Noughts and Crosses Design Information
Christopher Orchard
 
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
BibekPandit2
 
3.4 events and interactivity
3.4   events and interactivity3.4   events and interactivity
3.4 events and interactivity
allenbailey
 
Galactic Wars XNA Game
Galactic Wars XNA GameGalactic Wars XNA Game
Galactic Wars XNA Game
Sohil Gupta
 

Ähnlich wie 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
 

Mehr von allenbailey

5.1 sharing code
5.1   sharing code5.1   sharing code
5.1 sharing code
allenbailey
 
3.6 debugging aids
3.6   debugging aids3.6   debugging aids
3.6 debugging aids
allenbailey
 
3.5 the controls object
3.5   the controls object3.5   the controls object
3.5 the controls object
allenbailey
 
3.3 the math object
3.3   the math object3.3   the math object
3.3 the math object
allenbailey
 
3.2 stacks and arrays
3.2   stacks and arrays3.2   stacks and arrays
3.2 stacks and arrays
allenbailey
 
3.1 file input and output
3.1   file input and output3.1   file input and output
3.1 file input and output
allenbailey
 
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
allenbailey
 
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
allenbailey
 
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
allenbailey
 
1.5 branching and subroutines
1.5   branching and subroutines1.5   branching and subroutines
1.5 branching and subroutines
allenbailey
 
1.4 conditions and loops
1.4   conditions and loops1.4   conditions and loops
1.4 conditions and loops
allenbailey
 
1.2 statements, properties, and operations
1.2   statements, properties, and operations1.2   statements, properties, and operations
1.2 statements, properties, and operations
allenbailey
 
1.1 introduction to small basic
1.1   introduction to small basic1.1   introduction to small basic
1.1 introduction to small basic
allenbailey
 

Mehr von 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
 

Kürzlich hochgeladen

Chat 9316020077💋 Call Girls Agency In Goa By Goa Call Girls Agency 💋
Chat 9316020077💋 Call Girls  Agency In Goa  By Goa  Call Girls  Agency 💋Chat 9316020077💋 Call Girls  Agency In Goa  By Goa  Call Girls  Agency 💋
Chat 9316020077💋 Call Girls Agency In Goa By Goa Call Girls Agency 💋
russian goa call girl and escorts service
 
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goaGoa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
russian goa call girl and escorts service
 
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
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
aamir
 
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
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
ont65320
 
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
Russian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In GoaRussian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In Goa
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
russian goa call girl and escorts service
 

Kürzlich hochgeladen (20)

📞 Contact Number 8617697112 VIP Ganderbal Call Girls
📞 Contact Number 8617697112 VIP Ganderbal Call Girls📞 Contact Number 8617697112 VIP Ganderbal Call Girls
📞 Contact Number 8617697112 VIP Ganderbal Call Girls
 
2k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 92055419142k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 9205541914
 
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...
 
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls Service
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls ServiceCollege Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls Service
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls Service
 
Chat 9316020077💋 Call Girls Agency In Goa By Goa Call Girls Agency 💋
Chat 9316020077💋 Call Girls  Agency In Goa  By Goa  Call Girls  Agency 💋Chat 9316020077💋 Call Girls  Agency In Goa  By Goa  Call Girls  Agency 💋
Chat 9316020077💋 Call Girls Agency In Goa By Goa Call Girls Agency 💋
 
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goaGoa Call Girls 9316020077 Call Girls  In Goa By Russian Call Girl in goa
Goa Call Girls 9316020077 Call Girls In Goa By Russian Call Girl in goa
 
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
 
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
 
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
 
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
 
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...
 
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
 
Hotel And Home Service Available Kolkata Call Girls Diamond Harbour ✔ 6297143...
Hotel And Home Service Available Kolkata Call Girls Diamond Harbour ✔ 6297143...Hotel And Home Service Available Kolkata Call Girls Diamond Harbour ✔ 6297143...
Hotel And Home Service Available Kolkata Call Girls Diamond Harbour ✔ 6297143...
 
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
 
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
 
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 ...
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
 
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
Russian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In GoaRussian ℂall gIRLS In Goa 9316020077  ℂall gIRLS Service  In Goa
Russian ℂall gIRLS In Goa 9316020077 ℂall gIRLS Service In Goa
 
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...
 

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.

Hinweis der Redaktion

  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