"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

10
votes
2answers
499 views

How do I make good guy attacks only hit bad guys and vice versa?

My game has many different type of good guys and many different type of bad guys. They will all be firing projectiles at each other but I don't want any accidental collateral damage to occur for ...
0
votes
1answer
132 views

Rotate 2d sprite towards pointer

I'm using Crafty.js and am trying to point a sprite towards the mouse pointer. I have a function for getting the degree between two points and I'm pretty sure it works mathematically (I have it under ...
10
votes
1answer
344 views

How to make sure a game can be completed

I'm not sure what the correct term for what I'm looking for is described, so apologies if this is a duplicate question. But is there a term/algorithm for making sure a game is "completable" with ...
1
vote
1answer
179 views

How to use/apply class inheritance in Enchant.js

You're developing a game using Enchant.js and you just need an Enemy class which multiple enemy classes derive from and every enemy has its own sprite and stuff.
0
votes
1answer
546 views

Three.js camera rotation and behavior

I'm just getting into Three.js and the camera is causing some problems. Basically, I want to implement spectator-like movement controls, so that I can move around freely in the scene. The problem is ...
1
vote
2answers
219 views

Optimize DOM game performance

I am working on a game developed on DOM using Crafty JS framework, and Greensock GSAP JS (http://www.greensock.com/gsap-js/) for animations. It is my first time working with these technologies. I am ...
1
vote
3answers
127 views

Generating spritesheet(s) on load

I would like to reduce the size of the spritesheet I am loading by only loading the specific sprites I need. Is there a way to crop and splice images at runtime using javascript? Creating separate ...
0
votes
1answer
180 views

How to implement tile enemies behavior? [closed]

I'm having a difficult time to understand , how to implement the behavior of an enemy in a tile based game, movement attack behavior per enemy level ( higher level enemies should be hard to kill) ...
2
votes
3answers
324 views

How to get the center of a rotated rectangle regardless of point of rotation

I need help working out the centre coordinate of a rotated rectangle regardless of the point of rotation (i.e. the rectangle doesn't rotate around its center). I do not know the coordinates of the ...
1
vote
1answer
141 views

How good do I have to be at Math to create a 3D game using three.js? [closed]

A question I've often had, how good at Math do I need to be to create 3 dimensional games? I get along with 2d games just fine. I understand everything I'm doing without problems after practise. ...
1
vote
3answers
95 views

Move from point a, to point b, and determine the accuracy

Let's say I have a circle at point a (0,0), and I wish to move it to point b (23,58), whatever, how can I accurately do this with a speed variation if I wanted. (I'm doing this in javascript). Every ...
0
votes
1answer
630 views

Can't Build Cocos2Dx emscripten project

I need to port a Cocos2D-x project to Web (JS+HTML5). I'm trying to compile cocos2D-x samples using the emscripten project for cocos2d-x, and I've followed this tutorial ...
4
votes
1answer
338 views

Mixing Javascript with C++ for mobile development?

I have a few games for the iPhone, Android, and Windows 8 that I built using native C++. This works great but is really limiting when I try to create menus and start screens. I have read about rapid ...
0
votes
2answers
147 views

Physics for space game [duplicate]

I am making a space game where you fly a ship. I am trying to work out the physics for such a game and so far came up with: var thrust; //between 1 & 100 how much the engines are pushing var ...
-2
votes
1answer
59 views

Error returning a value from a function? [closed]

It tells me the error is on this line: this.srcX = ShipSrcXPicker(type); However I cannot see it? I am returning the values from these methods that are being called? Is there something I am missing? ...
8
votes
3answers
2k views

Web workers for HTML5 game physics simulation?

A bit related to this question. The idea is to guarantee the same physics behavior as much as possible. Would it be possible to run fixed time step physics on a web worker? The UI would update ...
1
vote
2answers
347 views

Converting hexagon grid coordinate system

As I have been building on a RTS game based on hexagon grid built in javascript. I stumbled across a problem regarding the coordinate system. Have been trying to implement a A-star system to find ...
0
votes
1answer
156 views

Tips on building a real time multi player web platform + framework and/or tookit

I'm trying to develop a multi player game web app which basically should be able to achieve the following goals: Provide a game engine + framework/toolkit to let third party corporation integrate ...
1
vote
1answer
701 views

Get MonoBehaviour components from Prefab

I need to assign the script values for the following Prefab in Unity 3.5 The structure is the following Kinect_Prefab -MonoBehaviour ·Script: Missing Mono Script -MonoBehaviour ...
2
votes
2answers
1k views

Efficient collision detection - tile based HTML5/Javascript game

I'm building a basic RPG game and I'm looking at collisions/pickups etc now. It's tile based and I'm using HTML5 and Javascript. I use a 2D array to create my tilemap. I'm currently using a switch ...
4
votes
2answers
859 views

Experience embedding javascript

I'm looking into scripting languages to embed in my game. I've always assumed Lua was the best choice, but I've read some recent news about embedding V8 as was considering using it instead. My ...
22
votes
12answers
13k views

Isometric game engine in JavaScript/HTML5 [closed]

Is anybody aware of any stable-ish (ie out of alpha) isometric drawing engines for JavaScript/HTML5? I have done some Google searches and found a few, but they were mostly in alpha/invite-only ...
3
votes
1answer
422 views

How can I place my Enchant.js game into a DIV in a fully-designed web site?

Following the Enchant.js tutorial I cannot find a way to define the place the game is rendered in the page. It either takes the maximum possible area or limits itself to the given size (using ...
4
votes
5answers
817 views

Implementing vector based movement in a 2d environment

Good evening. I apologize if the title is a bit vague, I really could not come up with anything better. I am currently reading a book called the nature of code and as a side project, I am working on ...
0
votes
0answers
107 views

How to integrate Javascript into C# and run scriptcode step by step

We are currently working on a Pokemon MMO trying to figure out how to implement an asynchronous scripting language the best. We don't want to work with threads or tasks, but the goal was to wait for ...
0
votes
2answers
97 views

Variable timeStep not working as intended

I've been working on a game in javascript/html5 (through typescript) using my own little library. This library uses a variable timestep since I plan on using it on mobile devices, and I was under the ...
0
votes
0answers
58 views

Collision detection issue on 2D game engine with isometric game graphics [duplicate]

Let me first show you an example of issue so you'll see the problem. http://i.imgur.com/dTxJIN7.jpg The player object has red colored collision borders. Since I'm using an 2D engine, his head ...
6
votes
3answers
905 views

How can I deploy a JavaScript game into the iOS app store?

Unfortunately, I don't have a Mac, so I can't develop for iOS. I understand that HTML5 apps run in the browser, but is there a way to make an HTML5 app (e.g. a JavaScript game) and get it deployed ...
2
votes
1answer
198 views

How would one create a “start button” on a website similar to some Korean games?

Some games have buttons that would actually let you click them and you'd log right into the game. How does the web browser get permission to do this without plugins? Perhaps the client registers a ...
-2
votes
1answer
130 views

Creating a simple 3D view of a galaxy [closed]

What would be the easiest and most maintainable way to create (or use an already existing technology) a sort of Google Maps in 3D for a galaxy? Its not the main focus of my game, but I would like it ...
-1
votes
1answer
259 views

View port for my canvas game

I am developing a canvas game, and im struggling to get my head around how i can make a view port so when the character moves the world moves with it. Unlike traditional 2d maps built with arrays i ...
-3
votes
1answer
109 views

How do I detect when one sprite is moving away from another? [closed]

I'm currently working with crafty.js. I need to know how to detect when one sprite is moving away from another sprite.
2
votes
2answers
123 views

Gameover scene transition [duplicate]

I created a gameover scene in a crafty.js project but it does not run. Crafty.scene('gameover', function() { Crafty.background("#ccc"); Crafty.audio.stop("bg"); }); var gameOver = ...
0
votes
1answer
436 views

How do I make an entity move once per second in crafty.js

I am trying to implement "Snake" using crafty.js but I can't seem to get the snake entity to move just once in a second. How do I do this?
2
votes
1answer
115 views

Stop music in crafty.js

How do I stop a looping music file from playing in crafty.js? I want the music to stop playing once a gameover condition has been reached.
15
votes
3answers
1k views

How do history generation algorithms work?

I heard of the game Dwarf Fortress, but only now one of the people I follow on Youtube made a commentary on it... I was more than surprised when I noticed how Dwarf Fortress actually generates a ...
2
votes
1answer
368 views

JavaScript - 2D Top-down Tile Collision Detection

I am developing a small Top-down Game (Much like the old Zelda Games) and I'm having an issue in terms of Collision detection (The actual theory itself rather than assigning Tiles as solid, etc.) I ...
2
votes
2answers
130 views

Animating a background 'pulse' with easing equation

I'm trying to find a suitable easing equation (or other method) to animate an object so that it 'pulses' (imagine a 'spike' on a music visualiser, or see the image I drew badly below) 'v' is the ...
1
vote
0answers
88 views

Is there an out-of-the-box way to create a custom non-convex polygon in three.js?

Does Three.js offer an out-of-the-box way to create custom non-convex polygon, or do I have to use THREE.Geometry and set faces manually? I'm guessing that ShapeGeometry has something to do with this, ...
4
votes
1answer
363 views

Working principle of an RPG map

I am currently thinking of building a basic browser-based 2D(that would eventually become 2.5D) RPG. I have planned everything and I think that would be able to accomplish the current goals, but it ...
1
vote
1answer
161 views

Simple 3D particle gravity in javascript? [closed]

I'm trying to do some simple gravity handling in my 3D environment (I'm using three.js). I've got some code, but it doesn't work. I'm hoping it's just a silly bug somewhere. Note: This is a ...
3
votes
3answers
296 views

Javascript board game: looking for optimization

I posted this question on stackoverflow before but received no answers so I decided to post it here and see if someone could suggest me something. I'm working on a html/javascript game for android. ...
3
votes
4answers
3k views

2D Collision in Canvas - Balls Overlapping When Velocity is High

I am doing a simple experiment in canvas using Javascript in which some balls will be thrown on the screen with some initial velocity and then they will bounce on colliding with each other or with the ...
7
votes
5answers
853 views

Good technological solutions to build an ascii map and moving characters in a browser (like dwarf fortress)?

I'd like to build a webapp for my game website that involves using text characters to represent animals and people, and have them move around on map squares with independent (server driven) AI. So ...
5
votes
3answers
378 views

Can “dumbphones” play JavaScript games?

Are JavaScript games exclusive to modern smartphones, or are older phone models also able to play games written in JavaScript?
7
votes
3answers
805 views

Are commercial javascript games sensible?

So I love javascript as a language and how it is able to be run anywhere. I'm gonna enumerate my concerns: Does it make sense to make money from javascript? I mean, the second I publish my game ...
0
votes
2answers
166 views

Smoothing a shot power curve

I'm making a game with shot powers (user presses and holds and launches an object) Distance from the cursor was working for testing but obviously a distance of 1 and 2 pixels is double. I scaled this ...
9
votes
4answers
2k views

How to implement mouselook in the browser?

I am currently creating a 3D first-person shooter game in the browser using WebGL. How would I implement mouselook/free look for such a game?
15
votes
6answers
5k views

Are there any alternative JS ports of Box2D?

I have been thinking about creating a top down 2D car game for HTML5. For my first game I wrote the physics and collisions my self but for this one I would like to use some ready made library. I ...
-1
votes
2answers
746 views

Moving a sprite towards an x and y coordinate

Given a sprite with an x and y coordinate, how would I move it toward another sprite with an x and y coordinate? I've already made it face towards the other sprite, and I've made it move towards the ...