"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

0
votes
1answer
44 views

My polygons only register a collision if they are the same shape and directly over top of each other

I'm trying to learn about 2d polygon collision detection/handling and have ran into a snag. After running through lots of tutorials and sample code I've attempted to implement my own polygon class ...
4
votes
1answer
117 views

Fixed Time Step Flutter

I've seen a lot of questions about this problem, but really no solution. Hopefully I can explain the issue well enough that I can get some sort of closure on this problem. I'm using a Fixed Time ...
1
vote
1answer
237 views

How Can I Find a Shape on 2D Array?

For the code in my test project, I want to find 2D[,] array shape on the char[][] list. I created an actual map with 'char[][]' array. So, how can I find a tileChar's shape on the worldChar array? ...
1
vote
1answer
123 views

Making a Fall Trigger Game Over

I have been struggling with this fairly basic issue: To make a game over menu appear upon death. I am making a 3D game in Unity, where you, the player, must control a sphere with the basic controls: ...
1
vote
1answer
82 views

3D Planetary gravity

so i am making a thing in javascript and i want to have planetary gravity in my "universe". But when i use an equation to calculate the acceleration by gravity i get one number. That is how fast the ...
0
votes
0answers
85 views

Using canvas graphics instead of traditional sprites in phaser

I'm trying to learn Phaser (total beginner with mild JS experience) and I'm following tutorials and such where everything is using sprites. I'm trying to get by with basic canvas shapes instead of ...
2
votes
0answers
40 views

Strategies to make it difficult to cheat + easier to identify cheaters in Javascript/HTML5 game [duplicate]

I intend to have a Javascript/HTML5 game with a global leaderboard. I have devised a very simple system for submitting highscores as follow: When the game finishes, the game client makes a POST ...
0
votes
1answer
736 views

How do I hide UI canvas in c# Unity3d?

I want to display the final results at last in the game when gameobjects finish the winning(finish) line. For that I am using canvas and in that a panel onto which an image is attached. I have to hide ...
0
votes
0answers
33 views

Circle velocities stay the same after elastic 2D collision

I am following this paper in trying to create elastic 2D collisions among two circles. The problem is that my end velocities are the same as my start velocities. I've looked over my code and don't see ...
-2
votes
1answer
44 views

Understanding Javascript Variable Initialization [closed]

I saw this piece of code while doing research for an idle game I am making: var minions = new Object; minions = { 0: { name: "Mole", description: "...", price: 10, ...
4
votes
7answers
832 views

How to avoid cost comparison each and every frame?

I'm toying around with a ticker(incremental game) for JavaScript. The basic idea is that you have buttons that represent buildings, each building provides a certain amount of resource per 'tick'. ...
0
votes
1answer
150 views

Unity 5 Animation attaching

I have created the walking and idle animation for my fps player. I've added a JavaScript script to access it, but when I run it and press button(w), it stops and says that the animation is not ...
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 ...
18
votes
5answers
3k views

Prevent cheating in html Javascript game [duplicate]

I have made a Javascript/html game. Now the problem I have is anyone can edit the client code and cheat in game for example there is a man shooting a enemy. Man HP:      &...
0
votes
2answers
172 views

How do I keep a PHP server running forever?

I'm making a web game RTS, it's mostly create units, manage resources, attack with army, and level up factories. I have created the basics of the game using Javascript, PHP, and MySQL databases. I use ...
0
votes
0answers
70 views

How to get the angle an object is travelling at

I'm trying to figure out how to get the angle an object is moving at, but have ran into a few problems. My player object is moved by rotating the entity left and right by using the left and right ...
0
votes
2answers
99 views

How to make the character cannot pass through other randomly moving objects when they are collided?

As the title above, how can i make my random wallImg solid enough so that my birdImg cannot pass through it from any sides of the wallImg? Here's the code of Processing's Crappy Bird that i've altered ...
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 ...
0
votes
0answers
49 views

How to get the absolute position of the sprite in the renderview regardless of the pos of PIXI.Container?

I implementing panning on an infinite platforming game I developing but this is messing up with my current setup and structure of the game world (collisions, player location, etc.). Though I figured ...
1
vote
2answers
110 views

How do I use delta-times to determine the speed of a frame-by-frame animation?

I have a character spritesheet with 8 images. How do I animate it? At the moment, the sprite changes to a different image every frame, which makes the animation speed vary with framerate. I have a ...
0
votes
2answers
198 views

How can i fix “get_transform can only be called from the main thread” error in my code?

Here's my code: var forward = transform.TransformDirection(Vector3.forward); var input = Input.GetAxis("Vertical"); function Update(){ transform.position += forward * input * Time.deltaTime; ...
3
votes
1answer
67 views

How can I turn off the sound from another scene?

I attached music file to my first scene and thanks to following javascipt code, sound continues without stopping in other scenes. public static var object : SingletonMusic = null; function Awake() { ...
2
votes
1answer
61 views

Particles to Denote Movement in Space

I'm currently working on a WebGL project to realise an idea I've had for some years. On my desk is book on making a space sim written 15 years ago. There I found some algorithm for particles in space....
2
votes
2answers
116 views

How do I find the set of regions that are fully enclosed by a color?

How do I get all areas surrounded by a certain color in a multidimensional array? For example, this map has three regions that are fully enclosed by red tiles. They are highlighted enclosed in pink. ...
1
vote
1answer
54 views

Javascript canvas check if all recs on the screen overlap a new one

So I know the AABB collision detection formula, however, this code does not work. Whenever I press space, a new square pops up. But this new square can spawn inside another, something that I do not ...
0
votes
2answers
99 views

Progress bar for EXP in javascript

So I am making an incremental game with Javascript, HTML5, and CSS, I need to have this bar that is esentialy a div with a p element in it "fill up" as the player earns more points through sacrifice. ...
1
vote
1answer
62 views

Click counting and actions based off count

So I have a button that is the 'mine' for my incremental game. I would like to track the number of times that it is clicked and be able to do two things: Have events happen say every 5 clicks. ...
2
votes
1answer
259 views

How to post player´s score on Facebook (with js)

I have my game made with Phaser (and compiled with cocoon.io) and on the leadersboard state I want to let the user to post his score on Facebook. Well, I created an App on Facebook and I´m not ...
1
vote
1answer
34 views

Separating .js elements/ .js element communication

So I have 2 questions regarding the code below: function goldClick(number){ gold = gold + number; document.getElementById("gold").innerHTML = gold; }; function buyMiner(){ ...
1
vote
0answers
33 views

Arrow buttons not functioning properly [closed]

I have been cobbling something together from different examples that I have seen online I would like to know why is it not just showing 1 button per page and instead showing them all and decreasing ...
0
votes
0answers
77 views

Tweening back from arbitrary 3D rotation in javascript

I'm using a 3D javascript library to rotate the vertex of a 3D object with a classic 3x3 matrix, to an arbitrary angle in the 3D space, as depicted in the image below. For example, a first ...
2
votes
1answer
62 views

p2.js body position is NaN when spawned inside of each other

I'm working on a project for which I need a physics engine. At the moment I'm playing around with p2.js but I'm running into a problem: When I try to create multiple bodies (circles and/or boxes) ...
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
2answers
57 views

Where could i find 3d items in 3d points array?

I've been reading a lot but i can't find any answer, evenmore, English is not my main language so i don't even know how to ask it correctly. I'm currently working on a 3D render engine on JS and ...
4
votes
1answer
191 views

How do splines work?

I've been beginning to work with different kinds of splines (e.g. Bezier, Hermite, B-splines) in some of my work with computer graphics and I am trying to get a grasp of how they work (mathematically ...
1
vote
1answer
145 views

How do I check if one square is overlapping another in HTML5 canvas

I have a little program that goes like this: Whenever somebody presses space, a blue square appears. The blue square shouldn't overlap with any other blue square. But the function that is checking ...
1
vote
1answer
59 views

How would I load a new scene when a score that is stored in a string is reached?

This is a code that I am working on for a space shooter. Part of it works and my score does increase by 7 every second while being loaded into a GUI box, but my script does not load my scene when the ...
5
votes
2answers
124 views

Create.js CPU High load

I'm new in Create.js and I'm trying to make countdown progress bar. I have this simple code: var stage = new createjs.Stage("timerCanvas"); stage.canvas.width = document.getElementById('...
1
vote
1answer
69 views

Peer to Peer world download

I am creating a multiplayer JavaScript game with a PHP central server. Each user will be able to move around in a 3D world, with other users and NPCs. It came to my attention that SQL is not going to ...
2
votes
0answers
36 views

How do I display an image after pressing an UI button in unity3d? [duplicate]

I am working on a game in unity3d in which I want to display the details about the players when a button is being pressed. Suppose there are 12 players so for that I will have to make 12 UI buttons as ...
2
votes
0answers
74 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 ...
3
votes
2answers
71 views

One big Instance or One instance for every moving entity?

I am creating a multiplayer JavaScript game with a PHP central server. Each user will be able to move around in a 3D world, with other users and NPCs. These NPCs will be controlled by the central ...
3
votes
1answer
72 views

Play Audio After Countdown In JavaScript

Is there a way I can have an audio sample play after a certain amount of time, like 3 seconds in JavaScript? I've looked everywhere and can't seem to find what I'm looking for! I'm very new to this ...
2
votes
1answer
145 views

Architecture for game character movements with user input and a finite state machine

I have a JavaScript canvas game setup using Phaser framework. When I first made my character able to run, jump, and crouch, I used lots of if/else conditions and ended up with an ugly, buggy mess. I ...
2
votes
2answers
188 views

How I can count how many time gameOver scene is loaded?

I'm building a game using unity 3d and I want to add an interstitial ads to it, but I want it to appear after the player lost every 3 times. So when the player loses for the first time the ads will ...
2
votes
0answers
199 views

SignalR For Multiplayer Game Development [closed]

I've been working with SignalR for live chat and notifications in .NET platform and was wondering how much is it worth for working on games development? I've made some jQuery browser games and I want ...
3
votes
1answer
99 views

PhysicsJS on mobile devices: how to optimize for speed

I'm (physics n00b) developing a small animation (gamification) in a mobile HTML5 app (PhysicsJS, HTML5, Cordova, Ionic, JavaScript). This animation is derived from Basket of verlet constraints. This ...
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 ...
3
votes
1answer
58 views

Timers and performance for mobile JS

I'm using the Three.js JavaScript library to do some things in WebGL, and I wonder how the graphic aspects of timers are done on mobile. I was creating numbers with geometries and just replacing them ...
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 ...