For questions related to graphical animations. This includes, but is not limited to sliding, tweening, rotating and resizing of shapes.
13
votes
1answer
2k views
Bouncing stacking boxes
I'm not sure if it would be better to make the envelope into an extension of the Rectangle constructor.
The physics seem a bit dodgy, it works well most of the time, but sometimes the boxes overlap ...
3
votes
1answer
46 views
3
votes
1answer
75 views
Loading GIF form on a Windows console app using threads
I have a main form which does processing for an extended period of time. Normally, progress bars are used to show either the loading status or simply show the program is still running/hasn't freezed.
...
3
votes
1answer
47 views
Loop Animation on several UIButton's NSLayoutConstraint
I took the belated plunge to look at Autolayout. Normally I'd animate based on a UIView's frame (i.e I'd have used the following):
...
5
votes
1answer
36 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.
...
2
votes
1answer
65 views
UISegmentedControl with view-animation
I have create a UISegmentedControl and a view under it. The view under contains all a view for each segment. I am doing an animation when the segment is changing.
...
4
votes
2answers
57 views
GameLoop with requestAnimationFrame
I am creating a HTML game where you fight monsters and stuff and this is part of the game loop for dealing damage:
...
7
votes
1answer
131 views
Shortening/refactoring jQuery animation code
I know this is a mess! How can I write this code better?
...
2
votes
0answers
51 views
Logo animation code
I want to know if there is a better way to write this code. I'm struggling a little bit with best practices in jQuery.
...
3
votes
2answers
88 views
Acceptable way of using jQuery methods in Angular directives
Here is my plunker example of what I am doing.
jQuery is a great way to use slide transitions and seem to work well with angular as long as you are only using the methods on the element object inside ...
7
votes
1answer
143 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:
...
10
votes
3answers
151 views
CSS3 heavy transitions performance enhancement
I am building a website with heavy CSS3 transitions. The menu is hidden on the left and slides in on hover pushing the main content right. The menu contains transformed elements and has a semi ...
2
votes
1answer
80 views
Loader animation using Custom View in Android
I created a loader animation for an Android app: a simple 3 dots loader.
Is this the correct way to animate by using TimerTask?
...
12
votes
3answers
337 views
A flashing ! exclamation ! point ! bar
I have this Objective-C code for use in an iOS app that makes a 'bar' on the screen, with a red exclamation mark that flashes in it at random places.
Here's what it looks like:
Header file:
...
2
votes
1answer
52 views
Optimization of recursive jQuery images swap function
There's this website I'm working on that needs to swap images every few seconds, like a slideshow or image fade swap in a way, except that you need to target 5 IMG tag elements. I was able to make a ...
10
votes
1answer
171 views
Making a square move counter-clockwise around the edge
This is so ugly code. There must be better way to write it, but I'm noob to AS3.
The goal is to make a square move at even speed counter-clockwise around the edge and on call ...
3
votes
1answer
49 views
Simpler way to write my animation code
I have wrote some animation code below, and it's what I class as oldschool.
As you can see, there is a lot of repeating code.
Ideally I would like to be able to take the delay and left or right ...
5
votes
1answer
94 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. ...
6
votes
1answer
59 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 ...
5
votes
1answer
77 views
Sprite is Refreshing
I am using "AndEngine" and I would like to know if I am following the best practice when I want to refresh the entity.
Let say, I have 2 sprites and I want change them into 2 another sprites.
I ...
0
votes
1answer
67 views
Drawing multiple Images
Im trying to draw a lot of fields image for my world generation, all is perfect 64 fps, but if i began to draw all the time the grass it became laggy, like 59 fps (something that musn't happen! :( ), ...
21
votes
4answers
2k views
Snowfall in HTML
I am a beginner and I have made Snowfall in HTML for my mom. I'm pretty sure it will not look that awesome to any developer out there, but hey, that's why I've posted it.
I'd like a general review of ...
5
votes
2answers
124 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 ...
1
vote
0answers
209 views
Optimizing snap SVG animation with collision detection
I have a snap SVG animation which animates a bunch of circles, and draws a line between them if they are within a certain proximity of each other. However, I realize that there is a lot of optimizing ...
2
votes
3answers
80 views
jQuery animation/blinking code?
I have one container div which contains some children div members. From time to time, I need to run a custom blinking effects on ...
0
votes
1answer
71 views
Optimizing this SVG animation for size
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 ...
8
votes
2answers
153 views
How can I optimize this Particle system, bottleneck of my game?
Please note that I'm working on a game on Windows Phone 8 using Monogame. The game is fine (60fps) all the time, except when the particle system is activated. This is just a smoke particle system that ...
2
votes
1answer
389 views
Updating a jquery progressbar via button clicks
I'm trying to get my progress bar animated. I'd like it to smoothly transition in between the starting and destination values, but only be initiated by clicking the continue button.
The code I ...
0
votes
1answer
361 views
CSS Ticker Animation
I have never use css animations before, so I just want to know, is this the 'best' way to animate a Ticker? I 'best' in this case encompasses efficient and semantic use of html and css.
It's worth ...
5
votes
1answer
91 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 ...
2
votes
1answer
72 views
How to simplify this promise-driven animation code?
Inspired by this question on StackOverflow I've attempted to code such animation, mostly to get some more practice with async, promises and Q.js. Here's what I got:
(Live demo)
...
5
votes
1answer
1k views
Alternative to setInterval and setTimeout
Alternative to setInterval and setTimeout
JavaScript's setTimeout and ...
3
votes
1answer
71 views
Single Rotate Method
I just started coding a simulation-like application. It's about our solar system. Right now, I'm working on rotating the moon. I have this constructor
...
5
votes
1answer
42 views
Simple Optimisation for Sprite Animation
This code animates my main game sprite by increasing the animation frame. How can I make it more elegant and optimised in terms of speed?
...
1
vote
1answer
54 views
Eliminate nested HTML elements for jQuery animation?
Background
When a user leaves a page, if they haven't submitted form data, a button is animated to draw the user's attention. (This is a poor UX choice--all the form data should be submitted--but it ...
7
votes
2answers
209 views
Cleaning up and commenting on my code for Pong game
This post is a follow-up to When should I consider the number of my method arguments too big?
I took the some advice from previous post and I'm almost done with cleaning up the code.
I didn't make ...
10
votes
1answer
327 views
When should I consider the number of my method arguments too big?
I'm writing a simple Pong game, I have a method bounce() that makes everything run: the ball, the paddles, score etc. and it uses 12 arguments: 3 counters, 2 ...
5
votes
1answer
283 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:
...
14
votes
2answers
305 views
My animation code is lousy
When a user presses a key in my game, their avatar can move down, left, right or up. By move, I mean their avatar animates while various other things move around them on the screen. This is ...
4
votes
1answer
369 views
Bouncing ball in JavaScript
I have been using this code for a while for a project at work. Actually I got it from a friends who got it from a book. But either way it worked for my demonstration.
But the other night I decided to ...
2
votes
1answer
196 views
Best way to refactor this loop of animations with delay?
I have some animations happening after some delay calls the code to animate. It works fine, but the code to call the functions is not nice.
...
3
votes
1answer
117 views
Small animation with Raphael
I have a small animation with Raphael using a large amount of code. Is there any way to reduce it?
Demo
...
6
votes
2answers
233 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 ...
2
votes
4answers
230 views
Using visual themes in a game
In my small application, I need to use a variety of visual themes.
The simplified structure of this class:
...
2
votes
3answers
130 views
Animating the opacity of certain page elements
I wrote this jQuery code to animate the opacity (sort of Fadein) of certain elements on my page in consecutive order. It feels very inelegant, though.
...
2
votes
2answers
3k 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 ...
4
votes
2answers
304 views
Is this the correct approach to animation in Java?
I was fiddling with animation in Java and wrote this:
...
2
votes
1answer
897 views
Making these timeline animations faster for mobile devices
I recently made this campus timeline for my university.
My question is this: When viewing the timeline on a mobile device (not a tablet), the navbar changes so that you can jump to the previous or ...
2
votes
1answer
123 views
Animation for collapsing/expanding a navigation bar
I wrote the following to create an animation which collapses a navigation bar, load new content for it and expands it again. Meanwhile, the rest of the page content fades out, loads and fades in ...
5
votes
1answer
136 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 ...