CoDrone Programming – Ch 3

Drawing graphics with sprite motion: 

Digital Technologies

  • Digital Systems (Year 3-4): Explore a range of digital systems with peripheral devices for different purposes, and transmit different types of data (VCDTDS019)
  • Creating Digital Solutions (Year 3-4): Define simple problems, and describe and follow a sequence of steps and decisions involving branching and user input (algorithms) needed to solve them (VCDTCD023)
  • Creating Digital Solutions (Year 3 and 4): Develop simple solutions as visual programs [VCDTCD024]
  • Creating Digital Solutions (Year 5-6): Develop digital solutions as simple visual programs (VCDTCD033)

Mathematics:

  • Number and Algebra (Year 7): Design and implement mathematical algorithms using a simple general-purpose programming language [VCMNA254]
  • Number and Algebra (Year 8): Use algorithms and related testing procedures to identify and correct errors [VCMNA282]

Learning Objectives

After completing this exercise, you will be able to:

  • Create a program using graphical blocks on SNAP tool
  • Draw shapes with the sprite movement
  • Understanding how to make use of  Pen library to draw shapes or lines on the arena.

Task List

Program the Micro:bit to:

  • Make the sprite move in a square path of side = 100 steps
  • Draw the rectangle as the sprite moves
  • Draw the first two sides in red colour
  • Draw the last two sides of the square in blue

Hint: 

You may want to use following functional blocks:

Solution: 

You can verify your code with the solution presented here. Your code may look like this:

Alternatively, you may also download the code (.XML File) to your computer and import it on SNAP tool running your computer (File Menu > Import).

https://s3.amazonaws.com/thinkific-import/91791/EXGP04_draw_multiColor_rectangle-1533790426829.xml

Leave a Reply

Your email address will not be published. Required fields are marked *