📜 ⬆️ ⬇️

Javascript Pseudo-3d Game. Stage 2


( Big picture )

Hello, community. I will try to be as brief as possible. This article is a continuation of the previously expressed idea of ​​a pseudo-3d game on JavaScript . I had slightly different plans, but I took into account the wishes and recommendations from the previous topic and implemented Stage 2 better than I could have presented this stage before the first article.

The main tasks of Stage 2 were to transfer the game plane from top to first-person view (in one of the following steps, the top view will return as a map) and create a roaming algorithm so that users can exchange labyrinths and be confident in their permeability ( not built on the rule of the hand, and therefore will find a way out even in a separate room).
')

Rendering


We have two rendering modes (second select) - using Canvas and using DOM. The performance of the first is higher.
Resolution affects performance. Moreover, only the parameter responsible for the width, the parameter responsible for the height is purely aesthetic. Similarly with quality. If you are interested in the details of the calculation - ask.

What do "textures" and "volumetric light" - see for yourself. By itself, when enabled, affect performance.

As browsers in my Linux with Sneakers on an old 2x Intel® Core (TM) 2 Duo CPU E4500 @ 2.20GHz and 2 gig RAM, respond:

Canvas :
Chrome even at high settings flies. Nice to play. I spread f11 across the whole screen and swim.
Fox for pleasant work wants average settings, Opera - slightly below average.

Htmldom
With this worse. Fox and Opera want low settings. In chrome, if you turn off the volumetric light (he doesn’t like to change very much) - you can run on medium-high ones. Even the Sixth Donkey under Linux quite tolerably "cooks" medium-low settings.

I recommend using Google and Canvas.

Drawing maps


The map is drawn as before. Now a short man is indicated right above the drawing field. After completing the card, you can tr.im the thread , so as not to post huge links to friends. If you want to try to pass someone's card and suspect the author of insecurity - try to poke the "C" button, the script will say whether the card is passable. For the sake of experiment, you can draw the “killer of the drifter” - I wonder if my algorithm will fall on something?

miscellanea


There are a few bugs that even I know about.
Try during the passage of the maze at the end of the address to add "& tr"

Why not wolf 3d?


Many who were engaged in such things - did it with the help of the mana from the Opera for the construction of canvas games. . And I know several such "games" that are created exclusively to demonstrate the capabilities of Java Script. What I don't like about them:
1. Very thick walls, equal in thickness to the aisles. I prefer the classic, thin walls
2. Freedom of movement is, of course, cool. But they have not achieved stable work. I decided to slightly give up freedom in favor of smaller lags.
3. If the tab is open in the next window - the percentage is eating godlessly. My processor time only deals with the movement.
4. I create a game to make it playable in the end.

Plans


If this version is greeted happily, then I will continue writing. A lot of ideas. Suggestions are accepted. Probably, the emphasis will be placed on the Canvas-version. If there is enough willing - with time I will write a Russian-language man, by how to repeat it. Already in the last version there were people. Unsubscribe to the topic, or lichku.
Walls built not by nanotechnology, but from normal thick bricks will be in one of the following versions)

Link to the maze


Open source as usual

Attention


I, the sole author of all of this, am looking for a remote and stable operation of JS-, PHP- cattle coder (I can still HTML + CSS). I want $ 2000, but I am ready for a dialogue if you have interesting suggestions. Despite the slightly freestyle of the article, I am good, serious and reliable in my work. If inspired you - write in a personal Habr, email shocksilien [at] gmail.com, icq: 275-405-682, or jabber: shock [at] jabber.com.ua

Source: https://habr.com/ru/post/85277/


All Articles