Tag Info

New answers tagged

0

I've edited your example, you can now rotate using the keys, it uses CSS3 rotations. If you want to move more fluid, you can either update the move() faster, or add some easing animations. You can still make several improvements, but here is one solution: http://codepen.io/anon/pen/jPraGK The css rotation code: $("#block_green").css({'-webkit-transform' ...


2

System.currentTimeMillis() should be changed to System.nanoTime() / 1000000; currentTimeMillis has an issue in it that sometimes comes back with a weird number and in games causes twitching in animations and graphics


0

Sometimes images might be loaded to GPU memory and canvas in host memory. In that case when you draw from image to canvas the image data has to be copied first to host memory and then to canvas. I noticed that kind of behaviour with Chrome, when I was writing project which loads over 100M pixel images and then reads parts of them to small 256x256 canvas ( ...


2

Clearing the screen is only one half of the puzzle. I'm going to bet you also only re-draw the rectangles if/when they move. To confirm, you could make the red cube continue to move across the screen, I would expect there to be no graphical glitches. The solution: Draw everything (on screen) every frame. There are fancier ways to deal with this, but they ...



Top 50 recent answers are included