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

how I can add or upload picture or photo to this site (stackexchange) in a comment? [migrated]

how I can add or upload picture or photo to this site (stackexchange) in a comment ??
1
vote
0answers
51 views

How to do monster AI movement and attacks server side?

I have my web based rpg game already created. Inventory management, equipment system, character stats, skill tree, and etc. It's almost complete. For the game world, I am creating a top-down rpg ...
0
votes
0answers
22 views

Using node JS for web adventure game [on hold]

I've been working on a single player adventure game using melon JS, and PHP/MySQL for player data storage. I've read up a little bit on node js ...
0
votes
0answers
13 views

How can you merge the geometries of cloned objects in Three.JS?

So I'm testing the best non-voxel way to display a lot of objects at once and so I found how to merge geometries. Now, I can easily merge most geometries, but I can't seem to merge the geometries of ...
-1
votes
2answers
72 views

Where to start developing a 2D puzzle game [closed]

I would like to start developing a 2D puzzle games, much like sudoku for example. I would like to publish it on Facebook and on gaming websites, like miniclip, agame, kongregate. The game should have ...
0
votes
1answer
24 views

which state to add main menu for simple browser game with phaser

In which state should I add the main menu, or should i make it into another separate state? My main confusion here is how I manipulate states properly. Im a phaser/gamedev noob and I dont know how to ...
1
vote
0answers
16 views

Unity Javascript GUI.Button shows up twice

Hi I have created a simple menu in Unity but I wanted to create my own style for colour/fonts. However for some reason it prints each button twice to the screen, once with my custom style, and once ...
1
vote
1answer
54 views

How can I scale sprites and maintain visual quality?

I currently have an isometric grid. This grid contains tiles. Some of these tiles have 'tree' sprites sitting upon them. If I have my tree sprite loaded from a texture with a fixed resolution, when I ...
0
votes
2answers
41 views

How to handle transparent pixels in a spritesheet

I am trying to correctly handle transparent pixels. I have a spritesheet that gave me the following: The green body is the ground physics body and the gray body around the sprite is the sprite's ...
0
votes
2answers
47 views

Collision detection between draggable object and world objects?

I have a game I'm making in Javascript that will involve combining items by dragging and dropping them onto each other. Think Alchemy or similar. So far, so good, but I hit a snag while trying to ...
0
votes
1answer
22 views

How to trim a sprite?

I have a spritesheet: var spriteSheet = new createjs.SpriteSheet({ // ... frames: { width:520, height:600, regX: 260, regY:300 } // ... }); I am computing it's physics body as follows: ...
0
votes
0answers
62 views

Collision detection in JavaScript Canvas game - Issue with 'if' statements [duplicate]

I am currently developing a simple browser-based game and seem to be on the cusp of collision detection that doesn't just return the player to where they were before, but actually will slide them ...
0
votes
1answer
34 views

Cube goes through objects

I have Unity Pro 4.6.1 and I am trying to make a cube move with the arrow keys. Here are the barriers before I move the cube: And here's when I move the cube (the problem): I don't want the ...
0
votes
1answer
39 views

JavaScript THREE.js webgl spotlight rendering

I'm playing with webgl/JavaScript/THREE and a spotlight. And I see unexpected results. And I don't understand what's going on, and I'm hoping you can point me in the right direction. In my particular ...
1
vote
1answer
72 views

How to deal with two different axes on isometric game?

Hi! Above is a visual of the problem I am having. My game has two different coordinate systems. You have the client, or the canvas, where the game is rendered - a standard coordinate plane; however, ...
1
vote
2answers
76 views

Simplify paths when a user builds

I am looking for some guidance on how to simplify my nodes on a path when a user builds on the fly. Imagine a path like this with a gap: Logically 3 nodes are required 2 connected one isolated. ...
0
votes
1answer
43 views

Cross-platform multiplayer game in JavaScript [closed]

I want to start creating a simple multiplayer, JavaScript based, cross-platform game. Think about it as a two player mario where players can shoot each other. My question is what is the best way (or ...
0
votes
0answers
41 views

Google Developer Console Error message

i received my first crash report of on Google Developer Console yesterday and im completely lost. Did anyone receive this error before and how can i go about fixing it? Any help would be greatly ...
0
votes
1answer
72 views

Rotate arrow on canvas

I need to draw a flow dynamically based on some user choices. In that flow I want to draw the choices (blue circles with number) and the directions of that choices (line and arrow). For example: node ...
0
votes
2answers
88 views

Unity question on OnTriggerStay() function

I'm currently working on a soccer game.I have a script for the ball that whenever the ball collides as trigger with the goal line,the ball will return to the middle point.But seems like the ball ...
0
votes
1answer
38 views

Application components dependancy and decoupling

In my client application I have two major components: GameCore - wrapper that handles everything about running the actual game NetworkClient - A layer that takes care of ...
0
votes
1answer
80 views

Separation of axis theorem implementation at normals

This might be more of a math question, but it relates to the development of a simple physics engine I am trying to create. I have been stumped on this for about a week now, and have been unable to ...
2
votes
2answers
107 views

Where does game logic belong? [closed]

I've always had a hard time wrapping my head around the 'high levels' of game logic and where/how large components, such as collision detection/physics, rendering, and user input, interact with one ...
0
votes
1answer
59 views

Mouse position to grid position not working

I have a function which converts my mouse position to grid position in the game but it is not working properly... its slightly off. I have two functions - one which converts from grid to screen ...
3
votes
1answer
634 views

Why would it be faster to render using multiple canvas elements?

This video suggests that rendering using multiple canvas elements helps performance. How does this work? The idea was to use one for the player, one for the enemies, another for the background, ...
-1
votes
3answers
163 views

Aspiring game dev - Is HTML5 worth it? [closed]

I'm a college student who is fairly familiar with JS & PHP and have made a couple web apps for my previous job. I'm looking into working with Unity for my future game projects, but there is a bit ...
0
votes
0answers
54 views

Cocos2d js database connection from javascript

I have been considering to write a game in cocos2d js, that I wanted to be a turn based multiplayer game. I can't seem to figure out if it is possible with cocos2d js newest version to just add the ...
1
vote
0answers
116 views

HTML5 game : Secure way of saving score [duplicate]

I wrote a pretty basic game for colleagues to play : the player shoots on an enemy which has 50 lives while other smaller enemies pop randomly on the screen. The goal is to kill the main enemy as fast ...
0
votes
1answer
56 views

Resizing a tiledmap when using phaser

var cw = window.innerWidth; var ch = window.innerHeight; var game = new Phaser.Game(cw, ch, Phaser.AUTO, 'game', { preload: preload, create: create, update: update }); ...
0
votes
2answers
99 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 : ...
0
votes
1answer
93 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
85 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 ...
1
vote
0answers
143 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 ...
1
vote
0answers
176 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
2answers
138 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
33 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
136 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
78 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
43 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
59 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
99 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
75 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
105 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
61 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
68 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
66 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
69 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
177 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
103 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
53 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 ...