Skip to main content
33 votes
Accepted

Loading... animating dots in C

Too frenetic I ran your program but it was very frenetic. It was constantly clearing the "Loading" prompt and reprinting it which resulted in a flickering effect. In addition, the cursor also moved ...
JS1's user avatar
  • 28.5k
14 votes

Maze generator & animator in Python

This is a tip I make a lot, but if you have a collection that's simply tracking "membership", and you don't care about order, you should consider using a Set over a List. I think this is the case for ...
Carcigenicate's user avatar
12 votes

Loading... animating dots in C

You can get rid of that flickering green box by disabling the cursor. fputs("\e[?25l", stdout); /* hide the cursor */ If you want it back, you can re-enable it. ...
syb0rg's user avatar
  • 21.8k
12 votes
Accepted

Counting people inside the house game

You're right - there is a lot of duplication. Also, some organization is needed. Organize! Before you do anything else, get everything into a function of some kind. All those statements at module ...
aghast's user avatar
  • 12.4k
10 votes
Accepted

Human-like mouse movement

You can get much cleaner code and more readable code if you do 3 things: Use OOP and custom types to better encapsulate values Use more descriptive names Write more helper methods that encapsulate ...
Dan Oberlam's user avatar
  • 7,814
10 votes

Countdown control with arc animation

There are a couple of things which could be more consistent. ...
Peter Taylor's user avatar
  • 24.1k
8 votes

Loading... animating dots in C

I would probably tie this into whatever code is actually loading something, and print a new dot (or use a /-\| spinner) every 100 kb or whatever number makes, ...
Random832's user avatar
  • 366
7 votes

Loading... animating dots in C

Instead of the double for loop: one for dots and one for spaces, you could write combined one: ...
I'll add comments tomorrow's user avatar
7 votes

Countdown control with arc animation

1) DispatcherTimer is good for periodic UI updates, but it should not be used to measure time, because it is just not accurate enough. For precise time measurement ...
Nikita B's user avatar
  • 13k
6 votes

Parallax animation, running well on Chrome but slow on Safari

The major issue that I see in your code is that you keep requestAnimationFrame no matter what. This obviously causes the browser to update the css of the element at ...
Bruno Costa's user avatar
  • 5,566
6 votes

UIButton subclass with animated 'shimmer' effect

Okay, so sometimes posting a question is the best way to figure out an answer yourself 🙃. I was looking for an alternative to having the gradient colors evenly spaced (my hack was to repeat the ...
MathewS's user avatar
  • 653
6 votes

Interactive small town

JavaScript The loop that generates people - an expensive bridge to cross ”...DOM access is actually pretty costly - I think of it like if I have a bridge - like two pieces of land with a toll bridge, ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
6 votes
Accepted

D3js: transition from stacked bar chart to bar chart with different datasets

Before dealing with the "enter", "update" and "exit" pattern, which is specific to D3, I'd like to address some general issues first. Do not mix jQuery and D3: this mix is normally unnecessary. Not ...
Gerardo Furtado's user avatar
6 votes

Counting people inside the house game

I noticed that you are repeating some of the code under animate_person_going_inside and `animate_person_going_outside functions. Also when rendering the text, some ...
alpha_989's user avatar
  • 215
6 votes
Accepted

Ring Timer Animation with Chasing Tail using CoreAnimation

There is one problem with your approach: Additional sublayers are added in draw() and in animateTimerReset() and never removed. ...
Martin R's user avatar
  • 23.3k
6 votes
Accepted

Time delay indication bar for a text game

You can use bar.count rather than your sum You can use ' ' * n, rather than your for loop. ...
Peilonrayz's user avatar
  • 43.4k
6 votes

Basic orbiting planets in P5.js

Use of p5.js and JavaScript Math is part of the standard JavaScript library. You shouldn't pollute its namespace with your own code, because it could interfere ...
200_success's user avatar
6 votes
Accepted

Sierpiński's carpet fractal animation for teaching Python 3

Algorithm You can simplify the code and make it run faster if you construct the next-level carpet by continuing to work on the previous image (punching more holes in it), rather than starting with a ...
200_success's user avatar
6 votes

Maze generator in Python- Gif animator-Custom colors/sizes

Type hints row_index, column_index, rows, columns I can guess that these are all int based on the docs. But adding ...
Reinderien's user avatar
  • 62.4k
6 votes

Bash script simple countdown timer with dotted output

Validate inputs The script quietly ignores invalid inputs. It would be good to add some validation logic and fail when used incorrectly. Since the counter* ...
janos's user avatar
  • 111k
5 votes
Accepted

Animation of java.awt.Polygons

Conceptual Problems You have hard coded the animation FPS as ANIMATION_FPS = 60. This is a big no-no! You are assuming that your code will be called exactly with ...
Emily L.'s user avatar
  • 16.6k
5 votes

Animation of java.awt.Polygons

Use the right tool for the Job - Timer instead of SwingWorker Using the right tool for the job will significantly simplify your ...
Christian Hujer's user avatar
5 votes
Accepted

Python tkinter bouncing ball animation

Your animation isn't smooth because the ball is jumping 9 pixels for every frame. If you want smooth animation, change your "speed" to a much smaller number. Animation is a set of trade-offs. The ...
Bryan Oakley's user avatar
  • 2,089
5 votes
Accepted

2D falling snow animation

Tween is not a very good name. How about Snowflake? And why is it a struct and exposing all ...
Summer's user avatar
  • 2,330
5 votes

2D falling snow animation

I see some things that may help you improve your program. Use objects The Tween struct is a start, but this code would really benefit from the use of actual ...
Edward's user avatar
  • 66.5k
5 votes

C++ console progress display

There are several things you can do to improve this code. First of all the code above isn't a valid C++ code. To run it you need to add: ...
Sandro4912's user avatar
  • 3,076
5 votes

Webpage with a preload animation using JavaScript setTimeout

I would make the following recommendations to clean it up for future maintainability and readability: Clean up and remove the anonymous functions. They aren't really needed here and just create ...
Hazel へいぜる's user avatar
5 votes
Accepted

Unity animations code

That moment when you know Unity better than C#. I'm on other side: I know nothing about Unity (except docs that I've read while writing this review) but know C# well. Let's merge our knowledge. ...
aepot's user avatar
  • 2,019
4 votes

Optimizing rendering with a lot of transformations and save/restore

I see this was the second javascript question you posted here and it is unfortunate that there have been no responses in the nearly four years since then. Perhaps you have learned a few things about ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
4 votes
Accepted

Creating and playing animations for a game using LibGDX

First of all, it's a pleasure watching your games evolve, keep it up! Data management Most of the code is about data. Creating all your objects with their behaviors programmatically is tedious, not ...
janos's user avatar
  • 111k

Only top scored, non community-wiki answers of a minimum length are eligible