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

php page inside other page-ogame like [on hold]

Im writing browser mmo game in php and I want to do structure similar to Ogame. There is menu with buildings, laboratories etc, and when you click on link only content in the middle is changing. I ...
0
votes
2answers
51 views

Collision detection enhancement

I am developping a spaceinvader-like game. There comes the problem of how to handle collision detection. At first I was doing like that : forEach(fireBall : fireBalls) { forEach(stormTrooper : ...
-1
votes
0answers
26 views

Can't check speed of moving sprite in group (phaser)

So I'm moving sprites across the screen with moveToXY and continually checking the velocity (in the updates function) to see if the sprite makes it to its destination, like so: if ((player.body.speed ...
0
votes
1answer
35 views

How do I add my phaser.js game to my pre-made web page?

First off, it's my first time doing a little bit of game development, and I have no idea of the normal flow of making a game, let alone a browser game. My game uses the phaser framework of HTML and ...
0
votes
0answers
34 views

WebGL - Luminance textures from JPG images

Is there any way to create a WebGL texture with Luminance format from JPG image? JPG images have 3 color channels and luminance texture has only one channel. The problem is that gl.texImage2D can't ...
0
votes
0answers
26 views

Looking for simple aabb physics engine [on hold]

as you saw in the title, I'm looking for a simple aabb physics engine. I need the following features: NEEDS: ~aabb collision detection ~solid bodies ~gravity ~velocity and accelartion PREFERRED: ...
0
votes
0answers
19 views

looking for JavaScript physics engine [on hold]

I am looking for a simple JavaScript Physics engine that meets the following requirements: NEEDS: ~aabb collision detection ~solid bodies ~gravity ~velocity and acceleration PREFERRED: ~ability to ...
1
vote
0answers
62 views

How can I mimic an isometric perspective using square tiles?

Can an isometric perspective be mimicked with traditional square tiles? Can't the effects of the 45-degree overhead view simply be "drawn in" to the square? How would this work? Picture this: the ...
0
votes
1answer
23 views

Javascript 'camera' following object vertically without use of engine like Phaser or canvas [closed]

So I have to make a JS game for school (I'm an absolute novice when it comes to JS) in Adobe Edge without the use of a game engine. I've been attempting to make something like this game and so far ...
1
vote
0answers
58 views

Phaser noob: Why is my Phaser game jittery? [closed]

I'm just getting started with HTML5 game development, and I'm very impressed with the quality of Run Pixie Run and bunnymark in both desktop and mobile, so I've started making a game using Phaser ...
1
vote
1answer
54 views

Unity Raycast shoots right through some objects

I made a melee combat system for my game. The code looks like this: var hit:RaycastHit; if(Physics.Raycast(transform.position,transform.forward,hit)) { if(hit.distance<=2.0) { ...
0
votes
0answers
13 views

cocos2d-js displays only one type of tile from a tmx file

I am using Tiled to produce a tmx which I use in my code using cocos2d-js. The problem is that when I run it on the browser, a wrong tile gets displayed, the first one of the image (0,0) and repeats ...
1
vote
1answer
130 views

If fixed timesteps are unreliable across web platforms, what can I use in my game loop?

As I have found out in my previous question, window.setInterval is not the best choice for a cross-platform game loop. What is my alternative for a game loop in Javascript that will (attempt to) run ...
0
votes
1answer
62 views

Equalling the rotation of an image with its object. Box2dweb

I have some hard time making the rotation of an image equal to the rotation object that the image belongs to. Simply put it, I don't know how to do it properly but i am not asking for a how-to guide ...
0
votes
1answer
16 views

Cocos Code IDE unable to find python

I am trying to create a new JavaScript project on Cocos Code IDE but every time it immediately give me the error message: Unable to find python. Please, click the setting button to set the python ...
0
votes
1answer
45 views

Set a different animation rate for moving player NOT using a sprite

I am trying to start making a simple game using HTML5 with a canvas and some JS. I have a player whose movement I am comfortable with, but the rate at which the player animates when it moves is too ...
0
votes
1answer
75 views

How to implement 2d collision detection that is immune to low framerate and fast movement? [duplicate]

I am trying to implement my own collision detection for a 2.5d voxel style platformer using Three.js. I have a problem with my implementation - if the framerate is too low or the character is moving ...
0
votes
1answer
59 views

Making my character jump [duplicate]

How do I fix my code? At the moment my character goes up for as long as you hold the up key. I want a more jump like effect where the character will drop back down when it reaches a certain height. ...
1
vote
0answers
69 views

Shadows in html5 canvas game

I'd like to ask for reference. I met an article about how to cast shadows in games. I'm using html5 canvas (currently without webgl) with javascript for my projects. The article mentioned above is ...
0
votes
1answer
55 views

2D Hitboxing on an HTML image [duplicate]

I want to make a turn-based game where the player is given "opportunities for attack." An image of the in-game sprite character appears when it's the player's turn to attack. The player can mouseover ...
0
votes
2answers
46 views

How to access bottom canvas layer in HTML?

I have such html: <div id="main_window"> <canvas id="canvas_hex_logic" width="200" height="100"></canvas> <canvas id="canvas_ground" width="200" height="100"></canvas> ...
0
votes
1answer
50 views

How do I cut off the edge of an image in a 2D JavaScript Array?

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 ran into a couple of little problems ...
0
votes
1answer
59 views

Initial force to achieve orbital velocity

I'm attempting to get asteroid to orbit a black hole that is asserting gravity. Some parts currently work, like the black hole asserting gravity, attracting asteroids in and destroying them. And ...
0
votes
1answer
86 views

Creating looping canvas animation (slot machine with reels)

I have a small assignment to create something like slot machine with spinning pictures. I have to use HTML5 Canvas. I would like to hear some opinions how this can be made simply and performantly. ...
1
vote
0answers
47 views

Simple track method for 2D car game? [closed]

I'm a new programmer and I am trying to make a 2D car game on an html5 canvas with javascript and JQuery. I have got the basic car motion down, check it out here: ...
0
votes
1answer
45 views

Variable Variables in unity using JavaScript?

I'm working on a custom built save system for a project a friend an myself are working on. Currently all variables that are saved to file, are stored as static variables in a global variables script ...
-1
votes
2answers
69 views

Unity - Can't Shoot While Moving

Shooting does nothing while moving, but it works perfectly fine while standing still in my Unity project. As far as I can tell no one else has this problem. I just used the Character Controller first ...
1
vote
4answers
124 views

How do I make sure my tic-tac-toe AI always plays to a draw?

I'm working on a little project. The aim is to play Tic-Tac-Toe against an AI, but I require that the game always results in a draw against the AI opponent. How can I implement the AI to ensure that?
0
votes
1answer
51 views

Text width phaser.js

Does phaser have any function that returns the width of the text or if not, how can I center text inside rectangle I've drawn? Thanks!
0
votes
1answer
183 views

How to lock aspect ratio when resizing game window in unity?

I want a scalable game window that when resized stays at 16:9 aspect ratio. The goal is for the user to be able grab the window on the right or bottom and resize it. The game should adjust the ...
1
vote
2answers
47 views

Offset during zooming to keep object within boundries

I have a simple zoom feature which lets the user zoom in and out. I'm having an issue how ever when i zoom out the object gets smaller to the point that the boundaries become broken. The idea is the ...
0
votes
1answer
49 views

How does browserquest handle tiles above players

How does browserquest handle tiles above an player? For example: When the player stands in front of the tree. the player will be displayed on top of the tree. When the player stands next to the ...
0
votes
0answers
25 views

Processing.js for loop not executing all the way

I'm trying to add elements to an ArrayList (in Processing.js, basically a javascript array) in a for loop. BEcause of the many objects I need to add, the for loop is not incrementing all the way ...
0
votes
1answer
51 views

How to manipulate browser pixels on different mobile devices

I'm creating a board game using HTML5, CSS3 and JavaScript. It's working fine on Desktop browsers properly. But when i load it on Windows phone it's not behaving properly. The resolutions and the game ...
-1
votes
1answer
73 views

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

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 ...
1
vote
0answers
112 views

RPG game engine HTML5/javscript [closed]

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
48 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
3answers
154 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
31 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
1answer
71 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
73 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
65 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
1answer
117 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
97 views

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

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
205 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
107 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
78 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
118 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
112 views

Creating Top-Down Race Track From A List Of 2D Points [duplicate]

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 ...