"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. ...
0
votes
0answers
11 views
looking for an FPS game with JS api for bots [on hold]
I'm looking for a cool game engine I can write bots into (JavaScript api will be much appreciated) and then battle them.
I know Quake was ported into QuakeJS but I wasn't able to find any API for it, ...
0
votes
1answer
40 views
Level 1 is redrawn instead of level 2 in Canvas
I am trying to call lv2_map() instead of lv1_map(). Unfortunately, it always shows the level1 map redrawn on the screen, which means all enemies are doubled from level1 when calling level2. Any idea ...
0
votes
0answers
11 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
14 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");
...
0
votes
1answer
16 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
24 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
0answers
29 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 ...
-1
votes
0answers
17 views
How to change stages or LEVELS for Phaser game [duplicate]
From what I've seen in most of Rich's examples he uses this kind of approach to structuring his states.
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: ...
0
votes
1answer
47 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
46 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:
...
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 ??
2
votes
1answer
80 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
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
87 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
31 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
17 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
66 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
51 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
62 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
24 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
2answers
46 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
50 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
77 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
77 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
48 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
45 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
94 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
100 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
40 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
96 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
110 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
62 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
641 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
172 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
59 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
62 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
101 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
102 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
89 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
149 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
183 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
163 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
44 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
80 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
46 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
62 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
106 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 ...