Simulate the explosion effect with Python Turtle.
Tag Archives: timer events
Firing, Accelerating, and Rotating Spaceship
Continuing from previous Accelerating and Rotating Spaceship project, make the spaceship fire the bullets. Each bullet have limited range and there should be some time gap between the firings so that spaceship won’t destroy asteroids too easily in the future game. You may need to use list structure in Python to store the bullets.
Accelerating and Rotating Spaceship
Continuing from the rotating spaceship project, allow the spaceship to accelerate by using the ‘up’ arrow key. Also show the rocket fuel when the thrust happens. When the spaceship goes out of the screen, wrap it around on the opposite side of the screen. Also set the maximum speed for the spaceship.
What’s next?
Firing, Accelerating, and Rotating Spaceship
Synchronous Fireflies
In a previous project, you animated a lot of fireflies that are moving and lighting up at different phases. In the nature fireflies sometime synchronize making a wonderful show! It is one of the swarm behavior in the nature and we will try to simulate it.
We can make our computer fireflies synchronize by following a very simple rule:
If a firefly sees another another firefly lights up, it will increase its phase slightly to catch up with the nearby firefly.
Fireflies
Previously you animated a moving and lighting up dot. Now create many such dots with much smaller size. They all light up every 5 seconds but they light up at different times. We can say they have different phases. Randomize their initial positions and initial phases.
Here is video demo of the project:
In a next project, we will make these fireflies synchronize.
Gradually Lighting Up and Moving Animation
In a previous project, you animated a dot to gradually light up at every a few seconds. Now make the dot move randomly as it lights up.
Gradually Lighting Up Animation
In a previous project, you implemented lighting up animation. Make the animation look more pleasant by making the dot light up and dim gradually.
Lighting Up Animation
Draw a large dot with low brightness. On every 3rd second, light it up to full brightness while keeping the hue and saturation and dim it to the original brightness immediately.
You will need to use timer events and colorsys library to implement this project.
Capture The Flags Game
In this Python Turtle project, you are going to develop a simple game. In this game, you create 11 flags in random positions. The player will control an emoji by keyboard to collect as many flags as possible before the timer expires.
To be able to finish this project, you need to know the basics of animation, timer and keyboard events in Turtle. You will also need to know list in Python and how to display unicode characters.
Check out animation of this project here: