K
K
Keyten2012-03-15 21:19:18
JavaScript
Keyten, 2012-03-15 21:19:18

Is it worth making a framework?

I did a framework, abandoned it for a long time, now I remembered from this topic. The problems of html5 were clearly described there:
- HTML5 games require much more time and resources to develop.
- HTML5 games are open source, which is unacceptable for free games hosted on one portal.
- the lack of adequate packaging of the game into one file for distribution on different portals.
- lack of adequate vector graphics, since SVG is not usable.

Once thinking about this, I started developing this framework, trying to fix something. And I would like to ask: is it worth continuing? For details, I will describe the framework.
Insert something like this into the page:

html5engine.start('cnv', 'test.js');

Where cnv is the id of some canvas, test.js is a js file. Which could be, for example:
ctx.fillText('Hello, world', 10, 10);


- any script is rigidly attached to a certain canvas and cannot manage the DOM of the page (for security reasons, so that you can shove anything on your site). At the same time, you can assign event handlers to the canvas and work with both contexts - 2D and WebGL. Well, additional features.
- special classes to simplify life - some are mathematical, others - work with ... In general: Vector, Matrix, Rectangle, Ajax, Class, Color ...
- additional features for working with different audio and video.
- with any ajax request, an additional header is sent, through which it can be recognized (for security purposes from any kind of CSRF) - implemented by replacing XMLHTTPRequest, where the original xhr is stored in the depths of the closure.
- well, a bunch of additional utility functions, such as Array#each #first #last, String#camelize, etc...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Aquahawk, 2012-03-15
@Aquahawk

no, it's not worth it. Frameworks don't work that way. Here you make a game, get disappointed in the approach and architecture and make a second one. Then, when you make the third one, select the framework from the fluorine and make the third one on it. That's when it becomes a normal fremwork.

E
egorinsk, 2012-03-15
@egorinsk

> any script is hard-wired to a certain canvas and cannot manipulate the DOM of the page (for security reasons
Are you sure you can implement it? Plus, I don’t understand why it is needed.
> special classes to simplify life are
extra brakes
> every ajax request is sent an additional header through which it can be recognized (for security purposes from any kind of CSRF)
Some kind of nonsense.
> well, a bunch of additional utility functions, such as Array#each
They already exist in W3C browsers, but there is no canvas in IE.
Better tell me how you will support IE7/8, how to solve problems of canvas incompatibility in different browsers, performance problems. It is much easier to make a farm on Flash, it will work in all browsers released over the past 10 years, and it is easier to find a flasher on the labor market than a competent HTML5 coder.
I think until you have a clear understanding of how to solve these problems, it is pointless to do something.

V
Vitaly Zheltyakov, 2012-03-15
@VitaZheltyakov

I read your question carefully (I read it 2 times!) - You are targeting the wrong type of games. You are targeting small casual games, and you need to take a look at independent large browsers.
Flash, of course, is a good platform for writing games, but it also has a number of problems.
Games on Canvas or WebGL are original, but not "efficient" - they will never fully compete with Flash.
But the "standard" large browser games based on sprite animation and game js engines will soon begin to revive, because. HTML5 opened up a lot of new possibilities for them. Here is the place for your framework.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question