Questions tagged [animation]

For questions related to graphical animations. This includes, but is not limited to sliding, tweening, rotating and resizing of shapes.

Filter by
Sorted by
Tagged with
7
votes
1answer
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: ...
7
votes
2answers
399 views

jQuery plugin to cycle through text and “typewrite” it out

I have written a jQuery plugin (my first for a long time) that simply cycles through strings of text in a data attribute and uses setInterval to type it out - it's ...
7
votes
1answer
166 views

Upgrading animation code

I understand that this animation code is outdated: ...
7
votes
2answers
298 views

Cleaning up and commenting on my code for Pong game

This post is a follow-up to Simple Pong game I took the some advice from the previous post and I'm almost done with cleaning up the code. I didn't make any wrapper classes, because my game is already ...
7
votes
2answers
543 views

Animating a block of HTML on scroll

I'm pretty new to client side scripting and I'm still learning. I've written this JS plugin which animates blocks of HTML (fade-in from left/top/right/bottom) as you scroll down the page. Everything ...
7
votes
2answers
29k views

Check image dimensions, calculate aspect ratio, set image dimensions, resize

I have created a set of functions to calculate the aspect ratio of an image, set a height/width on document.ready and on ...
7
votes
1answer
257 views

A partially overlapping sequence of jQuery animations

I know this is a mess! How can I write this code better? ...
7
votes
1answer
270 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 ...
7
votes
2answers
1k views

Sprite animation for a game

I'm just getting started with XNA and game development in general. I followed these instructions to create a basic game, then this article to get sprite animations working. Now, I'm trying to ...
7
votes
2answers
130 views

Webpage with a preload animation using JavaScript setTimeout

I am working on a website with an animation that runs at the beginning before the content of the homepage becomes visible. I've looked at some examples of preloaders and now use that code with some ...
7
votes
1answer
1k views

Animations when navigation items are clicked

I'm a beginner in jQuery and am wondering how I could write the following code shorter, since I'm repeating a lot. Working example ...
7
votes
1answer
1k views

Algorithm simulator (bubble and selection sorts)

I am concerned where it can be improved. Main concerns are coding style. Any other improvements are welcome too. Priority is on JavaScript, review for HTML/CSS are welcome too. What it does: ...
7
votes
1answer
222 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 ...
7
votes
1answer
1k views

Scroll animations - setInterval vs. setInterval & requestAnimationFrame

I've recently made a slightly similar question with respect to the rendering performance, however my question this time is a bit different and with respect to which kind of JavaScript approach is the "...
7
votes
1answer
112 views

Animating a 2D particle “web”

I have written a small class to generate and animate one of those trendy particle webs. I plan to use this as the main background of my personal website, so naturally I'm concerned about the ...
6
votes
3answers
1k views

Bouncing ball simulation

I was fooling around with some maths and realized that I could use a parabola to represent a bouncing ball. So, naturally, I decided to make it in code. ...
6
votes
2answers
956 views

Animation of java.awt.Polygons

I made a class capable of moving Polygons around on a Polygon in a mostly smooth manner. Disclaimer: this was part of a school project (thus the use of Polygon rather than Image), but this code is ...
6
votes
2answers
167 views

Java game development image animation

I was wondering if someone could look at my animation for me to see if I am doing it correctly. I am currently programming a basic game in Java, nothing fancy though, and I just want to get the ...
6
votes
2answers
176 views

2D falling snow animation

I was hoping that someone could review this code. My main concern is that the contents of main() are difficult to read. I thought about extracting some segments of code into functions (to aid ...
6
votes
3answers
1k views

“Group” animation events in jQuery

I have a number of jQuery animation effects applied to certain elements on the page: ...
6
votes
3answers
661 views

Rotating 3D wireframe

This code consumes a lot of CPU. Could you tell me where it is possible to improve the code or change the way rendering? Or it is possible to reduce the overhead of calculations? If you are using ...
6
votes
2answers
183 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 ...
6
votes
1answer
4k views

UIButton subclass with animated 'shimmer' effect

In earlier versions of iOS the lock screen had a 'slide to unlock' element which I'm referencing as a 'shimmer' effect. The effect I'm looking for is simpler: Button starts with single color (e.g. ...
6
votes
1answer
170 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 ...
6
votes
1answer
58 views

Analyzing spoke overlaps during rotation

For a personal project that I've recently started I have to analyze the rotation of two shapes with sets of spokes, where the spokes are evenly-spaced, and split into a given number. That is, if I ...
6
votes
2answers
315 views

2D SDL Asteroids-like game

I am writing an Asteroids clone in SDL2 using in C. I have written a game loop function that seems to work with no stutter, however I would just like to ensure my game loop will be fast and efficient ...
6
votes
2answers
424 views

Particles moving around a Perlin Noise field

I made this sketch in Processing (basically Java) that consists of a bunch of particles moving around a Perlin Noise field. Each particle is aware of the position of one other particle and this ...
6
votes
1answer
619 views

JavaScript Breakout Game

I'm a novice programmer who is very new to JavaScript, and animation/graphics, and I have this breakout game on my flask website. I tried to do as much as I could from scratch, and I'm unsure if my ...
6
votes
1answer
2k views

Performance optimization on Box2D with libgdx

A few days ago I decided that I wanted to get involved with libgdx. So far I'm blown away by how simple it is to get something on the screen to work with. I'm trying to make a very simple tech demo ...
6
votes
2answers
95 views

Reducing code for animation of expanding menus

I wonder if I can reduce the code to optimize it better? ...
6
votes
1answer
2k views

Java snow animation

I was inspired by this to write a graphic snow animation in Java/Processing. It works great, but it has some design issues. The full project is here on github; ...
6
votes
1answer
2k views

Grid with images in RecyclerView

I've created a Grid with a RecyclerView similar to the GoogleIO 2014's generic media player one. GoogleIO generic music player Mine The thing is that the images ...
6
votes
1answer
79 views

Pong Game in JS

I am new to game development and took on the task to create a Pong replica due to my curiosity and interest in the field. I decided to write it in JavaScript because the game is not too labor ...
6
votes
1answer
572 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. ...
6
votes
1answer
241 views

Rotating background using Swing: performance issues

In a jPanel, I'm displaying a 1203x1203 background that I rotate every 30ms. Problem is, Swing is known to be a slow library, and I assume rotating a huge picture at a quick rate would be quite ...
6
votes
0answers
45 views

CSS image slider (no JavaScript)

HTML / CSS Slider. No JavaScript. Wanted to make an all CSS Image Slider. Though there are plenty of pre-made options setup a lot seem clunky or add a lot to load time. Have ideas for some more ...
6
votes
0answers
88 views

Android component animatable on its height

I'd like to have a code review for a component which is supposed to be animatable on its height. It's supposed to be a transitioning element. I find it quite laggy on my phone. ...
5
votes
3answers
157 views

RPG game using XNA

I know this code needs some organization like classes, enums, methods, arrays or something but I just want to know if I could have created a character movement script, thereby shortening the code ...
5
votes
3answers
8k views

Multiple random falling objects animation in Java

I am new to programming but I tried to make my code as readable as possible! Hopefully you can see what it does before you run the program. I did not implement a ups or fps controller, the animation ...
5
votes
1answer
2k views

Bouncing square in a box

I wrote my first animation in Java FX and would like a code review. I created StackPane with Rectangle. ...
5
votes
2answers
251 views

Animating Coloured Cogs

The script is for rotating 5 different coloured gears (tandwiel) on my site. I think the code can be improved and improved performance. 5x var paper isn't that smart for speed? Getting the current ...
5
votes
1answer
115 views

Game sprite animation

This code animates my main game sprite by increasing the animation frame. First I check if the character is moving, then I increase the animation counter until it reaches the desired speed, and then ...
5
votes
1answer
946 views

Parallax animation, running well on Chrome but slow on Safari

I have the following script to create a parallax effect on the page using request animation frame, it runs well on Chrome, but on Safari is lagging, I think because I run too many calculations on each ...
5
votes
1answer
79 views

Animated magazine

How can I write this code better? I'm doing an animated magazine, so I run and then clean the animation per page. ...
5
votes
2answers
668 views

Sunset animation in a canvas

I'm new to JavaScript, and wrote this little animation in canvas. I'm wondering if anyone has any suggestions as for how to improve it. When running the code, the JavaScript draws a scene of three ...
5
votes
1answer
123 views

Front End Web exercise, no HTML

I was given the following instructions Using the below HTML, using ONLY CSS, JavaScript or jQuery create the following (see attached gif animation): ...
5
votes
1answer
158 views

Improving speed of Animation class

This is a class to hold an animation and be able to refer to different animations by titles, but it seems like calling draw(Graphics2D g) and ...
5
votes
1answer
241 views

Retrocomputing scanline function

I need to refactor this code, targeted to Google Chrome (current+) to make it manageable going forward. Here is a working JSBin of the idea. The messiness comes from determining the accurate number ...
5
votes
1answer
314 views

A “pointless” animation program

The assignment description for this code is this: Each time the user clicks the Circles button, randomly colored circles flow into the display and continuously change their shapes. Here is a ...
5
votes
2answers
167 views

Consecutive animations

I'm new to Core Animations, I want to fade out two different layers one after another.I write them in a CATransaction block. I wonder if there is better approach to make such animations. ...