All Questions
41
questions
1
vote
1
answer
72
views
Trouble with rendering speed of the animation of a simulation?
The following code is a conversion from some old java I wrote to python.
It shows the beginnings of a simulation of an ant colony.
I am finding the animation speed very slow - and I'm wondering if I ...
2
votes
0
answers
76
views
Interactive Gundam using only Matplotlib
The code below plots a background image (sky) and then a Gundam sprite using Matplotlib. It also creates 4 buttons with obvious purposes.
The Gundam class stores 2 ...
4
votes
0
answers
198
views
Animating Lissajous curves with Python and matplotlib's animation library
I'd like to plot an animation of Lissajous curves using Python and matplotlib's animate library. I really do not have a lot of experience with Python, so rather ...
3
votes
1
answer
1k
views
Frame Pacing and Animation in Python/tkinter
The goal of each frame of the animation to be the same length as the one before it, regardless of the amount of processing that takes place as the frame is being built.
This is a little animation demo ...
2
votes
0
answers
1k
views
Slow render of a graph path using python matplotlib animation
I am computing shortest paths of graphs using Python Networkx and Matplotlib. I'm focused on animating the route inspection problem path in particular here.
My goal is to smoothly render such ...
3
votes
2
answers
641
views
Active Brownian Motion
I am attempting to write a Python code to simulate many particles in a confined box. These particles behave in such a way that they move in the box in straight lines with a slight angular noise (small ...
5
votes
1
answer
2k
views
Python - 2D Elastic Collision Simulation
I am currently a Python beginner, who just finished a script simulating collisions between circles (balls) in 2 dimensions.
I would appreciate comments on overall structure, variable names and really ...
4
votes
1
answer
1k
views
Simple rainfall animation in Pygame
I made the following code. It's a simple animation of 'raindrops' falling and splattering once they reach the ground. The images I use can be found here: https://i.stack.imgur.com/oKOVA.jpg
...
8
votes
1
answer
621
views
Double pendulum animation with tkinter
here is my first project : I have made a double pendulum animation with tkinter on Python. Can you give me some feedback on what can be improved ?
Thanks !
Code :
...
3
votes
1
answer
503
views
Gradient Descent Algorithm using Pandas + GIF Visualization
Happy new year everyone, Following Andrew NG's course on coursera here's my implementation for the gradient descent algorithm(univariate linear regression) in Python using pandas, matplotlib with ...
1
vote
1
answer
457
views
Tower of Hanoi, ASCII animation with ANSI escape codes
A few days ago I saw a nice video on YouTube with prof Thorsten Altenkirch about recursion and the Tower of Hanoi puzzle. Today I tried to reproduce the code from the video and came to this:
...
9
votes
1
answer
2k
views
Maze image solver and animator in Python
This maze solver is a continuation to the maze generator I posted here recently Maze generator & animator in Python
This code takes an image containing a 2-color maze as input and solves the maze ...
13
votes
1
answer
3k
views
Maze generator & animator in Python
This is a follow up to this code and I still did not get the feedback on the drawing functions
Maze generator in Python- Gif animator-Custom colors/sizes
The code generates custom color and size ...
9
votes
1
answer
864
views
Maze generator in Python- Gif animator-Custom colors/sizes
This Python code generates mazes with color and size customization. I intend to add several new maze generating algorithms(Sidewinder, Kruskal, Prim ...) to the Maze class but for now, there is only ...
2
votes
0
answers
55
views
Matplotlib realtime monitor
I would like to share a matplotlib real-time monitor plot that I needed for another application. Basic trick is to reverse the time, so that t=0 is now and t=20 is twenty seconds in the past and to ...
3
votes
1
answer
88
views
Print file out 1 character at a time in the terminal - Python
This program opens a file and prints the text out to the terminal 1 character at a time and at a predetermined speed using time.sleep()
Simple and maybe, if you ...
6
votes
2
answers
285
views
pydoro - terminal tomato timer
I've recently created a tomato timer for terminal. It's hosted in github.
My concerns are how Pythonic my code is? Is the way I'm handling state transitions good? Which areas of the text user ...
3
votes
0
answers
320
views
Animation of an incremental rotary encoder
While reworking my teaching materials for an exercise of an introductory course on mobile robotics, I recently created a animation/simulation of an incremental rotary encoder, e.g. often used for ...
3
votes
0
answers
65
views
Pygame : processing speed independant image loop displayer
I made this in order to teach myself pygame.
This displays an images loop at the same speed on any computer (It will lag on a slow computer).
Is my time management good or do my datetime call could ...
6
votes
1
answer
891
views
Golf Physics "Game"
Continuation of this post
I wrote a program in pygame that basically acts as a physics engine for a ball. You can hit the ball around and your strokes are counted, as well as an extra stroke for ...
13
votes
2
answers
773
views
Sierpiński's carpet fractal animation for teaching Python 3
I am teaching programming (in this case - 1 on 1 tutoring of a teenager interested in programming) and this code will be a final stage of a progression toward program generating a nice image of ...
8
votes
1
answer
405
views
Runner 1-bit game in Python like the offline chrome dino
I made this little game to test if my Nokia 5110 screen can handle games. As in handle many frames per second/game loops.
I am using a library made for this screen called Adafruit_Nokia_LCD
These ...
2
votes
1
answer
59
views
Looping text in Python with directional control
The code is an implementation of looping text (similar to a circular buffer - wraps around when it reaches the edge of the defined bounds) with directional control.
The code is functional and works ...
7
votes
1
answer
300
views
Time delay indication bar for a text game
For a game I am writing in Python 3.6.5, I made a text-based animation to indicate the passage of time (when chopping a tree or mining a rock, etc). I did a lot of trial and error to get the output ...
14
votes
2
answers
442
views
Counting people inside the house game
This program animates people going inside and outside of a house, the user has to keep a running sum in their head and must give the answer at the end.
The speed of people, the number of maximum ...
8
votes
1
answer
1k
views
Animation of linear transformations
Coordinates
Given a 2d space, we can fix a coordinate system to talk about transformations numerically.
The red vector, that ends at (1, 0) and the green vector that ends at (0, 1) are called the ...
6
votes
0
answers
744
views
Laminar flow in a pipe animation using Tkinter
I wrote this simple particle flow animation with Tkinter. I wanted to ask if there is some major improvements you can think of regarding the animation motor or the documentation of my code? I noticed ...
4
votes
0
answers
283
views
Implementing a TTY loading / waiting animation
I implemented a class to animate waiting for processes:
...
5
votes
3
answers
18k
views
Python tkinter bouncing ball animation
In the current code, the animation is very unclear, and not "polished" (it doesn't run smooth).
Can I make the animation smoother?
And/or, why it doesn't run smooth?
...
3
votes
2
answers
727
views
Maximize the number of PyGame sprites, with collision detection
I was trying to see what is the highest number of moving and colliding boxes (sprites) I could get in pygame? So that I could start working on game I want, I searched google and I found different ...
5
votes
1
answer
71
views
Drawing a roaming figure in a field, with less flickering
I'm a student to programming. I currently just working a thing where the player can walk around a field of hashtags. so far you can only walk horizontally but before i go any further, i realized that ...
9
votes
1
answer
5k
views
Flipbook type animation with Tkinter
I am writing a program in Python that takes a folder of images and animates them.
For example, going through a list of pictures like this and animating them one by one:
Relevant features include:
...
2
votes
1
answer
2k
views
Scrolling game very slow
I am trying to make a scrolling game in Tkinter. However, with all my for loops and functions it is extremely slow.
I am reading the tutorial from Khan Academy's advanced JS. In their JS game ...
127
votes
6
answers
17k
views
How clean is my snow?
I just wrote a snow animation in Python. I think this is fairly clean but I have a few things that I don't like.
...
6
votes
1
answer
1k
views
Sample Python dodger game
I got my game working for so far, however, I would like the game to run faster. It's running at approximately 26 FPS when most of the blocks come in; my FPS goal would be about 60 FPS.
...
3
votes
2
answers
641
views
Console animations
I'm a coder who's relatively new to Python and I wanted to spice up my console applications a bit by making animations. The code I've written works perfectly, but I just wanted to know if it was good ...
8
votes
3
answers
3k
views
Python Turtle screen saver
Leon asked a question which got closed both here and at Stack Overflow, but I kind of liked the idea, so I implemented a working version of his code, which I now want reviewed.
With regards to Leon's ...
3
votes
1
answer
1k
views
Generating SVG animation of falling leaves
This is a Python script I wrote to generate a SVG animation of falling leaves.
How can I simplify my script and also make the animation look more realistic?
...
-1
votes
1
answer
351
views
Optimizing this SVG animation for size [closed]
I'd like to code review generated svg animation, while this might stretch definition of this site, I really hope this is interesting and revelant topic, as this SVG file is really like any other ...
7
votes
1
answer
2k
views
Optimizing very simple piece of “Game of Life” code by taking advantage of NumPy's functionality
Here is the code as it stands right now:
...
2
votes
2
answers
7k
views
Animation with 5x5 map of cubes
I am trying to learn how to animate with tkinter. The code below is an example I was able to build. It creates a small 5x5 map of cubes, then one of them randomly moves around the screen (preferably ...