"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

1
vote
2answers
1k 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
929 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
908 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
581 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
836 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
345 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
559 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
443 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
636 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
155 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
987 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
777 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
564 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
463 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
425 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
599 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
7k 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
803 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, ...
1
vote
4answers
875 views

How do I respond to keyboard events which occur between polling?

In my games update loop, which happens on a fixed timestep of 30 times per second, I am checking the current state of several keys to determine how to move the player. For example: ...
-4
votes
1answer
992 views

What is the best framework to develop games for Android?

I have an Android 2.2 device and I want to try to develop games for it. I have three questions: What is the best frame work to develop games. Are there any good JavaScript ports or frameworks ...
2
votes
2answers
984 views

Why is my quaternion camera rotating around strange axes?

I can't get it to work for the life of me. Its rotating the camera in the global coordinate system, or some other random coordinate system, not the camera local coordinate system. WASDEC work ...
3
votes
2answers
363 views

How to place objects/entities randomly in JS?

I'm making a game and I have a script (running it with Node) on the server that currently just randomly places things on the map... I'd like to change that. I saw something about Perlin noise but I'm ...
2
votes
2answers
1k views

Javascript/html5 2d Canvas Context - Getting X, Y relative to canvas (opposed to transformed object)

I have scenario where there are several items on a the context stack and I need to get an x, y coordinate relative to the canvas itself. The situation is I am writing a 2D game in HTML5 and I want ...
2
votes
2answers
968 views

Canvas Rotation collision detection on a sprite

I am using this code to detect collisions between two rectangular sprites. intersect: function(other) { return this.x < other.x + other.width && other.x < this.x + this.width ...
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: ...
1
vote
1answer
577 views

Orientation while rotating around a point

I am using this formula to rotate around a point. X := originX + sin(angle)*Size; Y := originY + cos(angle)*Size; In cartesian cordinates how would I keep the objects orientation in relation to the ...
2
votes
1answer
290 views

What client front-end options can I use to make a Facebook game?

I have been requested to make a port of an iOS game for Facebook. The game itself is fairly simple, it is a puzzle game using a 2d array for a grid with XML passed from a server for loading objects ...
3
votes
1answer
545 views

Best resources for Canvas Html 5 development

I am at a competition at work for who can make the best canvas game. Theme is a top down shooter... Winner gets dinner for free. Anyways I have been looking around looking for some good resources on ...
7
votes
1answer
788 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 ...
1
vote
2answers
558 views

What is some game development literature purely in javascript? [closed]

I'm mainly interested in the videogames development in pure javascript, since nowadays there's so many books about htm5 and javascript I couldn't find any book about game development with javascript ...