Developers Club geek daily blog

Animation of the falling snow is one Canvas more effective than animation on DOM several times

1 year ago
. In comparison with native JS on the DOM elements, implementation of animation algorithms on Canvas is usually more productive many times over. It is the known fact (but with features for small number of particles as it will become clear later), and it can find implementation so everything disturbing traditional under NG, but driven by rational users of "the falling snow". That it was not enough loading, in recent years it is considered a good form "to start" snow on the website scarcely noticeable, with the minimum quantity of snowflakes (5-15). Here both the effect is, and honor loads of the processor any.

Therefore, so far to NG some more days still winter, I suggest to arrange a hakatonchik on implementation of the best algorithms on a kanvasa and their analogs on DOM, having taken as a basis generally ancient native algorithms which as at most turned back in jQuery plug-in that it was convenient to connect. The most part of these algorithms does not proportion load of the processor or is made inefficiently therefore even at small number of snowflakes load the processor for 100%. Here an example of a review article where more than 10 implementations are considered, not everything, meeting in the nature. In addition, we will consider several electees to receive a backlog on development of algorithm and implementation it with good efficiency (5-6 more options will turn out). On this basis it is possible to construct completion.

Read more »


Asterisk: each call as the jumping ball

1 year ago
These holiday days when partly has to spend time at work, but changes are not entered into the working systems any more because "soon holidays who needs your fresh bugs?", it is possible to be engaged in cutting asterisks and snowflakes from paper and small experiments.

Generally, we heard such expression more than once: "my call was kicked as a ball from the operator to the operator, and as a result bounced", and can even once it was told in a fit of temper. Also it was thought, and if to provide a call as the jumping ball from a wall to a wall and as at us several tens calls happen on an asterisk in one step, then it has to look at least funny.

What turned out? Further parts and small video.

image

Read more »


The user plug-ins in JavaScript games

1 year, 1 month ago
Who does not know, Wargaming develops tactical gambling of WoT now: Generals. The web version is written on JS, LibCanvas and AtomJS are used. I was directly involved and I want to tell about functionality which seems to me interesting and can be useful in all web games. Namely the system of plug-ins of game which was inspired by package managers in Linux and has the following opportunities:

— Change history of plug-ins
— Automatic updating of a plug-in when updating the version of game
— Development of plug-ins on localhost
— An unlimited number of branches, for example for unstable versions
— Dependences (the plug-in And automatically connects a plug-in of B)
— A consequence of the previous point — a built-in opportunity to do pack ices
— Easy change of any part of the client of game
— Complete administration control of authors of game over all plug-ins
— Search in base of plug-ins

At the same time simple installation by the user and convenient work for plaginopisets.

Read more »


The recipe of rotation of planets in space on HTML5 + JavaScript

1 year, 3 months ago
imageWithin creation of our browser space game, we were faced by task to develop simple and least resource-intensive animation of rotation of planets in star system.

We eliminate


After short selection of different ways of implementation, options have been excluded at once:
  • with gif-animation (because of low image quality);
  • with Flash (by agreement, Flash-technologies were decided not to be used in the project);
  • with animation by means of JQuery by means of function of $ () .animate (because of her gluttony).


CANVAS in the help!


So, we have stopped on use of Canvas and JavaScript, having counted this option optimum for implementation of our task.

Read more »


Map of the Moscow Subway. SVG version

1 year, 3 months ago
I continue subject of development dynamic vector (on coordinates) cards for the dbcartajs browser. In the new version (v2) I have transferred drawing of objects from kanvas on SVG. Also has remade some examples, in particular the subway map of Moscow. In the post about the kanvasny version of the card I compared it to the svg-version from Wikipedia, having placed emphasis on the load time speed which at kanvas was higher. But having reproduced the card through the svg-processor in the new version of the project, I have understood that load time speed, perhaps, the only advantage of kanvas before SVG.

image

Read more »


Visualization crystal 3d - structures in the browser without plug-ins

1 year, 4 months ago
Hi, Habr! In this article I will compare four open engines of visualization of crystal structures in the CIF format (Crystallographic Information File) popular in crystal chemistry and materials science. It will be a question of modern JavaScript (including transcompilation of Java and C in JavaScript), of crystal chemistry and solid state physics. We teleport from Shryodinger and Landau's world to Berners-Li and Jobs's world, and then back. So, have gone.

Water adsorption on perovskite surface

Read more »


Xonix on Javascript with pictures

1 year, 5 months ago
Xonix — popular game of times of DOS, video game Qix clone.

On Javascript Xonix has already been ported several times. The best and the most approximate to the original from the existing implementations today, perhaps, this. I first tried to adapt it for the implementation / modification … But, unfortunately, the code even after deobfuskation did not become clear (in any case for me). Besides, as far as I could understand, the code there in places is not absolutely effective, or at all the outdated. So all was necessary to write from scratch.

As a result at me "the" Xonix, with pictures and answers has turned out such here.

Read more »


Modeling of objects for animation on Canvas

1 year, 7 months ago
Fast and simple API, support by browsers? it that does Canvas attractive. But, as it often happens, simplicity at the same time is also weakness. Without effort, for example, it is possible to display rectangle, circle, the line or to hang the image. But to develop useful content on this simple basis? the task is slightly more difficult.

Изображение - сила canvas

On the example of development of game, approach to animation and management of game object is shown.

Read more »


Recalculation of images under different cartographic projections in webGL

1 year, 8 months ago
In post on the blog? gdal_translate and gdalwarp for pereproitsirovaniye of images? process of obtaining pictures under different projections by means of utilities of GDAL was described. I used the received images as substrate for cards in dbCartajs project examples. Later, working on porting of the kanvasny version of the planetarium on webGL described in article? The star sky on webGL with use of three.js? on Habré, I had had thought over time to transfer not only the globe, but also flat to cards on webGL, using instead of texture background. That is for creation of the card to do only use of the browser and javascript without use of server components.

image

Read more »


The HTML page on Canvas

1 year, 8 months ago
Canvas interesting and perspective HTML5 element. It well is suitable as auxiliary element on the HTML page, for example, for drawing any idle time on plot of dynamic welcome screen. However implementation of functionally finished end-to-end solutions with orientation to Canvas task any more such simple.

Image - html page on canvas

Article purpose:
  • To consider the implementation mechanism on the basis of Canvas of the full HTML page with support of dynamic content, links and controls.
  • To understand, whether it is possible to use this mechanism, and whether the game is worth the candle.

Read more »