"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

5
votes
2answers
606 views

Web-based micro-transaction API

I am currently making a browser-based game and I would like to integrate micro-transactions. However I would prefer not to have to implement my own storefront. Does anyone know of an available ...
0
votes
1answer
1k views

Staggered Isometric Map In Javascript

I'm trying to create a staggered isometric map in Javascript. var x, y, row, column, top, left, width = window.innerWidth, height = window.innerHeight, tile = {width: 64, height: ...
1
vote
1answer
127 views

Path finding with identical values

I have been reading up about path finding and find it all very confusing, however this is probably the best I have found for a logical explanation: Path If the cost of two nodes has the same value, ...
5
votes
2answers
5k views

Box2dWeb and Images

How do I import and attach a PNG or GIF to a shape in Box2dWeb? The best resource I could find online is at: http://www.jeremyhubble.com/box2d.html However, this "tutorial" doesn't give much ...
1
vote
1answer
364 views

How do I generate a level randomly?

I am currently hard coding 10 different instances like the code below, but but I'd like to create many more. Instead of having the same layout for the new level, I was wondering if there is anyway to ...
3
votes
1answer
1k views

Canvas tile grid, hover effects, single tilesheet, etc

I'm currently in the process of building both the client and server side of an HTML5, canvas, and WebSocket game. This is what I have thus far for the client: http://jsfiddle.net/dDmTf/20/ Current ...
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 = ...
6
votes
3answers
644 views

How can I tweak this A* search pathfinding algorithm to handle different terrain movement values?

I'm creating a 2D map-based action game with similar interaction design as Diablo II. In other words, the player clicks around a map to move their player. I just finished player movement and am moving ...
1
vote
1answer
399 views

How can I render player movement on a 2d plane efficiently?

I'm prototyping a 2d HTML5 game with similar interaction to Diablo II. (See an older post of mine describing the interaction here: How can I imitate interaction and movement in Diablo II?) I just got ...
1
vote
0answers
411 views

Good practices when optimizing HTML5/Javascript Game Developement [closed]

I'm just starting out as a game developer and have created a few crappy but playable clones of classic games like pong, and bomberman. Being self taught (bless the internet) I do this by just stuffing ...
2
votes
0answers
256 views

Independent HTML5 Physics Game: Any Feedback? [closed]

I've been independently developing a physics-based HTML5 game. I haven't used any libraries or engines; all the code, including the physics, is my own. It is free for a while on the Chrome Web Store ...
1
vote
2answers
864 views

Matrix rotation of a rectangle to “face” a given point in 2d

Suppose you have a rectangle centered at point (0, 0) and now I want to rotate it such that it is facing the point (100, 100), how would I do this purely with matrix math? To give some more specifics ...
1
vote
2answers
2k views

Creating several instances of the same object, and selecting only one

I'm playing around with making a puzzle game, haven't done that much before I run into my first problem. I want to create a certain amount of the same object/function. But without hardcoding the ...
4
votes
5answers
938 views

How can I imitate interaction and movement in Diablo II?

I'm prototyping a simple browser-based game. It's played from a top down perspective on a 2d canvas. You left-click on a point on the map, and your character will begin walking to it. If you click ...
2
votes
1answer
909 views

How do I query a server with visible map tiles? [closed]

In my game, I need to retrieve data of items in the visible tiles based on what tiles are visible in the viewport. I am planning to make a batch AJAX request with the visible tiles, containing image ...
10
votes
2answers
586 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 ...
8
votes
2answers
852 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 ...
-2
votes
1answer
1k views

How to make an isometric background?

I'm trying to create an isometric background for a game but I'm not sure how to do it. I'm using Javascript and jQuery. I've already tried it before using CSS3 but I think I'm using the wrong method. ...
3
votes
0answers
254 views

Choosing a (browser) game environment [closed]

I apologise in advance if this post is something you've heard a million times already or seems like a trolling attempt. I just want some advice and I'm coming up short with my own Google searches. ...
5
votes
4answers
1k views

Making a startscreen for an HTML5 game?

How would I make a start screen for a game using HTML5 canvas? I'm not looking for something advanced, just the new game button and highscore link etc. The question might be stupid, but I've never ...
2
votes
1answer
160 views

How can I clear explosions in my function?

Hi I have a function to place bombs, and a for loop that places explosions on the tiles where possible. My problem is that I can't remove the explosions after a while. I've tried everything I can ...
9
votes
2answers
1k 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 ...
2
votes
1answer
237 views

Selecting objects on a 2D map

I have a object selection function by checking the mouse click and getting the relevant object. How ever there is a rare situation where if one object is partially behind the other then both objects ...
2
votes
4answers
3k views

Dividing up spritesheet in Javascript

I would like to implement an object for my spritesheets in Javascript. I'm very new to this language and game-developement so I dont really know how to do it. My guess is I set spritesize to 16, use ...
1
vote
1answer
346 views

Collision within a poly

For an html5 engine I'm making, for speed I'm using a path poly. I'm having trouble trying to find ways to get collision with the walls of the poly. To make it simple I just have a vector for the ...
0
votes
3answers
565 views

Changing balls direction in Pong

I'm making a Pong game to get started with game-developement but I've run into a problem that i can't figure out. When trying to change the balls direction it doesn't change. This is the relevant ...
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 ...
2
votes
2answers
1k views

HTML5 clicking objects in canvas

I have a function in my JS that gets the user's mouse click on the canvas. Now lets say I have a random shape on my canvas (really its a PNG image which is rectangular) but i don't want to include ...
2
votes
2answers
1k views

Drawing isometric map in canvas / javascript

I have a problem with my map design for my tiles. I set player position which is meant to be the middle tile that the canvas is looking at. How ever the calculation to put them in x:y pixel location ...
1
vote
2answers
1k views

How to draw a tileset using HTML5 canvas?

I have a tileset something like this: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 My tileset draw code looks like this: var image = new Image(); image.src = ...
1
vote
1answer
271 views

Isometric Optimization in javascript

I'm having some issues with my optimization of my game. I have a simple tile map looped like this in my case the images are 64 by 64 pixels: for (i=0; i < 50; i++){ //horizontal for (j=0; ...
2
votes
2answers
448 views

Collision Detection doesnt work because some things move more than 1px at a time

I'm writing a 2d scrolling game in javascript using canvas and since I'm limited to setInterval running at minimum once every ms, I need to have some objects moving at greater than 1 pixel a second. I ...
1
vote
1answer
662 views

Problem when animating MD5 model (GPU Skinning)

I'm trying to implement a GPU skinning version of the md5mesh.js by @tojiro (demo with CPU skinning) in WebGL (live demo of the project here, use WASD to move the camera around). The main concept is ...
1
vote
1answer
156 views

Cellbased maps explanation?

I've been trying to understand cellbased maps and how they work, i have googled alot but can't seem to find any explanation for it. With cell based maps i mean the ones where you do height and ...
2
votes
2answers
1k views

Javascript Isometric draw optimization

I'm having trouble with isometric tiles drawing. At the moment I got an array with the tiles i want to draw. And it all works fine until i increase the size of the array. Since I draw ALL tiles on ...
-2
votes
3answers
996 views

Objective-C or javascript+html5+canvas? [closed]

I'm really interested in starting to study some language with the idea of develop games for ipad and iphone. My main concern is that as soon as is possible to develop games with javascrit and html5 ...
2
votes
3answers
781 views

Is there a HTML/JS game engine/library that deals with things (HUD, menus, accounts, etc) other than the core gameplay?

I've been looking through the many HTML/Javascript game engines/libraries out there (many of which are found here https://github.com/bebraw/jswiki/wiki/Game-Engines). Most of them seem fairly ...
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) { ...
0
votes
2answers
568 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 ...
2
votes
2answers
3k views

Resource loader for an HTML5 and Javascript game

I have made a type to shoot game using HTML5, Javascript and Ruby on Rails. Here is the link for the game Tweetraitor I wanted to make a loader for resources (sounds, images) when the game starts. ...
0
votes
3answers
467 views

How do I make a message based communication system between objects?

Just as I was told here, I need to make some kind of communication between objects in my game. Mainly, for achievements. How do I do this? My idea was to make every object have an array attached to ...
0
votes
1answer
434 views

throw a 2D ball facing the target to simulate a 3D like effect

How would you update the state of a 2D object that is thrown forward(with an arc) facing a target to simulate a 3D(depth) like effect? var ball; //2D ball from a sprite sheet ball.x = 0; ball.y = 0; ...
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 ...
-1
votes
1answer
600 views

Framework to build scrollable map with item selection in JavaScript?

I need a mobile device to be able to scroll a large, static map image, and also be able to select PNG image "objects", like this: What would be the simplest method? HTML5, jQuery, Sencha Touch, or ...
3
votes
1answer
1k views

Converting cartesian geo-coordinates to isometric (real world map to game map)

I need to create an automated method to convert real cartesian, geo-coordinate data (such as roads and parks), into isometric coordinates as a game map view for use in HTML5 Canvas. Here is an image ...
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 ...
9
votes
1answer
817 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 ...
3
votes
1answer
2k views

Optimizing HTML5 canvas transformed drawing in Javascript

I am trying to optimize my HTML5 game engine and have noticed that currently a majority of the time taken in the game loop can be taken when drawing transformed tiles. I think this is because each ...
0
votes
3answers
2k views

For making an online multiplayer browser-based game, what tech would be more efficient to use? [closed]

I asked a partial question on stackoverflow, and then realized that this would be the place to get a better answer because this is the game dev website, and you all may know more than the programmers ...
0
votes
1answer
151 views

Copying section of map array

I'm experimenting a bit with pathfinding. I'm using Javascript. I have a map array as follows: mapArray = [ [0, 0, 0, 1, 1, 0], [1, 0, 0, 1, 0, 0], [0, 1, 0, ...