Homework 3: Make It Your Own
Now it’s time to let your creativity run free!
Hay! There's a handy tool in the Helpful Hints section below that will help you create your own sprites!
Yeah, it's always good to read the Helpful Hints section before you dive in!
The code you submit should generate your own animation, with one or more of the variations suggested below.
You’ll be implementing your variation(s) in the makeStudentMovie
function in our-movie.cpp
.
Suggested variations:
- Create a new ASCII image as a plain-text file and add it to the
sprite-images
directory. HavemakeStudentMovie
use yourSprite
image instead of the CS 70–provided one. The text files that sprites are stored in contain a single line of 400 characters, which display the sprite when they’re wrapped appropriately. - While you can find premade ASCII art as well as tools online for generating ASCII art for you, for this assignment we ask that you draw your own. It’s okay if they’re simple, but if you want to get creative, we encourage that, too!
- Use the CS 70–provided
Sprite
inmakeStudentMovie
, but instead of setting the font color, background color, and text scaling to be the same for every frame and for every character, make them change over time. - If you think you might want to have some randomized component of your movie, you should read the Generate Random Numbers page.
- Have another idea? Get the go-ahead from one of your instructors first, but we’ll probably be excited to see what you come up with!
Helpful Hints
Creating a New Sprite File
If you add a new Sprite
image file, remember to git add
your new file to your repository (and git push
it!), so that we can see it!
The text files in which sprites are stored as a single line that contains the (exactly 400) characters needed to draw the sprite (i.e., for 40 columns and 10 rows). There shouldn't be any line breaks in your file except the one at the end of the file (and your line).
Take a look at the mystery1.txt
sprite file as an example.
One way to build your ASCII image is to work in the text editor of your choice with a fixed-width font. Draw your sprite on 10 lines, making sure that each line has exactly 40 characters. When you’re done, remove all of the line-break characters.
(You can also sketch out your sprite on graph paper, and then transfer it to your computer.)
To help you out, we've also put a little sprite converter on this page. Draw your sprite in ASCII art in the upper text box and click to convert it to a single line of text in the lower text box. You can then copy and paste that line into a text file and save it as a sprite.
Want to Keep Going?
Explore the OpenCV drawing functions to see what else is possible!
(When logged in, completion status appears here.)