"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

0
votes
2answers
187 views

Why does my player stop when stepping onto a new tile?

Me and my friend are creating a game from scratch. He is in charge of art design and I am in charge of coding. I have done well so far with the code, but I have a collision detection problem when the ...
-2
votes
2answers
108 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 ...
3
votes
1answer
47 views

Confused about Max Vertex Uniform Vector limit

While coding my WebGL app I've encountered an interesting phenomena: On my first PC (with GPU Radeon HD 5850), BrowserLeaks (link) tells me that in my browser - Google Chrome Version 36.0.1985.143m ...
0
votes
1answer
33 views

Generate data points for shape based on an image

I am generating data points for 2d destructible scenery. Presently I had 5 for-loops (for a 5*7 2d structure) but will be expanding its resolution to outline a shape, but it will be horrible to code ...
0
votes
1answer
87 views

WebGL wrong scaling of rectangle

I'm working with this tutorial http://www.html5rocks.com/en/tutorials/webgl/webgl_transforms/ and my result is, that the rectangle moves in the direction of it's scaling values, and also scales at ...
-1
votes
1answer
580 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 ...
6
votes
0answers
2k 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
26 views

Algorithms for positioning rectangles evenly spaced with unknown connecting lines

I'm new to game development, but I'm trying to figure out a good algorithm for positioning rectangles (of any width and height) in a given surface area, and connecting them with any variation of ...
1
vote
0answers
46 views

Three.js camera turning leftside right

In Three.js I am trying to implement an orbiting camera can be rotated around the x and the y axis. I am using these two functions: function rotateX(rot) { var x = camera.position.x, ...
1
vote
0answers
25 views

Moving a div with hotkeys using easing in and out

I'm working on replicating Tagpro using AngularJS and Firebase as a learning project. I want this ball to move using ease in and out like in the youtube video below. My code: ...
1
vote
0answers
40 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
125 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 ...
1
vote
0answers
105 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
443 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
722 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
18 views

Drawing a object with Box2D and HTML5 canvas on current mouse position

I'm attempting to create a air hockey type game with HTML5 canvas and JavaScript, using Box2dWeb for the physics calculation. I need a way to draw the puck at the current mouse x and y position every ...
0
votes
0answers
25 views

animating a spritesheet using crafty.js

this is my jsfiddle : http://jsfiddle.net/seekpunk/ek6ub4u5/1/ i don't understand what i am missing it's been three days now working and trying to do the animation but i am stuck ...
0
votes
0answers
33 views

Calculating co-ordinates of a line/ray that's increasing in height with a known slope/radians. Height increase is also known

basically in my game I'm firing a line. The line's anchor point is at the very bottom of it, and half of its width. When I fire the line, its rotation gets set to face where we want it to go. Then, ...
0
votes
0answers
101 views

Picking tiles in an isometric diamond map

I am rendering a isometric map with the following code: for(var x = 0; x < MAP_WIDTH; x++) { this.map[x] = []; for (var y = 0; y < MAP_HEIGHT; y++) { var screenX = ...
0
votes
0answers
30 views

How do I repeat parts of some images in 2D Array in JavaScript but not all of them?

OK, I am trying to make a game that is a little bit like SimTower but utilizing HTML5 (particularly the canvas element) and JavaScript with a little CSS. I have progressed pretty far in the past week ...
0
votes
0answers
34 views

Box2d not showing consistent behaviour with sprites

Box2D newbb here. My question is in regards to this create js project:http://mboyeman.com/dashingdog/ (runs best in IE...:3) I wrote a function(assignBlockBodies) to give 2D Edges to sprites based on ...
0
votes
0answers
54 views

Javascript + HTML game slow on iOS

Just to practice, I made my own version of the 2048 game. (Link to the game is below). I don't understand why, but the UI updates with lag on chrome & safari on my iPhone 5. Since it's only ...
0
votes
0answers
46 views

EaselJS SpriteSheet isn't responding to gotoAndPlay

I'm developing a Fez-based HTML5 Canvas game using EaselJS and I've found a problem, that I can't solve myself, while trying to implement SpriteSheets to the hero. The problem is that I've defined ...
0
votes
0answers
127 views

Shifting the camera and setting a new scene when using Box2D

My jsFiddle: // START -- MOVE CAMERA var p = new b2Vec2(); p = (ball.body.GetWorldCenter().x) * physics.scale; pos.push(p); var length = pos.length; var s = (pos[length - 1] - pos[length - 2]); //in ...
0
votes
0answers
9 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
117 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
49 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
121 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
227 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
99 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
129 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
334 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 ...