Homework 3: Make Your First Asciimation
It’s time to make your movie! In this step, you will fill in the makeExampleMovie function in our-movie.cpp so that it will
-
Create an
Asciimationobject that contains aSpritegenerated fromsprite-images/mystery1.txt.- Recall that the first two arguments are the number of rows and columns. You’ll want a movie that is bigger than your Sprite; the values
20,80are a good place to start. - The second two arguments are the
rowHeightandcolWidth. You should have yourrowHeightbe twice the value ofcolWidth; the values30,15are a good place to start
- Recall that the first two arguments are the number of rows and columns. You’ll want a movie that is bigger than your Sprite; the values
-
Call
generateMovieand write the animation toexample-movie.mp4with 25 frames per second.
Helpful Hints
Run the Executable from the Command Line
Don’t try to run the our-movie executable by double-clicking. Instead, run it in the Docker image with the terminal command ./our-movie.
Test Your Code
When you think you have everything implemented for this step, you should recompile and run your our-movie program. If everything is working right, your asciimation program should create a file called example-movie.mp4 that holds a secret message.
If the Video Won't Play
- Check to make sure that you're actually adding frames to the video. A video with zero frames won't play!
- Check to make sure that the dimensions of your movie and frame are correct and that your coordinates for placing characters are correct. If things don't match up, the movie file might not play.
If There Are Weird Characters in Your Movie
Hire a better screenwriter.
Just kidding.
Sometimes they just need more coffee!!
If the characters in your movie aren't right, check the following (e.g., using print statements):
- Is the filename you're using correct? Is the file where you said it would be?
- Are the characters being streamed in correctly?
- Are the streamed characters going to the right places in the array?
- Are the correct coordinates being passed into
getCharAt? - Does
getCharAtaccess the correct location in the array for the coordinates it is given? - Does
addFrameuse the characters it gets properly when creating the image?
(When logged in, completion status appears here.)