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
16
votes
2answers
1k views

Sprite animation handler

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 ...
7
votes
2answers
408 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 ...
2
votes
1answer
329 views

Number processing slower with asm.js

I did a few times ago what I called a plasma in plain JavaScript: jsFiddle The idea is to use 2 oscillators (LFO) which have their frequency + phase driven by two oscillators each. Then we use those ...
5
votes
3answers
159 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 ...
12
votes
2answers
1k views

Microsoft logo animation

I made an animation of the Microsoft logo. It's available as a CodePen doodle, also. Would anyone be so kind as to check my style and say if there is anything I could've improved? (I am sure there is.)...
3
votes
1answer
103 views

Manual slide-in animation using delta time

I created a simple slide-in animation for my game. The box is shown at the bottom with character dialog. The animation is as follows: A square slides in from the left, then waits a bit, then expands ...
2
votes
2answers
1k views

Wobble-free progress spinner

I've been looking for quite some time to fix the wobbly spinner issue. Many people made numerous suggestions using fonts / pure CSS / CSS + JS. Unfortunately, none of the proposed solutions were ...
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 ...
11
votes
2answers
1k views

jQuery plugin that makes a slider out of an <ul> list

This is one of my very first jQuery plugins. In short: it makes a slider out of an <ul> list filled with <li> items ...
5
votes
1answer
3k views

Toggling a CSS animation

I'm trying to toggle a dropdown box that will appear and disappear upon clicking the button. ...
3
votes
1answer
209 views

Portfolio landing page

I'm trying to grasp this whole MVC design pattern idea but I'm in the dark if I'm doing it correct. This is where I need some feedback on what I've done so far. Here's what I'm wondering: Does the <...
10
votes
1answer
2k views

JavaScript “snow” animation

I have worked for a few hours and this is the result: ...
8
votes
2answers
2k views

Div circular scroll

Have one div: Here's what scrolling of this div should look like: The only way I see is to duplicate ...
2
votes
0answers
723 views

Interactive transition between view controllers

I have made an interactive transition controller in Swift in two different ways. This interactive transition controller is the parent class and I have few child classes which adapt the parent for ...
12
votes
2answers
2k views

Console-like printing of message JavaScript

I'm learning JavaScript and I've made a very simple little document-modifying script that prints a message as if it was someone typing into a console. It practices recursion and in my opinion, I feel ...
5
votes
1answer
59 views

Tick module for the game

I tried to look up and suck in most of the information about optimizing this operation and this is what I came up with. As it's pretty much core of the game, I really would like to have it performant ...
5
votes
1answer
537 views

Class(es) for animating objects on a canvas

I'm building a simple canvas animation engine as an exercise in learning ES6. Coming from C++ and Java, I miss static properties, but I've read that "Prototypes having data properties is generally ...
11
votes
1answer
1k views

Simple Pong game

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 ...
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 ...
4
votes
1answer
107 views

YouTube video intro, and autoscroll when video ends

This code creates an intro video using the Youtube API, screen text written by JavaScript with a typewriter kind of effect. How can I rewrite this as succinct object-oriented code? Also, I'm not sure ...
11
votes
3answers
2k views

TI-Basic Bouncing Ball Animation

Anyone who has programmed in TI-Basic is likely to have written one of these programs. The concept for this program is simple. The "ball" represented by a single point that originates from the upper ...
2
votes
1answer
2k views

Follow-the-cursor eye animation

I have code for googly eyes that is too long. Basically I have variables for each element pupils (one for right -other for left), eyesockets (left, right). I wish I could compress my code so I can ...
3
votes
1answer
131 views

Animating based on screen width

Depending on the width of the screen the JavaScript animates a node and then loops another animation. I'm trying to understand DRY but my JavaScript skills aren't quite up to scratch to get this code ...
4
votes
3answers
393 views

Sprite and AnimatedSprite

I have a Sprite class and an AnimatedSprite subclass, and I'd like to decouple these them and maintain substitutability, ...
2
votes
2answers
59 views

Maintainable way to concatenate strings in JS and vendor prefixes

I am writing a jQuery plugin which, among other things, inserts a stylesheet in the head. Additionally, I also require vendor prefixes. A lot of values are derived from variables in the script, and I'...
14
votes
3answers
2k views

Slot Machine Constructor

This is a fun little program I made of a fruit machine gambler, aka "slot machine". What mistakes am I making? How can I make this better OOP programming, less spaghetti? ...
4
votes
1answer
119 views

Update on tileMap Class

This is an update from An Update on my TileMap Class. It's a tileMap class for a top-down old-school final fantasy game. User @Tim gave me suggestions and I updated ...
10
votes
3answers
1k views

CSS3 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 ...
4
votes
3answers
139 views

Switch questions using JavaScript and CSS

I am writing a Q&A wap page and want to switch questions in one page. This is my first time to write JS and CSS code, so I think there must be some improvement. ...
2
votes
1answer
768 views

Overriding scrolling behavior for navigation elements

I am new to JavaScript, and trying to ensure the i write the best possible code instead of "copy & paste". I hope i am asking correctly, want to know if my code I have written is done correctly ...
6
votes
3answers
670 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 ...
8
votes
1answer
164 views

The effect of typing a sentence out

The following code is complete and works perfectly. What I want to do to is make it more modular in a way where I can use the code again - similar to an api. I also hardly ever code in javascript, ...
8
votes
2answers
484 views

Taking flight with JavaFX

Just another step in my educational Trek. I didn't know when/why I would use the transparent feature and in experimenting with it, I made this. This one was fun to behold once done. It's an animated ...
4
votes
1answer
2k views

D3.js interpolating line on circumference of circle

For now, I've tried to make a line rotate on the path of a circle, but used setInterval multiple times and there might be other ways of achieving the same. I would ...
3
votes
2answers
1k views

Sliding effect with bounce

I have used animate.css and jQuery as external libs. Is there a better way of doing what I have done with jQuery? DEMO ...
4
votes
1answer
637 views

Carousel for website

I have been building my own carousel over the past few days. I am not a jQuery guru, just an enthusiast, and I think my code is a little sloppy, hence the post. Basically what happens is: If someone ...
5
votes
1answer
189 views

Smoother column resize, page reveal animation

I've been working on this site. The designers original inspiration for the column layout came from this site. I've been trying to get the animation as smooth as possible, to match the smoothness of ...
4
votes
1answer
106 views

Spritesheet cut to individual frames

I need a hoverable transparent animation for a website, so that it glows when the mouse is over it. I could use two gifs or svgs one on top of another, but (as far as I know) there's no control of the ...
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 ...
1
vote
1answer
2k views

Simple GUI animation in Java

I wrote a simple animation of a ball moving across the screen. I was wondering if I used the static variable correctly. If not, how could I make it non-static so I ...
3
votes
1answer
89 views

Slow update function

I've been fiddling with Unity, trying to make nice walking/running animations. So, i found the Stealth tutorial and I used pretty much the same animator as the AI, only I only use Speed and ...
4
votes
0answers
158 views

Cellular automata path and fill algorithm

I have worked for a few days in my cellular automata path algorithm and an easy fill algorithm, but sometimes I get some weird fall in my FPS. If you need a preview ...
4
votes
1answer
1k views

Animated Score Amounts for Game

This is a simple class for a label with a score that animates counting up or down. When someone in the game scores points, the numbers count up or down to the new total. Here is an example of what ...
0
votes
1answer
657 views

Colour-changing clock

I am fairly new to javascript and I would like to write my code on a more readable and efficient way. Any critique of what I've written would be greatly appreciated, especially the section of ...
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 ...
2
votes
0answers
2k views

Simple yet incredible parallax scrolling effect

I wanted to learn how to create awesome parallax scrolling effects so I decided to look up how to do it, after some searching I put together this test. It works fine to some extent but it feels a bit ...
2
votes
1answer
362 views

Promise-driven animation

Inspired by this question on Stack Overflow, I've attempted to code such animation, mostly to get some more practice with async, promises and Q.js: (Live demo) ...
11
votes
1answer
170 views

Bedazzling My Bejeweled Animations

I've spent a few days working on the animations for my Bejeweled clone and I am pretty happy with the results so I am posting the code for review. This is the most advanced animation code that I have ...
1
vote
1answer
67 views

Repetitive event handler for a toggling UI control

I feel like this bit of code could have been written more elegantly, especially with the huge if/else statements. Can somebody help me break this down? It would really help me out in the future. <...
3
votes
1answer
2k views

Updating progress bar animation

The general idea is is a progress bar that updates the totals and percentage continually. This just gets a bit choppy when I trigger a few of these independently on the same page. I'm doing a bit of ...