"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. ...
0
votes
2answers
398 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
vote
2answers
1k 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
317 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
242 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
2k 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
492 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
622 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 ...
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 ...
9
votes
1answer
541 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
1k 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
1k 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
130 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
607 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
631 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
734 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
311 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
942 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
704 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 ...
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:
...
1
vote
1answer
420 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
255 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
434 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
587 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 ...
0
votes
2answers
435 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 ...
2
votes
4answers
1k views
Unity: Assigning a key to perform an action in the inspector
I am trying to write a simple piece of code in JavaScript where a button toggles the activation of a shield, by dragging a prefab with Resources.load("ActivateShieldPreFab") and destroying it again ...
7
votes
2answers
711 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 / ...
1
vote
1answer
435 views
Performing simple network call to retreive JSON in Unity?
I have looked at the network documentation for Unity and most examples seem to be related to networking your game for multiplayer. I am just looking to grab a JSON response from an API for dynamically ...
1
vote
1answer
264 views
Setting the values of a struct array from JS to GLSL
I've been trying to make a structure that will contain all the lights of my WebGL app, and I'm having troubles setting up it's values from JS. The structure is as follows:
struct Light {
vec4 ...
1
vote
0answers
355 views
Stuck with A* implementation
I have implemented some A* code in C# using this JavaScript code.
My C# implementation is the same as the above javascript code. But I'm unable to get it to work properly, e.g pathfinder blocks ...
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, ...
3
votes
1answer
153 views
Make an object slide around an obstacle
I have path areas set up in a game I'm making for canvas/html5 and have got it working to keep the player within these areas. I have a function isOut(boundary, x, y) that returns true if the point is ...
0
votes
2answers
415 views
Check if an object is facing another based on angles
I already have something that calculates the bearing angle to get one object to face another. You give it the positions and it returns the angle to get one to face the other.
Now I need to figure out ...
0
votes
1answer
399 views
Calculating bullet travel knowing coordinates and radian
I have a player sprite that has a x and y coordinate and also a radian. The radian determines which way the sprite faces in a top-down game interface. In this case, the radian points from the player ...
-1
votes
1answer
1k views
HTML Javascript Hidden Object or Photo Hunt Game
Is anyone aware of any example photo hunt/hidden object games either in HTML and Javascript or flash if necessary? I am having trouble finding one, I may be using the wrong words to search.
Photo ...
2
votes
1answer
2k views
Collision detection between a sprite and rectangle in canvas
I'm building a Javascript + canvas game which is essentially a platformer. I have the player all set up and he's running, jumping and falling, but I'm having trouble with the collision detection ...
7
votes
3answers
532 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 ...
0
votes
0answers
177 views
Online Game Considerations [closed]
I want to make a kind of online game, completely in JavaScript, using the <canvas> and socket.io. The general How is covered, there are just some minor problems with the design and architecture ...
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 ...
6
votes
1answer
471 views
What structure is best used to model maps for games like Bard's Tale / Dungeon Hack?
I would like to create or use an existing JavaScript engine to build a game in the spirit of Dungeon Hack, Eye of the Beholder and older Might & Magic games. Going off my memory playing these ...
3
votes
5answers
3k 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 ...
2
votes
2answers
315 views
How to draw objects that have a smaller Y axis first?
In my game there is a large 2D map of various objects. Example. As you see, upon creation objects of the same type (trees for example) are placed correctly, but objects of another type (enemies) are ...
2
votes
2answers
434 views
Animating sprites at different speed than what the game runs at
I am building a Javascript/canvas platformer game, and it's coming along nicely. The only problem I've really run into where I can think of any solution at all is the animation of my player sprite.
...
5
votes
1answer
2k views
How do I implement side scrolling in a javascript platformer?
I'm building a side scrolling platformer with Javascript and the canvas element for a school project. I have the character all sorted out. He runs left and right, and has a different sprite set for ...
1
vote
1answer
143 views
How do I draw a multi-object mesh at once?
This is a very elementary question. At the moment I am drawing lots of faces separately by setting a location uniform separately for each one of them. This is very slow. As I understand it, 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, ...
2
votes
2answers
373 views
Is there any reason for doing back face culling in software?
I, a newbie, have been doing back face culling in javascript for my WebGL app because I didn't know gl.cullFace() existed. Is there any reason to use software-based culling instead of just passing all ...
6
votes
2answers
3k views
How to handle multiplayer in JavaScript?
I'm just doing a bit of research into tech to use for a mobile multi-player game.
It's more an experiment at present so for the moment, the only thing that Players need to be aware of is the other ...
5
votes
2answers
504 views
Is it sound to use javascript for cross platform game scripting instead of lua? I might need web clients for my game
I have been looking around for clues on the subject but I'm not convinced to commit to javascript as my primary scripting language.
Currently I have started with lua. But I fear it will be a limiting ...
1
vote
1answer
199 views
How can I center a circle around a point on an HTML canvas?
I've got a job to make an engine and light game for canvas in HTML5. I like the things I make to be centered on the x,y positions I give it, I don't know why, it just helps me think about them ...
0
votes
1answer
1k views
Has anyone used PhoneGap to make 2D games for the iPhone? [closed]
I love simple casual games. I've been riding the bus a lot recently and so simple, no-brainer games are great fun and well worth the small price I pay on the App Store.
It got me thinking... I know ...