📜 ⬆️ ⬇️

mySQLgame 2.0

Tired of monotonous browser games, which are just a set of buttons that send requests to databases? Meet Lone lord - a game in which there are no buttons and in which you need to write queries to the database.




By sending certain requests in a format similar to the MongoDB syntax, you can: build and upgrade castles and towers, mine diamonds and wood, attack neighbors, trade in markets, exchange resources in the State Bank Lone lord, unite with other players in clicks and fight in large feudal wars!
')
Despite the title, the game is not a continuation of mySQLgame , but is its natural evolutionary development: unlike the “first part”, Lone lord has trade, exchange and resource extraction, integration into clicks and convenient game chat. And we have bots.

Yes, unlike most online games, bots in the Lone lord are not prohibited, but welcome! In just 10 diamonds, you will receive a faithful servant, an assistant in trade and resource extraction, a postman, a head of a gaming casino - the bots' capabilities are limited only by your imagination and loose rules .

Do not wait, register now and get a 2.5x bonus to start resources!

Technology



An article on a technical resource will be incomplete without a description of the technologies used and the process of creation.

The game was developed exactly one month under the impression of the aforementioned mySQLgame with the desire to make useful improvements and eliminate the fatal flaw.

Both server and client parts are written in CoffeeScript, a language with a Ruby-like syntax compiled into JavaScript. The server used Node.js with Engine.io for processing requests, JADE for layout, Stylus for styles. Database - SQLite.

On the client, instead of the traditional jQuery, I decided to use Zepto.js , which is compatible with the first one at the syntax level. The size of the minified JS-file for the latter turned out to be 4 times smaller than that of the more well-known library, but support for all versions of IE was lost. They say that you can patch it up somehow and add support for IE9-10, but I could not do it.

Chat and log in the game are implemented on web sockets using Engine.IO, so that you will be attacked or that one of your towers brought a long-awaited diamond, you will know instantly. :)

To parse requests from the command line, I used a library that I accidentally came across on Stack Overflow - jsonlite. It allows you to write JSON-requests without quotes wherever possible, which is very convenient when typing a large number of commands.

Links


A game
Game (compact version)
Wiki ( where to start , command syntax )

PS Be careful. It is quite possible that under all this there is a really interesting game ...

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


All Articles