"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. ...
2
votes
2answers
202 views
Receiving keyboard events on a canvas in Javascript
I need to receive keyboard events in a canvas element. Click events are received but key presses aren't.
Here is my code which doesn't handle key events:
var canvasElm = $('canvas');
...
2
votes
2answers
135 views
How to make a Unity3d program/plugin and publish it on Asset Store?
I want to make a plugin for Unity3d, like TornadoTwins's FPS Control. How can I do that? I already have Visual Studio 2010 installed.
1
vote
1answer
122 views
Mega Man screen scrolling in JavaScript
I'm trying to create screen transitions similar to those found in Mega Man or Legend of Zelda (i.e. the active elements of the first screen are stopped as the screen scrolls in the direction of the ...
0
votes
0answers
176 views
What are pros and cons using easelJS library? [closed]
I am new to browser-based game development.I want to build a game that would be hosted on local server or on a system.Not to be on internet..currently..
I am completely new to field of game ...
-1
votes
2answers
77 views
When I create more than one boundary, every one but the most recent breaks [closed]
So basically what I have is a function called createBoxBoundary, which, when the player position is within certain limits, sets boundary variables to true. Pretty straightforward. However, when I call ...
3
votes
2answers
240 views
Get timing correct with client side prediction
I believe I've got my head round CSP after reading Gabriel Gambetta's blog, Valve article and buildnewgames.com but having an issue understanding the time execution of everything.
So if a player ...
-1
votes
2answers
118 views
Javascript - create a new bullet instance every time a user event is triggered
Basically I have a function that I need to create an object of every time the user presses space(event listeners not shown here).
function arrow(){
this.x = playerXPos + 40;
this.y = ...
1
vote
1answer
189 views
2D js physics engine for HTML4
Is there any engine for Javascript like box2dweb that does not use Canvas? I need to build a game that works in HTML4 browsers.
1
vote
2answers
180 views
PHP and Javascript/HTML5 Collaboration [closed]
I've recently been working on a fairly complicated game. I've stored information with local storage, but that allows the player to edit it, and does not transfer from computer to computer. The two ...
0
votes
0answers
94 views
Turn Based game Animation using javascript [closed]
I'm struggling to decide which javascript animation library could help me most. (spritely, easejs etc - none that i've come across have shown an example similar to my needs)
I'm developing a browser ...
6
votes
3answers
311 views
Saving roguelike game state?
I'm working on a basic roguelike using HTML5 and jQuery, and I've come across a problem.
The way the game currently stands, the system only saves the game state every time the user moves between ...
0
votes
4answers
202 views
A formula for point calculation based on value A's proximity to value B
I am trying to find a formula to use for my rhythm game's scoring. Basically there is a Guide entity and a Live entity. You control the Live entity and have to match it as closely as possible to a ...
0
votes
1answer
77 views
Increase restitution (bounciness) of an object in a JavaScript formula
I'm going slightly around the houses on this one. I originally started a thread over on Stack Overflow about it but then it seemed to diverge into mathematics, with no joy from the SO community over ...
3
votes
2answers
256 views
How do I calculate consistent frame timings at 60fps?
I'm writing an HTML canvas game that uses requestAnimationFrame and therefore runs at 60fps, although this is more of a question about failing arithmetic than about JavaScript.
If I measure the time ...
1
vote
1answer
340 views
PNG image as a level map for 2d game
I've been using a tilemap editor for making levels, but I was wondering if there was a way to use PNG images as the level map, as maps created in tiled editor are graphically uninteresting.
...
6
votes
3answers
416 views
Basic isometric projection in Javascript
I've been working on porting an old closed source game to Javascript with Canvas and I've come to a slight problem.
Right now, to display the land, I just have a pretty basic loop that just draws the ...
1
vote
2answers
331 views
How do I generate a 2d grid-based map without screwing it up?
I'm relatively new to the mechanics of game development - catching up fast, but there are still some things that escape me. For example: generating a fully-accessible map on a 2d grid.
See the ...
2
votes
3answers
163 views
Instantiate objects that share same variable
I'm just wondering how to instantiate the same objects that all share the same variables, except their positions.
I'm basically working on the scene of my HTML5 game, and I've build a streetlamp post ...
2
votes
2answers
226 views
Best way to store NPCs, Monsters, Shops, etc for JavaScript game? [closed]
OK, let's say I have a JavaScript game (preferably on jQuery framework) and its using HTML5 Canvas.
What would be your way of storing data to map out shops, monsters, and NPCs? I was thinking maybe ...
0
votes
1answer
151 views
Saving Scores Using Cookies
I've recently created a small galiga like game recently using JavaScript and HTML5. I've run into a bit of trouble saving cookies, the cookie saves, but then resets itself when the page is refreshed, ...
-2
votes
1answer
75 views
Why do I get “Undefined” only on the “Vertical” Grid?
Problem:
When I get to the end of the Grid it gives me an Error :-/
The X axis is fine, the problems occur then I move "over the end" of TOP and BOTTOM.
This code works:
if(new_data[1] == ...
4
votes
1answer
203 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 ...
5
votes
1answer
293 views
Canvas animation drops to 30fps every 3-4 seconds
Ok! I solved the problem.
Chapter One - Multiple Canvases
I started to make pong utilizing requestAnimationFrame and I noticed that the ball was stuttering and slowing down every 3-4 seconds. So I ...
2
votes
2answers
149 views
Approaches for storing grid-like information
I am drawing this simple grid on my NodeJS server:
var grid = [];
for(var x = 0; x < 20; x++){
grid[x] = [];
for(var y = 0; y < 20; y++){
grid[x][y] = 0;
}
}
...
0
votes
0answers
48 views
How to dump the dom in Qt Script?
Good afternoon,
I’ve connected the Qt (4.8) script engine up within my application.
I’m still learning how to make my application accessible from scripts.
I’d like to debug it by enumerating ...
1
vote
2answers
411 views
How to make an infinite map
I was wondering if someone could explain to me how to implement a seemingly dynamic infinite map like the one at http://wordsquared.com/
My main issue is really generating new tiles in any direction ...
2
votes
1answer
118 views
mat3x4 in webGL shaders
I am porting the IQM bone animation format to Javascript and have run into a problem...
The vertex shader is failing to compile and the only error message I get out is 'mat3x4' : syntax error on the ...
0
votes
1answer
159 views
Player movement behind objects
I was playing around on RPG JS and Browser Quest, and the player, when moving, can give the effect of walking behind the trees or houses etc, so the player effectively disappears while it is "behind" ...
-5
votes
4answers
368 views
A* mouse movement javascript top-down game
Im trying to implement a* path finding for my character movement in my game.
The game is written in javaScript along with jQuery in a canvas.
I have read up on A* so i believe i understand what it ...
-1
votes
1answer
589 views
How to make background to stage in kineticjs
var stage = new Kinetic.Stage({
container: 'container',
width: 490,
height: 300,
});
var layer = new Kinetic.Layer();
I want to make a default image to a stage to be the ...
-3
votes
1answer
337 views
LimeJS vs CreateJS for game development [closed]
happy 2013... I want to start developing HTML5/JS games this year, and i see this 2 frameworks LimeJS and CreateJS & EaselJS. Wich one is better? Anyone have experience with these 2 frameworks? ...
-4
votes
2answers
158 views
enemy shooting towards FPS [closed]
WELL first of all I want you to see my game (its deployed on heroku cloud) :
http://still-escarpment-3701.herokuapp.com
(It takes almost 10 sec to load so please wait for couple of sec)
I have ...
-1
votes
2answers
164 views
problem with bullets shooting in FPS game
Please check out my game here: http://still-escarpment-3701.herokuapp.com
The problem is with shooting. The bullets keep on moving with the First person controller instead of moving from the same ...
1
vote
0answers
275 views
shader-based particle systems
I have a classic particle system where each particle is represented by a quad and, each time step, I move each particle.
My target is webGL which means I don't have instancing, attribute divisors nor ...
0
votes
1answer
346 views
How does JavaScript fare as a game scripting language? [closed]
I'm currently looking into scripting languages that might be usable for games. JavaScript appears to be a good choice to me - from what I can tell, it has a small core, very large community, great ...
0
votes
2answers
149 views
Unity - Code is fine in the editor, has error on android
Right. Im running into some weird issue with android unity. I have this bit of code
function OnTriggerStay (other : Collider)
{
if(die.GetComponent(DieScript).sideUp ==6 ...
6
votes
1answer
309 views
How to create 2D shadows
Could help about creating lighting and shadows in a 2D environment, like the image below.
http://i.stack.imgur.com/0FEQz.gif
I did several searches but got no results
( ps: sorry my bad english i'm ...
4
votes
2answers
399 views
How should I implement parallax scrolling with pan and zoom in HTML5?
I'm writing a planetary motion simulator with the HTML5 canvas element and I want to put one or more layers of stars in the background. The user can click and drag the screen to navigate around the ...
0
votes
0answers
193 views
Am I doing this node.js game loop wrong?
I have 2 arrays of JSON objects, actions and game objects.
At any time a user can make a request from the client which can add an action to the actions array.
I have a setInterval(function(){ }, ...
0
votes
2answers
54 views
In an asynchronous server environment where player input and timed events modify data is using an in-memory array problematic?
So let's say I have a server running on node.js, and there is an array of player objects...
At an interval, all of these player objects are looped and processed for events and changes that are based ...
-1
votes
1answer
191 views
Drawing polygons in 3D
I have recently been working on a 3D engine from scratch, using JavaScript and HTML5. I've successfully created lines (although slightly buggy) and points, but I can't figure out faces. My current ...
0
votes
0answers
136 views
Swept sphere to line segment intersection in 2D
How can you determine when a moving sphere intersects a line segment, and the normal of that intersection?
Ideally Javascript, but anything that's tidy, simple and self-contained and easy to port to ...
2
votes
0answers
449 views
HTML5/JS - Choppy Game Loop
I have been experimenting with HTML5/JS, trying to create a simple game when I hit a wall. My choice of game loop is too choppy to be actually of any use in a game.
I'm trying for a fixed time step ...
-1
votes
2answers
219 views
Remove enemy when bullet hits enemy
For my education I have to make a basic game in HTML5 canvas. The game is a shooter game. When you can move left -> right and space is shoot. When I shoot the bullets will move up. The enemy moves ...
2
votes
1answer
171 views
Collision detection problems - Javascript/Canvas game
What I want to do:
I simply want the have a 2D array to represent my game map.
I want a player sprite and I want that sprite to be able to move around my map freely using the keyboard and also have ...
1
vote
2answers
517 views
Efficient collision detection - tile based HTML5/Javascript game
I'm building a basic RPG game and I'm looking at collisions/pickups etc now.
It's tile based and I'm using HTML5 and Javascript.
I use a 2D array to create my tilemap.
I'm currently using a switch ...
-1
votes
1answer
400 views
HTML5 platformer collision detection problem
I'm working on a 2D platformer game, and I'm having a lot of trouble with collision detection. I've looked trough some tutorials, questions asked here and Stackoverflow, but I guess I'm just too dumb ...
1
vote
1answer
131 views
Adapting Javascript game for mobile
I'm currently developing a Javascript web game for desktop users. It is a sort of tower-defense game that relies on mouse input only, developed on canvas using EaselJS. In the future, or perhaps ...
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 ...
1
vote
1answer
173 views
How can I detect and compensate for system related lag?
The best example I can think of is Doom 3. It seemed to me that if there was any kind if lag the game would pause and then resume without "fast forwarding" to catch up. I'm trying to figure out a good ...
