"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. http://en.wikipedia.org/wiki/...

learn more… | top users | synonyms

3
votes
0answers
97 views

Change color of bitmap

I am attempting to understand the easeljs ColorFilter and its use with cache. There is quite a bit of information at the easeljs site but it's not clear based upon the examples and documentation. ...
3
votes
0answers
43 views

Image won't scale after click

Despite being a long-time developer I've never played with JavaScript libraries or any sort of graphics development. With my son we're trying to create something interesting and are using createjs/...
2
votes
0answers
73 views

My collision detection is not working when I rotate my mesh in three.js

I am trying to move a ball mesh through a maze. The maze belongs to a parent object3d. My issue is that when I move the ball I can't detect collision right well because in the rotation, the axis ...
2
votes
0answers
45 views

How would I add a sound variable to my code?

I am writing some code in JavaScript for a ray cast shooting program. I have all the variables I need except for sound, and I'm not too sure on how to add that variable into my code. I would really ...
2
votes
0answers
57 views

Phaser: Shader Chain

I want to implement lighting via shadowmaps. I see process as: 1) render something to RenderTexture1(size as game) 2) create RenderTexture2 (custom size) 3) add it to Image2 (custom size) 4) apply "...
2
votes
0answers
89 views

tilting image for mode7 game in HTML5

I'm making a mode7 game like mario-kart and I need to tilt the image before I draw it, I have tried using a buffer canvas to tilt the image then draw it on the games canvas but this makes it laggy (...
2
votes
0answers
38 views

Why does interactive cloth not appear in game view in unity5 Pro?

I used interactive cloth fir flags in unity5 Pro version and it appears in scene view but does not appear in game view while playing. What can I do for that please somebody help me out?
2
votes
0answers
160 views

Implementing Separating Axis Theorem to Detect and Handle Sliding Collisions

I am having a bit of difficulty detecting collisions properly with separating axis theorem. My code seems to be giving a lot of false alarms. Also, I've looked into implementing sliding collisions ...
2
votes
0answers
116 views

how to detect if a line is crossing another shape in javascript?

given the situation here http://jsfiddle.net/h902cLpy/ is it possible to detect that a line going from A to B does cross another shape while A to C doesn't?
2
votes
0answers
258 views

How can I mimic an isometric perspective using square tiles?

Can an isometric perspective be mimicked with traditional square tiles? Can't the effects of the 45-degree overhead view simply be "drawn in" to the square? How would this work? Picture this: the ...
1
vote
0answers
23 views

how to replace vertex buffer in webGL

I want to replace a vertex buffer with another completely different vertex buffer, different size and values, it will not get replaced every frame. gl.deleteBuffer(vertexBuffer); vertexBuffer = gl....
1
vote
0answers
74 views

Pixel by pixel collision detection pinball

I'm currently working on a Pinball game using the HTML5 Canvas and JavaScript. Right now I'm getting a hard time with the pixel by pixel collision, which is fundamental because of the flippers. Right ...
1
vote
0answers
33 views

How to fix my physics functions so they perform at the same speed across different FPS's

My jump function looks like - self.jump = function(){ //do the initial jump if (self.pressingUp && self.onGround) { //this just gets it off the ...
1
vote
0answers
57 views

Phaser - Add collision to a specific tilemap layer?

In Tiled I made two layers, "Background" and "Walls" and I have positioned them accordingly, both as a background and walls, or if you prefer "Not being able to collide" and "Being able to collide". ...
1
vote
0answers
32 views

align local Y to be parallel with global Y during or after slerp

I am using the following function to have a globe rotate a point on its surface to face the global Z toward the camera. This works fine, but after each rotation the Y axis seen as a green line is not ...
1
vote
0answers
79 views

Drawing a hexgrid on a canvas, yet making it zoom/scrollable?

I'm developing a game in JS / PHP. The game is basically a 2D plane (hexgrid) where each hex represents a location in space. In total, I'm drawing 25 * 25 hexes on a 1000x1000 canvas. I also draw ...
1
vote
0answers
100 views

Error with Cocos2d-JS when using Skeletal animation from Cocos Studio

Here is the JavaScript code: var size = cc.winSize; ccs.ArmatureDataManager.getInstance().addArmatureFileInfo(res.skeleton); // The error comes from the following line var armature = ccs.Armature....
1
vote
0answers
33 views

Combining Two Sets of JavaScript

So I am fairly new to programming and I am trying to learn by making a simple game. I watched to different videos on ray cast shooting and one of them has code for bullet hole decals that I wanted to ...
1
vote
0answers
38 views

Collision detection for multiplayer game with MatterJS

We are developing JavaScript multiplayer top down game where characters can move freely and collide with each other. We are rather weak at mathematics and physics, luckily we don't need much, just ...
1
vote
0answers
189 views

touch mouseOver in createjs - DispatchEvent() not working in iPhone/iOS

I have recently developed an html5 game using createjs and I am currently in the testing phase. The game seems to work fine in all the devices except for the iPhone. After careful analysis I have come ...
1
vote
0answers
96 views

Diagonal movement behaving strangely when other key is pressed

I'm following the tutorial at http://blog.sklambert.com/html5-canvas-game-the-player-ship/. I'm at the part where bullets get added to the game. Prior to this in the section about movement where I ...
1
vote
0answers
56 views

Need help in getting sequential impulse method working

i have made a very very simple physics system based on sequential impulse method - with single contacts only and no angular rotation at all. Contact points are calculated using separating axis theorem....
1
vote
0answers
71 views

Unity Javascript GUI.Button shows up twice

Hi I have created a simple menu in Unity but I wanted to create my own style for colour/fonts. However for some reason it prints each button twice to the screen, once with my custom style, and once ...
1
vote
0answers
151 views

Balancing fight script in Text Based Javascript Game

I'm working on a little text based javascript game and I've been using chromes Javascript console for the output. The 'game' works off a series of methods written into an object called Player created ...
1
vote
0answers
59 views

p2.js physics engine behavior on Heightfield

I am writing a small game consisting of a 'ragdoll' character riding a skateboard. I have created a 'skateboard park' with some ramps and a jump. I am using a 'heightfield' object as the ground. ...
1
vote
0answers
292 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 = ...
1
vote
0answers
46 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: http://codepen.io/...
1
vote
0answers
44 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
74 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 += this.bullets[i]....
1
vote
0answers
295 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
168 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
1k 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
9 views

Jerky mouse follow JS/HTML5/canvas

Can someone please advise. I am trying to create a simple mouse follow program, all is fine aside from when the mouse is moved too frequently, the movement is really jerky. Can anyone help? I am ...
0
votes
0answers
19 views

Creating new browser multiplayer game

I decided to make an browser-based multiplayer game with huge armies. So far in a year i have created an army editor, where you can create armies, place then anywhere, set several moving targets and ...
0
votes
0answers
21 views

Jumping on meshes in Babylon.js

So I want to make it possible for players to jump on objects (meshes) that are somewhat lower than the players camera. I have set the checkCollisions to true but i can't seem to jump on any objects (...
0
votes
0answers
31 views

Drawing strings with a fabric texture in Javascript - possible?

Am exploring ways to programmatically generate string arts (sort of like these physical examples: https://goo.gl/d2Gyeg) in the browser. Any gurus out there that can help guide this exploration down a ...
0
votes
0answers
26 views

p2 collision not working after state change

i have 2 objects GAME.ball Game.stick both have two bodies and i have two scene first scene GAME.ball = game.add.sprite(x,y,key) game.physics.p2.enable(GAME.ball, true); GAME.ball.body.dynamic = ...
0
votes
0answers
24 views

Floor casting in a Raycasting engine

I'm trying to create a pseudo 3D, raycasting engine with plain JavaScript rendered on the HTML5 canvas. In short: a Wolfenstein 3D clone. So far I have gained inspiration from the following guides: ...
0
votes
0answers
9 views

ThreeJs camera angles

I'm trying to build a 3D editor for my game. What I'm trying to achieve is an IDE similar to the most part of 3D modeling softwares (Blender, 3D Max, Maya, etc) where you can choose the camera angle ...
0
votes
0answers
40 views

Multiplayer game server sync

I am building a 2d multiplayer game with no physics and my own authoritative server. Already have all players getting synced each with other but their movement isn't so smooth yet. Here is the ...
0
votes
0answers
51 views

Collision detection not working for JavaScript Game

I'm working on a JavaScript game called Spacecraft which is minecraft 2d style. The problem is that my collision detection is not working. It works for a all the divs but the ones with the class of ...
0
votes
0answers
20 views

Event handling for moving components in an HTML/JS game

I have developed a working prototype of an arkenoid-kind of game using plain HTML/JS/CSS3. I am using the DOM to display game elements. The whole game is infact contained inside a table element. Table ...
0
votes
0answers
46 views

Errors in code examples from the book “Advanced Game Design with HTML5 and JavaScript”

I have purchased Advanced Game Design with HTML5 and JavaScript and have started going through the chapters. I notice that after chapter 2 I get code errors and the source code from the downloads ...
0
votes
0answers
20 views

Emscripten / webgl lazy rendering?

I compiled existing opengl es 2.0 code to webgl using emscripten. In the desktop version there is lazy rendering mechanism that only renders when required which is basically just saying invalidate ...
0
votes
0answers
19 views

add physics to a group or container body in phaser

I'm developing a HTML5 Phaser game. In this game I do have a Group which I would like to behavior as a physics body (arcade-physics). It is a character with a lot of moving parts (sprites) inside ...
0
votes
0answers
30 views

NodeJS timed update approach

My game has users building buildings, recruiting units, trading resources and sending attacks. All of this functionality takes a certain amount of time to happen and I'd like help with deciding on the ...
0
votes
0answers
21 views

Collision event callback on p2js not working

So, I'm making a simple game on Phaser where a ball object and bullet group collide with each other, incrementing a score variable whenever this happens. I already set up the collision groups and are ...
0
votes
0answers
29 views

Create a character from multiple sprites

I have multiple spritesheets for a character in my game. The user can decide which gender, which hair, which haircolor he wants. Some images have to be on a higher layer than others (hair > head > ...
0
votes
0answers
22 views

Camera movement on a sphere, and how to look while doing it

I am trying to make some kind of pointerlocked walking simulator that involves movement of the camera on the inside of a sphere. I've looked at Walking on a sphere, but that solution fights what I'm ...
0
votes
0answers
35 views

Multiplayer Keeping the Client and Server Updates in Sync?

I am working on a Multiplayer Game, I have a client loop which can run at 30-60fps. Inside of that Loop I check whether the players left mouse is down. If it is, send a shoot command to the server. On ...