A simple animation is a fun way to play with and learn the Python programming language.
When watching your favourite cartoon, or the latest superhero blockbuster, it’s tempting to think that the characters on screen are actually moving. Everything just looks so fluid! In reality, video is a clever deception. It’s actually a series of a still images flashed so quickly our brains is tricked into thinking that the images are one smooth sequence.
Of course, the difference between neighbouring images has to be very small, or the motion looks jerky. There also has to be enough images — or ‘frames’ — per second for the illusion to hold. 24 frames per second (FPS) is the industry standard, but research suggests that our minds can create a smooth video out of as little as 16 FPS.
Today, we’re going to make a simple animation with Python!
First, open up your browser and navigate to www.repl.it and then type ‘Python’ or ‘Python3’ into the search box and hit enter.
The most important part of animation is creating the images. To make things simple, we’re going to use ‘ASCII art’. This is a fancy of way of saying we’re making images out of typed letters, numbers, and symbols. For example:
:-) :-D :-O
\(^u^)/ _(^u^)_ _(^.^)_ \(^.^)/
><(((* > ><(((* < ><(((^ < ><(((^ >
ASCII is an abbreviation of ‘American Standard Code for Information Interchange’. It’s one of several systems programmers used to encode text on a computer.
Remember: since these images are strung together, the difference between them needs to be small!
Write the code snippet on the next page into the left-hand window at the repl.it website:
Become a subscriber and get access to the rest of this article. Plus all our magazine articles.
Stories also include numerous links to help parents, kids, and teachers learn more. Get access today at just $15 per year!
Also In The June 2017 Issue
Building and creating your tools with the Minecraft toolbox helps you survive the game.
Sensors give robots the senses humans have.
30+ ideas for all age holiday gifts, from books to apps to board games to VR and more.
There might be a reason that too-real robot and video game character creeps you out.
You computer mouse cursor finally gets a cat to chase it.
Create turtles with Python, the programming language.
This programming language uses colors instead of text and punctuation to add and perform other tasks.
Use micro:bit to water your plants!
Knowing how passwords are cracked can help you create better passwords.
Studying satellite photographs shows a lot about what happens in the world.
There are a number of strategies teachers (plus parents and students) can take to learn programming.
Pigpen ciphers uses alien-like symbols to hide secret messages.
This project uses conductive thread to create a glove to activates your phone.
The repl.it website and React are one way to create mobile apps.
Software programming does neat things with language, in this case, mixing capital letters.
This Scratch game has lots of ways you can customize the game play. No cats were harmed in the making of this article either.
Links from the bottom of all the October 2017 articles, collected in one place for you to print, share, or bookmark.
Interesting stories about computer science, software programming, and technology for October 2017.