"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. ...

learn more… | top users | synonyms

14
votes
8answers
7k 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 ...
48
votes
18answers
23k 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 ...
2
votes
1answer
1k views

Shoot a bullet towards cursor - top down 2d

I am making a 2D topdown shooter game, in which the player's movement is controlled with WASD and gun with the mouse. I'm having a hard time figuring out how to update the position of the bullet as it ...
23
votes
5answers
5k 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 ...
30
votes
9answers
13k 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 ...
10
votes
3answers
2k 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 ...
17
votes
4answers
6k 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
3answers
873 views

How do I lerp between values that loop (such as hue or rotation)?

View Demo I'm trying to make the joint rotate smoothly around the center of the canvas, toward the angle of mouse pointer. What I have works, but I want it to animate the shortest distance possible ...
10
votes
3answers
2k 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. ...
4
votes
5answers
5k views

Which free HTML5-based game engine meets these requirements? [closed]

I am experienced with traditional JS and HTML but new to HTML5. I want to develop games in HTML5 so that it can work on all devices and browsers, including IE. Additionally, I require the following ...
8
votes
4answers
1k 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 ...
3
votes
1answer
538 views

How can I detect mouse events on sprites in a canvas?

I'm making an HTML 5 game. I want mouse clicks on sprites drawn in a canvas element cause events that my code can react to. At the moment, I'm doing it by checking through all of my sprites in a ...
13
votes
4answers
6k 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
0answers
910 views

How to create 2D shadows [duplicate]

I'd like to create lights and shadows in a 2D environment, like in the image below: I did several searches but got no results. Do you have any hint?
17
votes
6answers
2k views

Essential knowledge for making HTML/JavaScript-based games [closed]

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 ...
9
votes
3answers
4k 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 ...
6
votes
4answers
2k views

Is there a way to increase the collision check efficiency of a system of n objects?

I'm making a game that consists of many onscreen objects, one of which is the player. I need to know which objects are colliding every iteration. I made something like this: for (o in objects) { ...
7
votes
5answers
3k views

How do I protect sending scores from HTML5 games to my server

On backend I am using java. I have a game in HTML5; when user completes it I sends an Ajax call to save the score to database. Now, someone can easily use tools like Fiddler and firebug to modify this ...
7
votes
1answer
814 views

Jump handling and gravity

I'm new to game development and am looking for some help on improving my jump handling for a simple side scrolling game I've made. I would like to make the jump last longer if the key is held down ...
6
votes
3answers
3k views

How do C# and JavaScript differ in Unity development? [closed]

Other than the obvious language differences, how do JavaScript and C# differ when developing games in Unity3D? Is there a noticable performance difference? Is the JS code packaged as-is? If yes, ...
8
votes
8answers
3k 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?
4
votes
2answers
1k views

canvas ball physics animation

I want to animate ball in html canvas like this. ctx.beginPath(); ctx.arc(75, 75, 10, 0, Math.PI*2, true); ctx.closePath(); ctx.fill(); start position is left top corner and ball's maximum ...
2
votes
7answers
546 views

Is there a fundamental technical reason for Flash being a more popular game platform than JavaScript?

Both Javascript and AS3 are implementations of ECMAScript. Is there a fundamental technical reason for Flash being so much more prevalent as a game-publishing platform, when compared to Javascript?
1
vote
4answers
5k views

Transform coordinates from 3d to 2d without matrix or built in methods

Not to long ago i started to create a small 3D engine in javascript to combine this with an html5 canvas. One of the issues I run into is how can you transform 3d to 2d coords. Since I cannot use ...
5
votes
1answer
721 views

box2d with lines

I have a very simple platform game builder and I've specified the ceilings, walls and floor as line segments. A line has a winding, or normal; you can determine the direction that a line should be ...
0
votes
2answers
567 views

How legal would it be to use some elements of the Half Life universe in my non comercial, indie game?

I'm planning to make a simple, HTML5 game, that would use some elements of the Half Life universe. Basically, it would be a 2D Portal clone, but it would have it's own story, and portals would be ...
-1
votes
1answer
2k views

How to create a text-based game? [closed]

I would like to create a text-based game. As simple as that. I have some understanding of the coding that needs to go into it as I do know a fair amount of JavaScript and I can do it in the ...
-2
votes
1answer
277 views

Energy Bar in Unity [closed]

I want to display a debug message when the progress bar is loaded fully and I have a button "refresh", when I click this it should reload the progress bar. Here is the code I have tried: var ...
33
votes
20answers
5k 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 ...
10
votes
9answers
17k views

What are some good jquery/javascript game engines? [closed]

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. ...
8
votes
4answers
3k 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 ...
7
votes
3answers
4k views

Tips for communication between JS browser game and node.js server? [closed]

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 ...
23
votes
6answers
4k 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 ...
15
votes
6answers
4k 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 ...
9
votes
3answers
651 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 ...
4
votes
4answers
11k views

How to protect source code when game is developed in HTML5/Javascript [duplicate]

Possible Duplicate: How do you prevent your JavaScript / HTML5 web game from being copied or altered? If a game client is developed in Javascript, the source code can be found in browser. ...
7
votes
3answers
4k 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
768 views

Capitalizing on JavaScript's prototypal inheritance

JavaScript has a class-free object system in which objects inherit properties directly from other objects. This is really powerful, but it is unfamiliar to classically trained programmers. If you ...
11
votes
8answers
4k 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, ...
10
votes
7answers
8k 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 ...
5
votes
3answers
664 views

Determining the end location for AI movement in groups in a 2D RTS

I have written an RTS game (a demo for a game engine of sorts, actually) in which the user's basic interaction with the game is to select a bunch of soldiers and then right-click on the map to move ...
3
votes
2answers
3k views

HTML5 canvas screen to isometric coordinate conversion

I am trying to create an isometric game using HTML5 canvas, but don't know how to convert HTML5 canvas screen coordinates to isometric coordinates. My code now is: var mouseX = 0; var mouseY = 0; ...
5
votes
1answer
272 views

Walking on a sphere

I'm working on a game which involves walking your character on the surface of a sphere. Using the answer to Arbitrary Rotation about a Sphere, I've written my code as: if (game.isKeyDown(37)) { // ...
5
votes
3answers
7k views

Where is the Aves game engine?

The Aves game engine made a splash last spring/summer, with very impressive demo videos. I went back to check on them, and it looks like their site has long since died. Google also doesn't seem to ...
4
votes
3answers
3k views

List of 3D libraries based on WebGL [closed]

Is there a up-to-date list of WebGL libraries or articals with comparison? Until now I heard only three.js and GLGE.
3
votes
3answers
593 views

Semi Fixed-timestep ported to javascript

In Gaffer's "Fix Your Timestep!" article, the author explains how to free your physics' loop from the paint one. Here is the final code, written in C: double t = 0.0; const double dt = 0.01; double ...
3
votes
3answers
494 views

What is better for the overall performance and feel of the game: one setInterval performing all the work, or many of them doing individual tasks?

This question is, I suppose, not limited to Javascript, but it is the language I use to create my game, so I'll use it as an example. For now, I have structured my HTML5 game like this: var fps = ...
2
votes
3answers
4k views

Get points on a line between two points

I'm making a simple space game in JavaScript, but now I've hit a wall regarding vectors. The game view is top-down on a 2d grid. When the user clicks on the grid, the space ship will fly to that ...
2
votes
4answers
518 views

Javascript Audio solution

still has issues. Flash works but... requires flash (an issue for iOS). What do you use in Javascript for audio?
10
votes
2answers
535 views

How do I make good guy attacks only hit bad guys and vice versa?

My game has many different type of good guys and many different type of bad guys. They will all be firing projectiles at each other but I don't want any accidental collateral damage to occur for ...