"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

2
votes
3answers
496 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 ...
2
votes
1answer
150 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
98 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
818 views

Can't Build Cocos2Dx emscripten project [closed]

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
476 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 ...
-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? ...
0
votes
2answers
165 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 ...
0
votes
1answer
143 views

Play .mp3 with Craftyjs

I want to play .mp3 sound files in a game I built with Crafty.js. Is this possible without converting the sound file?
1
vote
1answer
843 views

animating roulette ball

I'm trying to achieve something like netent's roulette (which is a great product in my opinion). It's going to be implemented in html5. I wonder which path should I take to have such a great ...
1
vote
2answers
439 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 ...
1
vote
1answer
877 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 ...
0
votes
1answer
181 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 ...
3
votes
1answer
592 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
999 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 ...
1
vote
0answers
125 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
106 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 ...
6
votes
3answers
1k 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
214 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
139 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 ...
8
votes
4answers
461 views

How to do branching dialogue in javascript

I'm making a very basic visual novel type of game in Javascript, I'm a beginner so I'm just doing this for fun and learning, and due to bad planning I have run into a bit of a problem when you get to ...
-3
votes
1answer
115 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
132 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 = ...
2
votes
1answer
118 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.
-1
votes
1answer
286 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 ...
2
votes
1answer
407 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 ...
0
votes
1answer
549 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
2answers
147 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
104 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
399 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
173 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
315 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. ...
8
votes
5answers
1k views

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

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
409 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?
0
votes
2answers
171 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 ...
-1
votes
2answers
1k 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 ...
-1
votes
1answer
75 views

Isometric Error: decrement iteration removes tiles [closed]

I am new to isometric and game programming in general. Just cannot figure out how to iterate the grid from behind. I want to do it so that the tiles overlap properly. My grid starts at [0][0] which ...
0
votes
1answer
1k views

Simple javascript HTML5 canvas start menu

I'm currently looking for a simple and basic start screen for a game using javascript, so basically its the first function that is called and then press play which then goes into the game. Looked ...
-1
votes
2answers
249 views

Compare Mouse X,Y with Grid X,Y to find the closest grid position [closed]

EDIT: From two very good answers I have decided to use isometric projection instead of my silly grid of cordinates. I am doing a game entirely in canvas, and I find it quite troublesome right now. I ...
2
votes
1answer
217 views

Optimising out tiles outside of viewport

I am playing around with the HTML5 canvas and have begun implementing a tile engine. However, it's currently very inefficient: I have a 100x100 2D array and my code loops through the whole thing ...
0
votes
2answers
194 views

How can I get a property of an entity without having to call getEntityByType every time?

I'm trying to get an entity (a bullet, a grenade, and an explosive) from my player. Specifically, I want the shootingRate of my bullet (how frequently it can be fired). How can I do this without ...
8
votes
3answers
273 views

Y and X - Am I doing it wrong?

I sometimes run into small issues when doing my JavaScript projects. That is because most build in functions of JavaScript run X,Y if positions are needed. (In that order). But when I build a 2D ...
1
vote
2answers
496 views

Dynamic Textures

I am pretty new to this 3D designing and animating, and as an indie developer I need to do everything on my own I have created this simple box character And I want to texture it, have looked around ...
0
votes
2answers
381 views

Increasing speed of circle over time as linear with Box2d

Assume that there is a circle and it can be moved by using keyboard arrows.Is required that increasing speed over time like increasing car speed. For example; max speed is 25 and time to reach max ...
2
votes
2answers
416 views

Are javascript MVC model implementations too slow for games?

I wanted to implement a game in javascript with an MVC design pattern, with each entity's state stored in a model. So for example, In an update loop we iterate over all models and apply the velocity ...
4
votes
2answers
397 views

Simulate forces on a connected chain

I'm building a 2D space game where the player uses a chain to grab on to nearby asteroids. The asteroids move along a specific path with a constant velocity. The chain has a maximum length L and ...
6
votes
3answers
365 views

How can I change the acceleration of an object to arrive at a particular time?

I'm trying to write some code to change an acceleration factor so a ball will arrive at a destination in a desired time. The problem is I don't know time (t) but I do know I want it to arrive at (t - ...
2
votes
2answers
1k views

Receiving keyboard events on a canvas in Javascript

I need to receive keyboard events in a canvas element. Click events are received but key presses aren't. Here is my code which doesn't handle key events: var canvasElm = $('canvas'); ...
2
votes
2answers
449 views

How to make a Unity3d program/plugin and publish it on Asset Store?

I want to make a plugin for Unity3d, like TornadoTwins's FPS Control. How can I do that? I already have Visual Studio 2010 installed.
1
vote
2answers
256 views

Mega Man screen scrolling in JavaScript [duplicate]

I'm trying to create screen transitions similar to those found in Mega Man or Legend of Zelda (i.e. the active elements of the first screen are stopped as the screen scrolls in the direction of the ...
-1
votes
2answers
87 views

When I create more than one boundary, every one but the most recent breaks [closed]

So basically what I have is a function called createBoxBoundary, which, when the player position is within certain limits, sets boundary variables to true. Pretty straightforward. However, when I call ...