Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [animation]

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

5
votes
1answer
483 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 ...
3
votes
1answer
102 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
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 ...
18
votes
2answers
1k views

A Nightmare on setTimeout Street

I have script which plays audio, shows/hides elements: ...
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? ...
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'...
2
votes
1answer
715 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 ...
4
votes
3answers
138 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. ...
6
votes
3answers
638 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 ...
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 ...
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 ...
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, ...
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
111 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 ...
4
votes
1answer
100 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 ...
8
votes
2answers
469 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 ...
5
votes
3answers
154 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 ...
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 ...
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
326 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 ...
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
626 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 ...
3
votes
1answer
207 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 <...
3
votes
2answers
378 views

Animation that cycles through background colors

I am doing a background image animation using the function. It works, but I think I am doing more coding than what it requires. Can anyone please help me to minimize it? Don't recommend the CSS ...
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 ...
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 ...
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. <...
11
votes
1answer
167 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 ...
6
votes
2answers
165 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 ...
4
votes
2answers
6k views

Elevator program code challenge

I recently applied for a job where the company gave me the following prompt for a code challenge. They have since told me "yeah, no thanks" but provided me with no feedback about why they came to that ...
10
votes
1answer
1k views

JavaScript “snow” animation

I have worked for a few hours and this is the result: ...
5
votes
1answer
188 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 ...
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 ...
7
votes
3answers
8k views

Simple random falling object 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 an ups or fps controller, the animation ...
1
vote
0answers
522 views

CPU friendly infinite text scroller - velocity

I've done some research today and read a lot about JavaScript performance. I learned that animating using the transform: translate makes a use of the GPU, hence ...
7
votes
2answers
383 views

Set theory clock code

I wrote some JS to power an HTML/CSS "set theory" clock, and I'd like to share what I have so far and ask if anyone can suggest improvements. Specifically, I'm wondering: Should I bother checking to ...
22
votes
1answer
904 views

Simon Says: “Make me a circular window”

This is my first time messing with non-rectangular windows and animations in WPF, so while I'm working on all the bugs I'm having with the actual game code, I'm submitting the XAML for review - I don'...
2
votes
1answer
44 views

Two sprite-drawing functions for Amara game

Ideally I would have one draw method in the parent class (Player). But I can't figure out how to do this. I don't know if there is anyway to decouple it totally. I ...
6
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 ...
3
votes
2answers
2k views

Remove, Append, and Resize Using jQuery

I'm trying to essentially replace an element and make it transition smoothly to the new size... I started off trying to work with the appended element itself, but the padding and margins made that ...
5
votes
2answers
160 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. ...
3
votes
1answer
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? ...
10
votes
1answer
270 views

Processing.js particle system

After about half an hour of fooling around with Processing.js/JavaScript, I got this fairly decent particle system set up: ...
5
votes
1answer
1k views

Custom marquee consumes a lot of CPU power

I've a code which applies marquee to certain elements by using the requestAnimFrame method. However, when I test my application on a lower spec PC (Intel Celeron 2....
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
95 views

Reducing code for animation of expanding menus

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

Thread, handler and activity structure for a bouncing ball animation

This is a custom MyActivity class with two custom views (bar and a ball): ...
2
votes
1answer
302 views

Loading screen animation

I am trying to make a loading screen but my code isn't DRY. How could I make it DRY? I have thought about using CSS3 keyframes but I might have problems cross-platform. ...