Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

SIT102 Introduction to Programming

Credit Task 1.3C Make A Scene

1. Introduction

Now that you have grasped some of the key programming ideas related to procedure declarations, procedure calls, and sequence, you can start to use these to build more interesting programs. In this task you will create a simple animation by creating a script that opens a window, and loads and draws bitmaps, and plays sound effects.

Note: Remember that this is a Credit Task. Please make sure that you are up to date

with the Pass Tasks before attempting this task. Use the task numbers to help work

out what information is required before attempting the task. Since this is Task 1.3 you should have already attempted:

. Task 1.1P, since this introduces you to our software and making a program

. Task 1.2P, since this introduces you to basic shape drawing ideas which will be required for this task

Submission Details

For this task you need to create a program that opens a window and creates two different pictures using basic shape drawing procedures from Splashkit.

Submit the following files to OnTrack:

1.    A PDF of your Answers to the questions available in the Task Resources: answer these in your

own words and provide a Harvard reference for any online source that you take knowledge from for this task.

2.    A screen shot of your program running on your computer: this should be a full screen screenshot that shows your entire screen with the program. Just one screenshot is fine – you don’t need to    take a screenshot of every part of your animation.

3.    Shape Drawing source code: this is the program.cpp file that you create as part of the task instructions.

This task gives you a chance to be creative, while also practicing your programming skills.

2. Getting Started

Before working on this task make sure you have an understanding of both Task 1.1P Hello World and Task 1.2P Shape Drawing.

1.    Begin by making a new project folder somewhere on your computer, and follow the steps from our earlier tasks to create the starting files such as your program.cpp, etc.

2.    Once you have it set up in the terminal (i.e. you have just finished using the  skm new

c++  command in the terminal) you can use the terminal command  skm resources  to create the resource folders where you need to add the images and sound effects that you want to   use. You will find these folders in the current project folder with your program.cpp file.

3.    Open your project folder in Visual Studio Code. You should see that you have your

program.cpp file as usual, plus the additional folders for your Resources: images, sounds, fonts, etc.

Figure: Resource folders created using skm resources terminal command

That's all that you need before moving onto the task instructions, but note that you can also start by adding in the few procedure calls that we need for graphics drawing, such as opening a new window to draw things to.

3. Your Task Requirements

To finish this task, you will need to create a program and then answer the questions in the Task Resources (available in OnTrack).

Creating a program your own animation!

You should be able to create a simple animation by using SplashKit procedures to open a window, load and draw bitmaps (i.e. images that are stored in a file such as png, etc.), and load and play sound effects. You can make a simple animation by crafting the sequence of actions the program performs. For example:

1.    Open a window

2.    Load the bitmap and sound effects that you need

3.    Clear the screen

4.    Draw a bitmap

5.    Refresh the screen

6.    Play a sound effect

7.    Delay for a short period (e.g. 5 seconds)

8.    Clear and draw a different bitmap

9.    Refresh the screen

10.  Delay again

Feel free to download and use images and sound effects that you can get from the Internet. It is

probably best to work with png files for images, and ogg or wav files for sound effects. You could

find an interestingxkcdand break it up into its cells, draw them one at a time with some associated sound effects.

What you show is up to you, but please avoid anything that may be offensive to others in any way.

SplashKit has the following procedures you could use to work with images, sound effects, and fonts:


SplashKit will search for these resource files in the Resources folders associated with your program (see the details in the Getting Started page of this task). Images like ship.png would need to be put in the images folder, sound effects like boom.wav go in the sounds folder, and fonts like arial.ttf go in the fonts folder.

Note: Have a look at the documentation onsplashkit.iofor other procedures you

could play with. Maybe start by reading the articles ondouble bufferingandGetting Started with Splashkit Audio.

Answering the Questions

Download the Task Resources from OnTrack. You will find the button to download these in the Task Details page, as shown below.

1.    Unzip the file, which in this case will contain a Microsoft Word document template for your answers.

2.    Open the Word document and answer the questions inside. You will want to use these

questions as your chance to demonstrate that you have fully understood the actions you performed in this task.

3.    When finished, save your work, and keep a copy for yourself. You may need to fix incorrect answers and resubmit if your teacher finds a problem.

Lastly, export a copy of the document to PDF. You can use Word’s Save As feature to save to a PDF format. The PDF document is what you submit to OnTrack with your code.

Submit your work

Do the following before you submit:

.    Check to make sure you have a creative animation example to show, using a combination of images, sounds, etc. Be creative!

.     Download the Task resources and answer the questions in the Word file. Save the file as PDF to prepare for upload.

.     Run your program and take a screenshot of your scene.

When you are ready, login toOnTrackand go back to Task 1.3C and submit your code, screenshot, and answers to the Pass task questions.

Remember to save and backup your work!