"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
0answers
23 views

Deploy javascript game on andorid and ios [on hold]

I have a javascript game (html5) developed for web, which i want to launch on android and iphone app stores. i have surfed the web and i found this platforms.. CocoonJS, Game Closure, PhoneGap, ...
-1
votes
2answers
30 views

isometric tile tiled format javascript

Okay im having a problem with drawing an isometric map exported from tiled. Here is my problem. where it should be like this Here is the code that i used to reproduce the 1st image, what's wrong ...
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 ...
-1
votes
0answers
16 views

How do I build Flash UI elements and link them to game commands? [closed]

So basically I want to make a game like Evony and any game produced by Kabam. A browser based strategy game that plays in real time. I know the basics of HTML, CSS, and some JavaScript. I know they ...
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 ...
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
votes
0answers
31 views

WebGL First Person Camera - Matrix issues [closed]

I have been trying to make a WebGL FPS camera.I have all the inputs working correctly (I think) but when it comes to applying the position and rotation data to the view matrix I am a little lost. The ...
14
votes
3answers
3k views

How to avoid movement speed stacking when multiple keys are pressed?

I've started a new game which requires no mouse, thus leaving the movement up to the keyboard. I have tried to incorporate 8 directions; up, left, right, up-right and so on. However when I press more ...
2
votes
1answer
29 views

Mouse input and structure in JS [closed]

I am creating a simple concept where I have a small menu to choose a tool from and then I can click and drag to build. For example, I click on the rails tool and then I can click and move the mouse ...
1
vote
1answer
40 views

Removing a previously rendered image on a canvas

I made a platformer using ctx.clearRect and ctx.fillRect, so each time the player moved I would just delete the previous position and draw him again. Now I'm working on importing my own art into the ...
-2
votes
1answer
79 views

Energy Bar in Unity [closed]

I want to display a debug message when the progress bar is loaded fully and I have a button "refresh", when I click this it should reload the progress bar. Here is the code I have tried: var ...
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
2answers
113 views

Deal Damage to Player

I have to make a simple "avalanche" game to show I know how to use the physics and creating terrain. But I actually wanted to go a little above and beyond and actually give the player health so there ...
-1
votes
1answer
55 views

If object is bellow another object… do something [closed]

I have 2 objects in scene. When pillar is bellow target, pillar object needs to animate. I get this error: "NullReferenceException: Object reference not set to an instance of an object". var pillar : ...
5
votes
1answer
161 views

City/Nation Builder - Unlocking game elements over time

Current Git (Needs more documentation) Current working prototype to play with (Git code is after a BIG refactor) Background: I'm making a javascript text city/nation builder along the lines of A ...
0
votes
2answers
112 views

Health bar in unity

I have created a button as my health bar and it must decreasing after a specified time.Here is the code I have written.But the problem,this code is working in the form "Its decreasing the button ...
0
votes
1answer
79 views

How to enable/ disable GameObject

I have child object with ParticleSystem component. I want to have particles disabled until I press button. I unchecked child object to make it disabled but when I press play it enables ...
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
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
3answers
100 views

2D collisions between 2 arrays

I'm trying to do collision detection between bullets and enemies in my game. But it's very unpredictable and sometimes it works, sometimes it doesn't (bullet goes straight through without doing ...
1
vote
4answers
97 views

Check which object was activated first

How do I check which object was activated before the other? Let's say that there's door to open. To open the door you need to press firstly the second button and then the first button...but not the ...
0
votes
1answer
93 views

Press multiple switches to unlock the door

I made 2 scripts, one that is a switcher and one that checks if object is switched (Switch, SwitchCheck). Switch script (it's on 2 objects that are switches and both objects have colliders with ...
0
votes
2answers
100 views

How to show a float with no decimals [closed]

I want to show the current health and stamina of the player using GUI.Label. All is working fine however it shows the values with decimals to the millionth (example: ...
-1
votes
1answer
82 views

Code explanation

Can someone please explain whats going on in this code written by Paul Irish I did not understand the draw(). function draw() { var time = new Date().getTime() * 0.002; var x = Math.sin( ...
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
1answer
39 views

Regeneration using Time.deltaTime

I'm trying to regenerate stamina at a rate of 1 per second using Time.deltaTime, however this doesn't do anything (My 'current stamina' doesn't change at all). I've done some looking around and I have ...
-1
votes
2answers
50 views

Character bounces/stutters down hills

I'm using Unity3D (not 4) and I'm experiencing a bit of a problem with character movement. I'm using a cylinder as a First Person player with a child Main Camera. In this cylinder is the stock ...
0
votes
1answer
31 views

How to use setInterval and clearInterval

I have a game that I am making and cannot seem to get the setInterval and clearInterval methods to work. When I debug it in the browser console it shows that the method is still being called over and ...
0
votes
1answer
59 views

Continous collision happening in Unity2d

I am working on Unity2d. I have a game object called gameobject1 on screen. It holds an image (named "state"). When I drag a tree on a gameobject1 collision is happening continuosly in the same layer ...
0
votes
1answer
58 views

How to use sprite as font in Unity?

I've started working on my first game in Unity; It's very simple, there's a spinning block in the middle, and there are spinning blocks coming from all sides. When they hit the middle block, you lose ...
1
vote
3answers
117 views

Freeze Player position temporarily?

I'm making a 2D sidescroller (although it's technically being made in 3D), and I need to freeze a player's position temporarily. With a RigidBody, this would be simple, but I can't think of how to do ...
0
votes
2answers
67 views

Collision detection: Swinging bat/racket and ball

I am programming a side-view tennis game, inspired by an old arcade game, using Javscript and HTML5 canvas elements. The player can move left and right and holds a racket at arms length which can be ...
0
votes
1answer
47 views

Rotating a view of a chunked 2d tilemap

I'm working on a top-down (oblique) tile-based engine. I would like for the tiles to have a definable height in the world, with Characters being occluded by them, etc. This has led to a desire to be ...
3
votes
4answers
313 views

Why do I need a local server for HTML5 game development?

I'm new to HTML5 game development. I'm trying to make something using Pixi.js, but when I tried to view it in a browser, I saw a blank page. According to the tutorial I'm following, I need to set up a ...
0
votes
1answer
51 views

Phaser/HTML5 - Trying to add five instances to a group and display on the screen!

just started using Phaser today after seeing Thomas Palef's lessmilk series. I completed PhotonStorm's "Make your first Phaser game" tutorial, and grabbed the skeleton, some CSS, and started to throw ...
3
votes
1answer
58 views

How to calculate whether a cuboids face edge is infront of or behind another for sorting

I'm building an isometric game, I want to position and sort objects in a particular way. All my entities have 3d bounds which determines their cuboid, looking my example, a different edge is used to ...
2
votes
2answers
87 views

How can I manage complicated visual state over a simple model in puzzle games?

I've been encountering this design challenge making a few toys with Javascript (CreateJS, EaselJS) The scenario is that you've got some sort of puzzle game with a simple game model. For a simple ...
0
votes
0answers
32 views

top down 8 directional movement - need help with collision [duplicate]

I have for some time now been strugling with movement in my game. I want a zelda like 8 directional top-down movement. I have tried different things, but non of them have been perfect. EDIT: ...
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
votes
2answers
72 views

C#Script select GameObject

I want to load the prefab instead of the gameobject that is in the screen, my code is this one: using UnityEngine; using System.Collections; public class Arma : MonoBehaviour { public static int ...
2
votes
1answer
128 views

Inverse Explosion with Unity2d

I am currently trying to make all other objects push away from the player when the player explodes. It currently works, but it pushes close objects a little and far objects very far. What I want is ...
0
votes
1answer
68 views

One draw call with one big mesh VS many draw calls with many little meshes

I have read that in order to optimize WebGL application, one should reduce an amount of draw calls. But does it mean that computing a one big mesh from all single meshes on CPU by modifying vertices ...
0
votes
1answer
137 views

Problem with Raycasting in a 2D Game

I'm new to using unity and came across a problem when I was following a tutorial. The game is in two dimensional space, and when my player walks over a certain tile the detection never goes off. ...
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
1answer
83 views

How does this game loop actually work?

I read this playfulJS post, about ray-casting: http://www.playfuljs.com/a-first-person-engine-in-265-lines/ It looks really interested, so I decided to look at his javascript. I am no expert in ...
0
votes
2answers
128 views

How to move an image back and forth with javascript

I currently am trying to make a baseball game and have this code here: http://jsfiddle.net/769BK/ I have the baseballX set to a decrement, and then I try increasing the value using baseballX++; but it ...
1
vote
1answer
163 views

Unity3D - Android pause screen - double click issue [closed]

I made a pause script for the game im developing for android. I added the script to the GUITexture I created and placed on the top right side of the screen.The issue stands at the part where if the ...
2
votes
2answers
64 views

Linking one uniform variable to many shaders

Let's say, that I have 3 programs, and in each of those programs there is a view matrix uniform, which should be the same in all those programs. Right now, when my camera moves, I need to re-upload ...
0
votes
1answer
104 views

How to solve problems with movement in simple tile based multiplayer game?

I'm making a simple tile based 2D multiplayer game in JavaScript using socket.io where you can move one tile every 200 ms. The two solutions I've tried are as follows: The client sends "walk one ...
0
votes
2answers
148 views

How to move an object using X and Y coordinates in JavaScript

I am making a 2d baseball game with JavaScript and HTML5 and am trying to move an image that I have drawn with JavaScript like so: //canvas var c = document.getElementById("gameCanvas"); ...