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

platformer side movement collision problem [duplicate]

I making a game in javascript and I'm stuck, the player will stop moving if he hits the left side and if I move left a little bit and try to move right again I cannot. My question is: Whats wrong ...
0
votes
1answer
13 views

Error BCE0043,BCE0044 and UCE001

I got my code right here: #pragma strict var hSliderValue : float = 0.0; function OnGUI(){ hSliderValue = GUI.HorizontalSlider (Rect (25, 25, 100, 30),hSliderValue, 00, 1.0); ...
0
votes
1answer
18 views

How do i make an idle-styled counter in Javascript & HTML

I just started making a basic game in HTML, CSS, Javascript, and JQuery, but I want to have the money add up after a certain amount of time (if you have ever played an idle game, you'd know what i ...
1
vote
2answers
32 views

Applicaton.ExternalEval(String script)

I was wondering, if Application.ExternalEval(String script); in Unity3D can return something. Like:String playerName = Application.ExternalEval("prompt("Please enter your name", "player1")"); Thank ...
1
vote
0answers
14 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 ...
0
votes
1answer
39 views

2D movement issues

So I'm making a isometric game in javascript, so far it goes well. But I have some problems when a object it suppose to walk from point A to B. Item.prototype.update = function(delta){ var speed ...
0
votes
0answers
30 views

Javascript Game Engine Problems [closed]

I am making a game engine in javascript which looks like this: MyGameEngine = { Engine : function(){ this.tick = function(){ //do update stuff } this.render ...
0
votes
0answers
7 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
34 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
1answer
57 views

Client interpolation for 100% serverside game

I'm developing an online browser MMO 2d war game. And I'm having some issues with the interpolation. The server sends updated positions to the clients every 90 ms. I've managed to make it smooth, ...
2
votes
1answer
34 views

Platformer Collision in javascript

Hi im making a platformer in javascript and this is the collision function that I have if(obj2.y > obj1.y + obj1.height || obj2.y + obj2.height < obj1.y|| obj2.x > obj1.x + obj1.width ...
1
vote
0answers
27 views

Javascript 2D top down handling player direction graphics

In my top down game I can move the character around and the character will even face the direction he is moving however there is some weird behavior I'm having when you hold down one direction and ...
3
votes
1answer
150 views

Roguelike 2D Collision Detection

I'm just a normal guy trying to do some basic collision detection but I suck at it. I either get stuck in a wall or I go in reverse in the wrong direction trying to update the player position to a non ...
-1
votes
1answer
19 views

Java-script map/array “undefined” [closed]

Hi when I call the the function below in the chrome console it tells me "Type error cannot read property '2' of undefined" why?. defining the map: var map = { FALL:[ [0, 0, 0, 0, 0, 0, 0, 0, 0, ...
0
votes
0answers
38 views

Android client-server logic for a multi-player game

I'm creating an android "quiz" app. The game can be played by two user in real-time. I'm creating game on server with this design: //node js server //new game request api @game/request/new var ...
-1
votes
1answer
52 views

Adding obstacles & collision to canvas game

I am trying to add some obstacles to the canvas game that I've got but something seems to be wrong and I can't seem to put my finger on it. I just want some simple walls here and there to make the ...
4
votes
1answer
75 views

Cram search results into viewport (of a search minimap)?

I'm no coder, nor do I try to be. I just had one of those "it's impossible" arguments with folks who love to argue with me before they even understand what the argument is about :) So I need to ...
0
votes
2answers
155 views

Rotate an object smoothly by 90 degrees on key press in unity3D

[I saw few similar question on stackexchange but none is solving the purpose.] I want to rotate a 3D object by 90 degrees on different axis on respective inputs. For example if 'a' is pressed, the ...
0
votes
1answer
41 views

Unity3D WWW get HTML displayed in browser

I currently have in a web page, on a localhost server, some information that I want to use in Unity. My problem is that this information are stored in some js variables. I tried to use the WWW class ...
1
vote
0answers
52 views

Basic mmo client/server relationship. Is my approach correct? [closed]

Lately a friend and I have been thinking about making an mmo after we finish highschool and while I have more than some programming experience I have never before made anything like an mmo so two days ...
0
votes
0answers
26 views

cocos2d-x : set search path not working

im using cocos2d-x javascript and i tried to set search path or asset for multi resolution devices like so in main.js file if (cc.sys.isNative) { // if game is native assetsPath = ...
1
vote
0answers
27 views

Intellisense with PhaserJS Library in Visual Studio Code

I am trying to use Visual Studio code along with PhaserJS but am confused about why the isn't working. I've read through http://www.johnpapa.net/intellisense-witha-visual-studio-code/ am think I ...
1
vote
0answers
36 views

How do I add scripting logic to my dialogue tree? [closed]

I'm creating 2D RPG game and I want to implement branching dialogue system which can also change player stats, add items and so on. Also I want to implement conditions for some answers so player ...
0
votes
1answer
60 views

is this approach correct to make my game framerate indipendent in javascript?

this is what i did my game loop is run every REFRESH milliseconds loop = setInterval(tick,REFRESH); in the loop i calculate how much time is passed since last tick and subdivide that for how much ...
2
votes
1answer
59 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?
1
vote
0answers
17 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 ...
0
votes
1answer
61 views

svg spaceship game movement 2d

I've been searching for a way to make an svg box move to all directions using js. I have seen many tutorials on how to do it grid like, but I want it so have a square that can turn, move forward, ...
0
votes
1answer
113 views

Unity 5: Accessing a C# variable from Javascript

I've set up a SQLite database with Unity. Into this I would like to add the current CPU Utilisation. The SQLite scripts are in Javascript and the method for finding the CPU utilisation is in a C# ...
0
votes
0answers
40 views

JavaScript; Chunking an Array/Map

I'm creating a game using Pixi.js and have decided that the best way to present a map is to "chunk" it in to 16x16 tile sections and render each when needed - I'm having a bit of trouble parsing an ...
0
votes
0answers
26 views

Phaserjs, filters, save to image cache

I've tried to apply a Pixi filter to a image and save it to cache but the image doesn't get saved with the filter. colorMatrix = new PIXI.ColorMatrixFilter(); colorMatrix.matrix = [0,0.0,0.5,-0.2, ...
0
votes
1answer
29 views

Rectangles clear each other when moving on canvas

I am having this problem after moving rectangles, they seem to delete one another. Most probably it is a problem with clearRect(...) method. This is the clean function I am using: clean: ...
0
votes
0answers
46 views

Convert Cocos2d-x JS Sprite to PhysicsSprite?

I have a Cocos Studio project that has a node that contain multiple sprites. I am loading this node and iterating through the children (each are a cc.Sprite object); I'd like to convert each ...
3
votes
4answers
280 views

How to enter a level when touching an object

I am working on a project in Unity 4.6.1f1 and I was wondering how can I make a cube touch another cube to go to the next level (the image below)? ! EDIT: I made a script and put it on the purple ...
0
votes
1answer
21 views

Image drawing then blackscreen on AVD using cordova

I have an issue on my android JS based game, the game displays well for 1 second then total blackscreen. window.requestAnimFrame = (function(){ return window.requestAnimationFrame || ...
0
votes
1answer
148 views

How to use Cocos2dJS to connect to a Socket.IO server?

How can I connect to a nodejs socket.io server from a cocos2djs game? I've google all the way to no avail. I tried this but it does not work: socket = io.connect('http://192.168.254.102:7714'); if ( ...
0
votes
0answers
76 views

Implementing wall-sliding physics in THREE.js

Yo, Basically I want to make a 3D environment where the player can walk around a 3D world, and collides with objects / terrain like any other 3rd person / 1st person game. The world can contain any ...
1
vote
0answers
33 views

Collision callbacks in a javascript engine [closed]

I'm making a game engine in javascript for Educational purpose. I already have the collision detection and collision response parts and are working fine, but i want to let the user define his action ...
1
vote
1answer
126 views

In PHP, how do I implement multiplayer “rooms” for a turn-based game?

I'm working on a multiplayer checkers game. I want to let players choose another connected player and invite him to play. I have a working game engine and rendering, but I'm stuck on the multiplayer ...
1
vote
1answer
39 views

Call a native mobile API in Construct 2?

It is possible to use mobile api features in a Construct 2 game (html 5 / js engine) ? I didn't find anything about that on the net, unlike anothers game frameworks like Corona Entreprise or ...
-2
votes
1answer
66 views

Unity skips menu screen and goes to next scene

I am using Unity 4.6.1 and I am working on a game project. I created a JS script with Application.LoadLevel to go to the next scene. Here is my code for OnGUI: function OnGUI () { { ...
0
votes
1answer
48 views

Randomised Path from A to B for cursor movement simulation

I'm trying to simulate the movement of the mousecursor, by creating a path from point A to B that has random variation. The algorithm I'm using at the moment is very basic, and is limited in that ...
1
vote
1answer
502 views

Is there a javascript physics engine that does not require canvas? [closed]

I just need a really simple and small physics engine for squares or circles that moves images using javascript. For the project that I am working on, I can't use canvas, so I will be moving the images ...
-1
votes
1answer
75 views

Centering camera on player div

I've been making a roguelike-style game in HTML5 without using canvas (only divs) with pure JS (fiddle!). I've been trying to enlarge the tile size (font size) while keeping the player centered within ...
0
votes
0answers
38 views

Fix latency when sending state

I have a multiplayer game done with Phaser, which runs in the browser and on a node.js server. The server is authoritative, every 50ms or so it sends the game state object to all clients. The clients ...
0
votes
0answers
139 views

making Circle button in phaser

im trying to make a circle button with tap event i used hitArea property from sprite class and using pixi Circle class i did that this.sprite = game.add.sprite(50,50,"cursors"); ...
1
vote
1answer
185 views

Cocos2D-JS Windows App in fullscreen mode (Win32)

I've been looking for a way to make my Cocos2D-JS app go into fullscreen mode, but there doesn't seem to be much documentation on Cocos2D-JS (or Cocos2D-x-js as some seem to call it.) This app is to ...
0
votes
0answers
105 views

Insert 3d text to the front face of a cube GameObject

I want to add a text to a cube in Unity. I have a cube which has a 3d text as a child. I am using the below javascript to write on the 3d text: #pragma strict function Start () { } var countdown : ...
0
votes
1answer
90 views

Help with scoring system and score multiplier

I am new to the scripting world and I am currently trying to add a score multiplier to the game code I am working on. Right now the score is set to increase as the player runs across the level however ...
0
votes
1answer
60 views

Simulate popularity

I'm working on a music game. It has genres like pop and rock. Different centuries have different music popularities. (Influences the sales) I thought about building an object like this: var rock = { ...
1
vote
0answers
126 views

In Phaser, how should I be managing state? [closed]

I'm quite new to Phaser and JavaScript really confused about state management. Phaser has lots of documentation and info on the net, but everyone seems to be doing it a different way. An example: ...