All Questions

Tagged with
Filter by
Sorted by
Tagged with
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 ...
Konchog's user avatar
  • 187
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 ...
Redsbefall's user avatar
  • 1,132
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 ...
pmpyt's user avatar
  • 41
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 ...
codingCat's user avatar
  • 131
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 ...
Richard's user avatar
  • 57
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 ...
CMTT's user avatar
  • 91
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 ...
JSogaard's user avatar
  • 151
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 ...
Mitchell van Zuylen's user avatar
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 : ...
Flewer47's user avatar
  • 193
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 ...
watch-this's user avatar
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: ...
Jan Kuiken's user avatar
  • 1,471
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
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 ...
Bruno Vermeulen's user avatar
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 ...
johnashu's user avatar
  • 423
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 ...
JaDogg's user avatar
  • 4,531
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 ...
AlexV's user avatar
  • 7,244
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 ...
Heetola's user avatar
  • 131
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 ...
Alec's user avatar
  • 425
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 ...
reducing activity's user avatar
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 ...
Offtkp's user avatar
  • 371
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 ...
Yaseen Ssenyonjo's user avatar
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 ...
ShroomBandit's user avatar
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 ...
Caridorc's user avatar
  • 27.5k
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 ...
Caridorc's user avatar
  • 27.5k
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 ...
Putzikki's user avatar
4 votes
0 answers
283 views

Implementing a TTY loading / waiting animation

I implemented a class to animate waiting for processes: ...
Richard Neumann's user avatar
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? ...
sheldonzy's user avatar
  • 407
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 ...
مهند عبد الجليل's user avatar
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 ...
carrot soup's user avatar
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: ...
Joe's user avatar
  • 143
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 ...
Sruthi Kurada's user avatar
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. ...
J Atkin's user avatar
  • 1,800
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. ...
Carlos John's user avatar
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 ...
SemAllush's user avatar
  • 191
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 ...
holroy's user avatar
  • 11.5k
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? ...
kyle k's user avatar
  • 1,517
-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 ...
jb.'s user avatar
  • 345
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: ...
bzm3r's user avatar
  • 399
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 ...
EasilyBaffled's user avatar