"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
1answer
55 views

Custom lookAt function goes wild

I have written a custom lookAt function based on a lot of posts from all over the net, and it works very nice... except when a rotation (which is stored in a quaternion) crosses some 'threshold'. ...
1
vote
1answer
128 views

How can I apply a glow filter in Phaser?

I'm trying to get the following effect, but as far as I know, a filter is the only sensible way. Imagine some objects and background, and a fire ball passing through. The fireball glows. All objects ...
0
votes
1answer
31 views

SVG—Adding fire to the roket

as you might expect, I have got a game in development, including a main character—fortunately… This character is on the one hand represented by a bunch of Box2D bodies and on the other hand, ...
0
votes
1answer
56 views

collision detection algorithm issue

here is the jsfiddle i am working on so far : http://jsfiddle.net/TLYZS/ if you debug the code and check the collision function you can see that the collision is working fine when the user overlap ...
0
votes
1answer
37 views

Dealing with multiple animation state in one sprite sheet image using html5 canvas

I am recently creating a Game using html5 canvas .The player have multiple state it can walk jump kick and push and multiple other states my question is simple but after some deep research i couldn't ...
0
votes
1answer
36 views

Box2D: Adjusting character position for side-scrolling

In my side-scroller I would like to give the illusion of the character walking forward while his sprite is actually being held in place. If he walks near the edge of the screen, I would like to adjust ...
-1
votes
1answer
260 views

View port for my canvas game

I am developing a canvas game, and im struggling to get my head around how i can make a view port so when the character moves the world moves with it. Unlike traditional 2d maps built with arrays i ...
-1
votes
1answer
559 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 ...
4
votes
0answers
144 views

How to do a genetic algorithm's chromosome which controls movements

First I would like to inform you that I'm french and 15 so my english is not very good. I've read some articles about genetic algorithms (GA) and since I discovered the HTML5's canvas element, I can ...
2
votes
0answers
18 views

Presentation / input layer that communicates with server

I want to learn more abot how to use some kind of presentation/input layer that communicates with server for HTML5 games. Instead of sending all the code to the clients browser, I would like to just ...
2
votes
0answers
323 views

Poor performance in android when running APK, runs fine in browser

I have created a small game project in HTML5 using Phaser engine (tried both 1.1.5 and 1.1.6). Then to port it to mobile platform, used Phonegap/Cordova for Windows Phone 8, Android and iOS. In my ...
1
vote
0answers
35 views

Maintaining relative location of objects across different screen resolutions

I'm developing a very simple interactive HTML5 game, in which I need to show a room having multiple objects like cupboard, table, fan etc. How can I bind all of the objects together, so that they ...
1
vote
0answers
293 views

Retrieving JSON return value from function and parsing in Construct 2

I would like to know how to parse a JSON object and parse each value into either an array, or something that I can use to set values of several global variables in my project file. I want to avoid ...
1
vote
0answers
88 views

Is there an out-of-the-box way to create a custom non-convex polygon in three.js?

Does Three.js offer an out-of-the-box way to create custom non-convex polygon, or do I have to use THREE.Geometry and set faces manually? I'm guessing that ShapeGeometry has something to do with this, ...
1
vote
0answers
391 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 ...
1
vote
0answers
69 views

How to work with edge Texture

Im not sure if i use the right terms, but im not able to find something to start with. Im trying to develop a little HTML5 game. I have a ground with a texture and now I want to make a surrounding ...
1
vote
0answers
642 views

How to turn a 3d camera (in HTML5 2D Canvas)

A few years back I started experimenting with 3d in canvas. Everything went pretty well untill I had to to turn the camera, I couldn't get it done. A few days back I just happened to stumble upon ...
0
votes
0answers
71 views

Custom rotateTowards function and rotating only around two axises

I'm building a framework for my WebGL project and at the moment I have a problem with a function which will rotate an object towards a target vector with a given angular speed. In Unity engine it's ...
0
votes
0answers
5 views

box2dweb issue in DestroyJoint function

my jsfiddle : http://jsfiddle.net/H8e9m/9/ as you can see when the ball reach the pendulum end and collide with it by a revolute joint, the problem occurred when trying to make the ball release the ...
0
votes
0answers
26 views

Animate 2D Human body Skeletal with Hands using JS

I am working on a JavaScript app to create interactive 2D animations in the browser. I'd like to create a human body. Let's consider this simple scenario to better explain what I want to achieve: I ...
0
votes
0answers
34 views

HTML5 Canvas: Get rect coords after rotation (relative to screen)

update: function(delta) { for (var i = 0; i < this.bullets.length; i++) { this.bullets[i].velocity = this.bullets[i].speed * delta; this.bullets[i].contextX += ...
0
votes
0answers
54 views

detection of a circle inside a rectangle in html5 canvas

I've created this game where the player can hit space to make the circle float in certain way. the main goal of the game is let the circle enter the rectangle .I did this code to create a collision ...
0
votes
0answers
195 views

JavaScript 3D space ship rotation

I am working with a fairly low-level JavaScript 3D API (not Three.js) which uses euler angles for rotation. In most cases, euler angles work quite well for doing things like aligning buildings, ...
0
votes
0answers
80 views

Bouncing objects against the side of the screen

I want to have certain circular objects bounce against all four sides of the screen. After searching a lot on the internet, I found the following formula: Vout = Vin - ((1+e) *dot(Vnormal, Vin) * ...
0
votes
0answers
105 views

Impact js Multibody entities with animations

I have a simple impactjs project working with box2d. just a "car" that can run over some rough terrain. I would like to have the wheels spin though. I know I could accomplish this with a sprite sheet ...
0
votes
0answers
126 views

Browser resize and orientation change in cocos2d html5

I'm currently starting a new project with cocos2d-html5. But I already stumbled upon quite a problem. If I load my game in a mobile browser and change the device orientation e.g. from portrait to ...
0
votes
0answers
108 views

How to integrate Javascript into C# and run scriptcode step by step

We are currently working on a Pokemon MMO trying to figure out how to implement an asynchronous scripting language the best. We don't want to work with threads or tasks, but the goal was to wait for ...
0
votes
0answers
281 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 ...