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

How to deal with extremly big numbers in javascript? [on hold]

I am making a idle game like http://www.clickerheroes.com/ . I am doing it using createjs html library(doesnt matter). Anyways what i want to know is how i can deal with extremly large numbers that ...
0
votes
0answers
16 views

InvalidCastException: Cannot cast from source type to destination type [on hold]

I have fetched the data from xml and stored it in an array.I have coded as below private var timearray:Array; private var distancearray:Array; private var distancedata : String; private var timedata ...
0
votes
0answers
14 views

Zoom with panning causes jumpy glitch

So i have been playing around in canvas HTML 5 trying to get a nice zooming and panning feature to work nicely. Problem is I have some mistake regarding the logic to it. When a user zooms in or out ...
1
vote
0answers
46 views

RPG game engine HTML5/javscript [on hold]

I am planning to build a 2D RPG game (Zelda style). I am looking for a game engine that has the following features: Map editor to create maps (preferably orthographic grid), with solid objects, ...
0
votes
0answers
24 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 ...
0
votes
0answers
34 views

What is the easiest way to develop a fixed perspective 2D game with an isometric tiled map using Javascipt? [on hold]

The main stumbling block I've come across with the couple of libraries I've seen is that it's extremely difficult to add ramps or the idea of height. The basic idea I'm going for is Diablo 2. I've ...
0
votes
0answers
29 views

JavaScript UI library (for games)? [on hold]

I'm at the point with my HTML5 game where I'm looking for viable UI libraries that have at least basic widget support and support modern browsers (mobile support not needed). I've found three (that ...
0
votes
0answers
27 views

HTML5/Javascript multi-platform games in Android/iOS: How fast is it? And any good frameworks? [on hold]

I've been wanting to get into mobile game development for a long time, and as a Web Developer, the idea of making a game in a web platform like HTML5 and Javascript that was compatible with any ...
0
votes
3answers
55 views

Add a Countdown Timer that increments in JavaScript and resets per level(Resovled)

I am currently developing a Simon says type game using jquery and javascript. I have linked a fully copy of the game on github Github download and unzip to see the game fully ...
0
votes
1answer
19 views

Get speed from vector using box2d and javascript

I need to find the speed of an object in a game. The game is made in HTML5 with jquery and jquery.box2d. For this I can use these methods: GetLinearVelocity().x; GetLinearVelocity().y; I'm then ...
0
votes
0answers
28 views

Printing the values from the corresponding array [migrated]

Suppose 1 A 2 B 3 C I need to print the value corresponding to 1-> A I have put both in two array d1[1,2,3] s1[A,B,C] Now i need to print the value in the form shown in the above d1[0] ...
0
votes
1answer
52 views

How can I get a 4x4 matrix from a bullet quaternion?

I'm trying to make a game using JavaScript with Ammo.js ( an implementation of bullet ) and Sylvester to do my matrix maths. The problem is I don't know how to turn the WXYZ that bullet gives into the ...
0
votes
1answer
37 views

How to color each letter text in Phaser.js?

I have a text created with text object (game.add.text) and I would like to color each letter differently if that is possible. If not, how can I achieve this?
1
vote
1answer
43 views

using delta timing is causing shake

I am using delta timing to account for potential drop in frame rate. Only trouble being when I do this, I can notice an ever so slight wobble. I checked out the following JSFiddle coming from a ...
0
votes
0answers
7 views

How to declare a variable type in javascript? [migrated]

I was doing JavaScript, and I was wondering : can we declare a type for our variable ? if yes, how?
0
votes
1answer
92 views

Enemy clones don't target player

In a small game that I'm making enemies multiply when you kill them, however when clones are instantiated they don't chase the player like the original prefabs do (example: ...
1
vote
0answers
37 views

A problem with collision when a sprite changes size (Phaser framework)

I have a sprite in my game that changes size at certain points in the game. It changes size via the sprite.body.setSize method. Unfortunately, it seems that the sprite is unaffected by objects that it ...
1
vote
1answer
67 views

Prefab disables its script when a clone is instantiated

A clone of a cube is spawned when it is destroyed, however the clones disable the script in the editor (example: http://gfycat.com/SnarlingScornfulEgg). Used the exact same script for a different kind ...
2
votes
1answer
56 views

How do I change the material of an object with Script in Unity?

I was making a game with Unity and I want to change an object's material using JavaScript when the player collects 5 collectables that I made. The collectables get stored in an int variable called ...
2
votes
1answer
50 views

How do I save variables and load them in Unity with JavaScript?

I made a game and i want to save the high score and load it back. I need to save 3 variables and load them when the game starts. How do i do it?
19
votes
3answers
3k views

How do I make a JS game downloadable?

I can put the HTML and JavaScript together in the same .html file, but the images need to be separate files. The only solution that comes to my mind is to give to the user a .zip folder. This is not ...
1
vote
1answer
57 views

How do I use elapsed time as the player's score in Unity?

I'm making a "survival" game, where the goal is to stay on a rotating board as long as possible. I want to add a score system based on how many seconds passed. For example, if you stay on the board ...
1
vote
0answers
65 views

Extracting Top-Down Race Track From Google Maps

My final year project for university is based on the idea that a two-dimensional top-down multiplayer racing game can be made using Google Maps to dynamically generate race tracks. The idea is that ...
0
votes
3answers
72 views

How to move around in a map and remember position?

I am working on sound labyrinth game. My game is about a person getting trapped in the basement and the only way to navigate and get out is through sound. I have created a map over the basement and ...
1
vote
0answers
18 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. ...
0
votes
1answer
75 views

Map scrolling around the world

I am developing an TBS (turn based strategy) game. I have created a simple canvas renderer to render hexagonial map. I already implemented scrolling on the map. My current problem is that I want to ...
1
vote
3answers
139 views

Why cap game loop delta-time?

I was reading some game's source code on Github and saw this game loop implementation for the first time: var lastTime = 0; var maxTime = 1/30; /** * @param {DOMHighResTimeStamp} curTime ...
0
votes
0answers
14 views

Crafty Bind “createView” to viewport - TiledMapBuilder

Is there any way to bind the createView function to the player entity? For Example: I am moving forward and the map is automatically loaded. I call the Map with: Crafty.e("2D, DOM, ...
0
votes
1answer
29 views

changing a sprite width when playing a reel using Crafty.js

can anyone help me with this : http://jsfiddle.net/B5UsC/20/ you can see that the sprite animation is not rendering correctly when the reel is in the last frame when animating Hardpunch is it ...
0
votes
1answer
47 views

Move camera from wherever camera is to pinned point

So, I need to switch/ move/ animate camera from point X (not point A,as I don't know where the camera is at that momemnt) to point B (place where you want your camera to move). This is for ...
0
votes
0answers
15 views

changing sprite coordinate when defining a new reel in crafty.js

this is my jsfiddle : http://jsfiddle.net/B5UsC/18/ this.bind('KeyDown', function () { if (this.isDown('A')) { this.__coord[0] = 57; ...
0
votes
1answer
28 views

confusion in animating a sprite sheet using craftyjs

can anyone help me with this : http://jsfiddle.net/B5UsC/15/ you can see that the sprite animation is not rendering correctly and i am guessing that i am not using the exact width of the sprite ,i ...
0
votes
1answer
65 views

I can load new tiles but how do I load new chunks?

I have successfully been able to add new tiles and place random trees on a 2d map grid however I haven't used chunks. I just load a new tile when the player moves and save it to the map array. But I ...
1
vote
1answer
61 views

Objects don't instantiate at mouse position

I'm trying to get the player to shoot a projectile at the mouse position, however the projectile is shot in weird directions (http://gfycat.com/BothFluidHoneyeater). Here is relevant part of my ...
1
vote
1answer
80 views

how to store game state for a multiplayer board game eg. poker

First Approach: Store the state in database and play with database queries. Could a database handle the load, as poker is quite fast paced, and I have to query/update database for each player move. ...
3
votes
1answer
57 views

CSS Sprite position updates slow due to addition of 'px'?

I'm moving fewer than 10 position: absolute elements around the screen. An enormous amount of CPU time (profiled in Chrome as (program) i.e. native code) is used where I do the following: style.left ...
0
votes
1answer
28 views

Align SpriteText position

i have this function which aligns text. static function AlignTxt(obj : GameObject, txtAnchor : SpriteText.Anchor_Pos, txtAlign : SpriteText.Alignment_Type) { ...
0
votes
4answers
117 views

How to handle a negative coordinate 2d map with a growing map size

I love this procedural generation theory and have been messing around with it. However I'm having trouble wrapping my head around how to store my map data. Usually I store my map data in a 2d array ...
0
votes
0answers
16 views

Box2D.js b2ChainShape

I'm using box2d.js (asm.js ported) and need to create a b2ChainShape. var bodyDef = new Box2D.b2BodyDef(); var fixDef = new Box2D.b2FixtureDef(); bodyDef.set_type(Box2D.b2_staticBody); var chain = ...
3
votes
3answers
315 views

Procedurally Generated Top View 2D RPG Map Generation

Procedural generation is a fascinating concept and is gaining popularity in the gaming industry. The thought of playing a game that has new content every-time the game is played is very exciting to ...
2
votes
2answers
97 views

How do I translate accelerometer readings into object movement?

I am using the DeviceMotionEvent web API, which gives me a device's acceleration split up into x-, y- and z-dimensions and a time interval. Here's my attempt at moving an object on screen based on ...
-2
votes
2answers
46 views

isometric tile tiled format javascript [closed]

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
54 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
0answers
42 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
33 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 ...
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
44 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
49 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
173 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
1answer
52 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 ...