"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
17 views

How do I combine two HTML levels?

If I have two levels that I have made separate in HTML5 how may I combine them so one comes after another?.
2
votes
0answers
20 views

Creating HTML5 Canvas Objects in Javascript

I'm currently trying to learn how to make HTML5 Canvas games with JavaScript. I would like to use object oriented JavaScript to manage the elements of the game, but i'm having trouble. I've done a lot ...
0
votes
0answers
18 views

What is the best way to manage 'state' in Phaser?

I have heard that this is not the best way to manage state in phaser var game = new Phaser.Game(800, 600, Phaser.CANVAS,'YourGameName'); game.state.add("Boot", Boot); game.state.add("Preload", ...
-2
votes
1answer
38 views

How do I clear the previous frames of a canvas animation?

I am trying to rotate an object, but all the previous frames still show up on the canvas. Here is my code. This didn't work: this.ctx.clearRect(0, 0, this.canvas.canvasWidth, ...
0
votes
1answer
14 views

How do I store game data with cookies?

Im working on a game right now, but I was wondering how I would store the game data in cookies(in javascript) where you can load it up, and resume the last spot you were at. I was looking at some ...
1
vote
1answer
49 views

Collectible card game, cards and effects

Based on Design of a turn-based game where actions have side-effects I am building a card-game where cards can have side-effects be triggered under different circumstances. I was given a good idea ...
0
votes
1answer
32 views

How can zoom into my object when that object is being clicked?

Suppose that I have the three game(cube,Quard,sphere) object. When I click on a particular game object suppose think I have clicked on the cube,the cube object should get zoomed in on the screen. how ...
0
votes
0answers
33 views

How to make a 2d game using java netbeans? [closed]

I'm an IT student, but my problem is my professor is just giving us codes but not explaining what is it for. Now, in our finals, our finals exam is we'll be making a 2d game using java. And I have no ...
0
votes
1answer
22 views

How to use custom font in Phaser ?

I am trying to load webfont in Phaser, I have seen the Phaser example but I cant understand, what asset do I need,what function I have to call....,what exactly look like the javascript file?. I am new ...
0
votes
1answer
19 views

Calculating pitch angle to hit a target using a projectile that has fixed speed

I am trying to calculate a vertical angle needed to hit a target at [distance, elevation] 2D coordinates relative to shooter given a fixed projectile velocity, air drag and gravitational ...
0
votes
2answers
77 views

Why does player still leave map?

I'm making a simple HTML5 RPG in pure JavaScript likened after Nox, Diablo or Titan Quest, with the character centered on the screen and the map moving around it. TL;DR: My character, when colliding ...
0
votes
0answers
12 views

How To Make ModPE Perform Function The First Time Mod Opened

I am making a Minecraft PE mod and I want to set a variable only on the first launch of the mod. So, how do I make it it set the variable and then not set it again until I import the mod again. ...
0
votes
1answer
19 views

Rotate coordinates back after rotating game context (geometry)

To achieve something similar to the image below using HTML5 canvas one can simply write the following: var TO_RADIANS = 0.0174532925; context.translate(30, 20); context.rotate(30 * TO_RADIANS); ...
-3
votes
1answer
72 views

handling wars in multiplayer browser game [closed]

I'm building a browser game about countries, cities, the user control his city, building it upgrading it, can fight other cities in the same country, elections and war between countries, peace, trade ...
0
votes
0answers
9 views

How to play the falling animation while using a Twoway component?

I am new to crafty and I was trying to write a simple platformer using Crafty.js. Here's what I've got var player = Crafty.e("2D, DOM, SpriteAnimation, PlayerSprite, Gravity, Collision,Twoway") ...
0
votes
0answers
15 views

UV texture mapping with perspective correction works for 50%

So, I've been trying to get the UV texture mapping down with perspective correction. The triangle rasterization seems to work. The interpolation seems to work too. It's just the perspective ...
0
votes
1answer
18 views

Error BCE0043,BCE0044 and UCE001 [closed]

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); ...
-1
votes
2answers
49 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
55 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
32 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
45 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
26 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
40 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
65 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
39 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
39 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
179 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
23 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
49 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
59 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
78 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
288 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
52 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
63 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
31 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
39 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
44 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
63 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
76 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
18 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
67 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
173 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
53 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
30 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
35 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
61 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
287 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
23 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
238 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
96 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 ...