0% found this document useful (0 votes)
9 views

Lab 00 Exercise

This document provides instructions for 5 exercises to introduce basic visual and interactive programming concepts using Microsoft Teams and the Snap! environment. The exercises cover making a sprite move, say text, change color, bounce off edges, and follow the mouse pointer.

Uploaded by

Muhammad Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Lab 00 Exercise

This document provides instructions for 5 exercises to introduce basic visual and interactive programming concepts using Microsoft Teams and the Snap! environment. The exercises cover making a sprite move, say text, change color, bounce off edges, and follow the mouse pointer.

Uploaded by

Muhammad Ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Introduction to Visual and Interactive

Programming
CT803-4-0-OIVIP

Lab Week 1
Introduction to Microsoft Teams and the Snap! Environment
Exercise 1

• Make a sprite move across the screen: A sprite is a graphical object that you can
control with code. To make a sprite move, you need to change its x and y
coordinates. You can use the move block to move the sprite by a certain number
of steps, or the go to x: y: block to move the sprite to a specific location. You can
also use the forever block to repeat an action indefinitely, or the repeat block to
repeat an action a certain number of times. Make the sprite move from one edge
of the screen to the other, and then back again. You can also change the sprite's
costume, direction, or size to make it more interesting.

Module Code & Module Title Slide Title SLIDE 2


Exercise 2

• Make a sprite say something: You can use the say .. for .. secs block to make a
sprite say a message for a certain amount of time. You can also use the ask block
to make a sprite ask a question and wait for an answer. Make a sprite say hello,
ask the user's name, and then say something nice about them.

Module Code & Module Title Slide Title SLIDE 3


Exercise 3

• Make a sprite change its color: You can use the ‘set color effect to’ block to change
the color of a sprite. The color effect is a number that represents the hue of the
sprite, from 0 to 100. You can also use the ‘change color effect by’ block to change
the color effect by a certain amount. Make a sprite change its color gradually, or
randomly.

Module Code & Module Title Slide Title SLIDE 4


Exercise 4

• Make a sprite bounce off the edges of the screen: You can use the if block to check
a condition, and the touching block to check if a sprite is touching something. You
can also use the turn block to turn a sprite by a certain angle, or the point in
direction block to point a sprite in a specific direction. Make a sprite move around
the screen, and bounce off the edges when it touches them. You can also make
the sprite bounce off other sprites, or make sound effects when it bounces.

Module Code & Module Title Slide Title SLIDE 5


Exercise 5

• Make a sprite follow the mouse pointer: You can use the mouse x and mouse y
blocks to get the x and y coordinates of the mouse pointer. You can also use the
point towards block to make a sprite point towards another sprite or the mouse
pointer. Make a sprite follow the mouse pointer wherever it goes. You can also
make the sprite change its speed, size, or costume depending on the distance
from the mouse pointer.

Module Code & Module Title Slide Title SLIDE 6

You might also like