"JavaScript (sometimes abbreviated JS) is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles." From Wikipedia. ...
43
votes
18answers
15k views
What are good JS libraries for game dev? [closed]
If I decide to write a simple game both text and graphical (2d) what libraries would I use? (Assume we are using a HTML5 compatible browser)
The main things I can think of
Rendering text on screen
...
33
votes
7answers
1k views
Managing text-maps in a 2D array on to be painted on HTML5 Canvas
So, I'm making a HTML5 RPG just for fun. The map is a <canvas> (512px width, 352px height | 16 tiles across, 11 tiles top to bottom). I want to know if there's a more efficient way to paint the ...
31
votes
2answers
2k views
In a browser, is it best to use one huge spritesheet or many (10000) different PNG's?
I'm creating a game in jQuery, where I use about 10000 32x32 tiles. Until now, I have been using them all separately (no sprite sheet). An average map uses about 2000 tiles (sometimes re-used PNG's ...
29
votes
20answers
4k views
Examples of good Javascript/HTML5 based games [closed]
Now that Flash is largely being replaced with HTML5 elements (video, audio, canvas, etc.) are there any good examples of web-based games built on completely open standards (meaning Javascript, HTML ...
27
votes
9answers
9k views
How do you prevent your JavaScript / HTML5 web game from being copied or altered?
I'm in the middle of planning a game built using JavaScript and HTML5.
I'm having trouble understanding how you could prevent someone from simply copying the JavaScript from the web server and ...
22
votes
12answers
10k views
Isometric game engine in JavaScript/HTML5 [closed]
Is anybody aware of any stable-ish (ie out of alpha) isometric drawing engines for JavaScript/HTML5? I have done some Google searches and found a few, but they were mostly in alpha/invite-only ...
21
votes
3answers
5k views
Double buffering on HTML5 Canvas game?
My simple canvas game seems to work fine on Chrome and FF on Mac/Linux. I haven't had chance to test it on smart phones or Windows environments yet. It doesn't use double buffering but I have seen ...
19
votes
7answers
7k views
HTML5 Game (Canvas) - UI Techniques?
I'm in the process of building a JavaScript / HTML5 game (using Canvas) for mobile (Android / iPhone/ WebOS) with PhoneGap. I'm currently trying to design out how the UI and playing board should be ...
18
votes
6answers
2k views
Anti-cheat Javascript for browser/HTML5 game
I'm planning on venturing on making a single player action rpg in js/html5, and I'd like to prevent cheating. I don't need 100% protection, since it's not going to be a multiplayer game, but I want ...
17
votes
5answers
3k views
Implementing features in an Entity System
After asking two questions on Entity Systems (1, 2), and reading some articles on them, I think that I understand them much better than before.
But, I still have some uncertainties, and mainly they ...
17
votes
6answers
2k views
Essential knowledge for making HTML/JavaScript-based games
I was wondering if any experts out there could share the knowledge and resources of what is necessary to start making games with the latest HTML standards and JavaScript (or what some like to call ...
15
votes
7answers
518 views
Do I need a Point and a Vector object? Or just using a Vector object to represent a Point is ok?
Structuring the components of an engine that I am developing along with a friend (learning purposes), I came to this doubt.
Initially we had a Point constructor, like the following:
var Point = ...
14
votes
3answers
744 views
How do history generation algorithms work?
I heard of the game Dwarf Fortress, but only now one of the people I follow on Youtube made a commentary on it... I was more than surprised when I noticed how Dwarf Fortress actually generates a ...
14
votes
6answers
4k views
Are there any alternative JS ports of Box2D?
I have been thinking about creating a top down 2D car game for HTML5. For my first game I wrote the physics and collisions my self but for this one I would like to use some ready made library.
I ...
14
votes
7answers
3k views
How does one optimize an HTML5 Canvas and JavaScript web application for Mobile Safari?
I've created an HTML5 Canvas and JS game that runs great on a desktop or laptop in Chrome (30fps), but on mobile Safari I only get around 8 fps. Are there any simple tips or tricks to increase the ...
14
votes
4answers
3k views
Simple noise generation
I'm looking to generate noise that looks like this:
(images courtesy of Understanding Perlin Noise)
I'm basically looking for noise with lots of small "ripples". The following is undesirable:
...
13
votes
6answers
3k views
Do any open source JavaScript 3D physics engines exist? [closed]
I'm working on a web-based 3D FPS game using WebGL, HTML5 and JavaScript. It is supposed to target PCs and net-books with WebGL-enabled browsers installed.
I'm wondering if there's an existing open ...
13
votes
8answers
4k views
How should I sort images in an isometric game so that they appear in the correct order?
This seems like a rather simple problem but I am having a lot of difficulty with it.
What should I do to properly sort images in an isometric game?
In a normal 2d top-down game one could use the ...
11
votes
4answers
2k views
Ledge grab and climb in Unity3D
I just started on a new project. In this project one of the main gameplay mechanics is that you can grab a ledge on certain points in a level and hang on to it.
Now my question, since I've been ...
10
votes
2answers
491 views
Dirty 2D map rendering
I keep hearing people talk about "dirty rendering" when it comes to map rendering for HTML5. I've Googled and searched the GameDev about it but there isn't much about it.
What exactly is it?
How to ...
9
votes
8answers
3k views
HTML5 mobile game development vs. native game apps
What is the current state of game engines, frameworks, libraries and conversions related to the HTML5 set of technologies (including CSS3 and JavaScript libraries such as RaphaelJS, Impact, ...
9
votes
8answers
11k views
What are some good jquery/javascript game engines?
So I have decided to try a bit of javascript/html5 game development (worked with XNA/Unity so far). Wondering if anyone had any suggestions. I am currently looking at impact, gameQuery and Jaws.
...
9
votes
2answers
668 views
Bomberman clone, how to do bombs?
I'm playing around with a bomberman clone to learn game-developement.
So far I've done tiles, movement, collision detection, and item pickup. I also have pseudo bombplacing (just graphics and ...
9
votes
1answer
527 views
Why does V8 not run with SDL threads?
i was able to compile and link V8 against my game and code interpretation works fine. However I want to divide my code and the game loop should exist in one thread and the scripting engine should run ...
8
votes
3answers
1k views
Why is it a bad idea to store methods in Entities and Components? (Along with some other Entity System questions.)
This is a followup to this question, which I answered, but this one tackles with a much more specific subject.
This answer helped me understand Entity Systems even better than the article.
I've ...
8
votes
6answers
3k views
To canvas, or not to canvas, when building browser-based games?
Background: I have extensive development background, but the last time I coded a game was many years ago. My Javascript skills are quite limited, and I intend to improve them by building a simple game ...
8
votes
4answers
1k views
Staggered Isometric Map: Calculate map coordinates for point on screen
I know there are already a lot of resources about this, but I haven't found one that matches my coordinate system and I'm having massive trouble adjusting any of those solutions to my needs.
What I ...
8
votes
4answers
2k views
How to implement mouselook in the browser?
I am currently creating a 3D first-person shooter game in the browser using WebGL. How would I implement mouselook/free look for such a game?
8
votes
3answers
242 views
Y and X - Am I doing it wrong?
I sometimes run into small issues when doing my JavaScript projects.
That is because most build in functions of JavaScript run X,Y if positions are needed. (In that order).
But when I build a 2D ...
8
votes
2answers
581 views
Creating smooth lighting transitions using tiles in HTML5/JavaScript game
I am trying to implement a lighting effect in an HTML5/JavaScript game using tile replacement. What I have now is kind of working, but the transitions do not look smooth/natural enough as the light ...
8
votes
2answers
1k views
Top down space game control problem
As the title suggests I'm developing a top down space game.
I'm not looking to use newtonian physics with the player controlled ship. I'm trying to achieve a control scheme somewhat similar to that ...
8
votes
3answers
2k views
Entity Component System based engine
Note: I'm programming this in Javascript, but it should be language agnostic in the most part.
I am thinking about converting my engine to an ECS based one.
I get the basic idea (note: this is ...
7
votes
8answers
1k views
HTML5 game obfuscation
HTML5 games have viewable source code. Is there a way to make them like swf file?
How to hide the game algorithm?
What do you think of the Firefox JavaScript Deobfuscator Plugin and obfuscation?
7
votes
4answers
792 views
Is a multiplayer game in JavaScript a good idea?
I wanted to make a multiplayer game that runs in the browser, and a friend of mine suggested that I should choose JavaScript as the main language. I already made a lot (registering, logging in, half ...
7
votes
3answers
1k views
How do I generate terrain like that of Scorched Earth?
I'm a web developer and I am keen to start writing my own games.
For familiarity, I've chosen JavaScript and canvas element for now.
I want to generate some terrain like that in Scorched Earth.
...
7
votes
3answers
3k views
Tips for communication between JS browser game and node.js server?
I am tinkering around with some simple Canvas based cave flyer game and I would like to make it multiplayer eventually. The plan is to use Node.js on the server side.
The data sent over would ...
7
votes
3answers
518 views
How often to update a Game Client about the World?
Using socket.io, I have a communication similar to that of other MMORPGs, a steady connection with messages.
In my design so far, the client sends the player's position and animation frame with every ...
7
votes
3answers
690 views
Are commercial javascript games sensible?
So I love javascript as a language and how it is able to be run anywhere. I'm gonna enumerate my concerns:
Does it make sense to make money from javascript? I mean, the second I publish my game ...
7
votes
2answers
1k views
Is there a simple way to do true isometric projection with an HTML5 canvas?
Is there a simple way to get a true isometric projection with the HTML5 canvas element?
7
votes
4answers
797 views
Securing HTTP data from a JavaScript game to server
Suppose I am doing a JavaScript game, and I wish the game to update the server if the user has successfully completes the game and his outcome.
How should I ensure that the request came from the ...
7
votes
4answers
2k views
How do I play audio with Javascript?
I want to add a short audio track to a game of concentration I'm coding. I want the sound to occur when the user has won the game. How do I go about doing this?
I would really appreciate the help, ...
7
votes
5answers
375 views
What implications does JIT (javascript/canvas) vs. AOT (Flash) have in terms of browser based game performance?
In my experience, even till this day, I still see more of a visual lag in entity movement / animation in JavaScript (Canvas) based games than I do in Flash based games.
Why is this - what exactly is ...
7
votes
3answers
147 views
How to do branching dialogue in javascript
I'm making a very basic visual novel type of game in Javascript, I'm a beginner so I'm just doing this for fun and learning, and due to bad planning I have run into a bit of a problem when you get to ...
7
votes
3answers
1k views
Javascript and PHP for real-time multiplayer?
I'm wondering if combining Javascript clientside with PHP/mysql serverside is a good idea for HTML5 real-time multiplayer (small scale) browser games?
My technical knowledge is very limited, and even ...
7
votes
2answers
644 views
What is the best way to handle simultaneous collisions in a physics engine?
I'm writing a 2d physics engine in javascript so that I can learn more about physics in video games. I have it working correctly for rigid body collisions, except for if any body collides with two or ...
7
votes
1answer
147 views
Javascript keyDown - no event approach
I'm making game in JavaScript. I have canvas for drawings and game loop. I'd like to make method readKeyboard, in game loop, to check if there is any pressed key. I don't want to attach event to ...
7
votes
3answers
3k views
Binding C++ and V8 Javascript from Google
The examples are quite challenging to grasp if you are still getting your head around other things, so the simplest example would be great.
Is there a simpler example?
7
votes
1answer
479 views
Depth interpolation for z-buffer, with scanline
I have to write my own software 3d rasterizer, and so far I am able to project my 3d model made of triangles into 2d space:
I rotate, translate and project my points to get a 2d space representation ...
7
votes
1answer
574 views
2d, Top-down map with different levels
So, I'm creating a 2d, top down, sprite based (tiled) game, and right now I'm working on maps (well, a map editor at the moment, but it will be creating my maps, so basically the same thing).
The ...
7
votes
2answers
697 views
How to scroll hex tiles?
I don't seem to be able to find an answer to this one. I have a map of hex tiles. I wish to implement scrolling.
Code at present:
drawTilemap = function() {
actualX = Math.floor(viewportX / ...