"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
109 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
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 ...
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 ...
6
votes
3answers
916 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 ...
8
votes
4answers
407 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
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
124 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
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.
-1
votes
1answer
262 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
372 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
437 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
131 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
364 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
297 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. ...
7
votes
5answers
870 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
380 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
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 ...
-1
votes
2answers
767 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
73 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
200 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
200 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
190 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
269 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
420 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
340 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
390 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
274 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
331 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
787 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
397 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
230 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
84 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 ...
4
votes
2answers
597 views

Get timing correct with client side prediction

I believe I've got my head round CSP after reading Gabriel Gambetta's blog, Valve article and buildnewgames.com but having an issue understanding the time execution of everything. So if a player ...
-1
votes
2answers
411 views

Javascript - create a new bullet instance every time a user event is triggered

Basically I have a function that I need to create an object of every time the user presses space(event listeners not shown here). function arrow(){ this.x = playerXPos + 40; this.y = ...
1
vote
1answer
332 views

2D js physics engine for HTML4

Is there any engine for Javascript like box2dweb that does not use Canvas? I need to build a game that works in HTML4 browsers.
1
vote
2answers
361 views

PHP and Javascript/HTML5 Collaboration [closed]

I've recently been working on a fairly complicated game. I've stored information with local storage, but that allows the player to edit it, and does not transfer from computer to computer. The two ...
7
votes
3answers
589 views

Saving roguelike game state?

I'm working on a basic roguelike using HTML5 and jQuery, and I've come across a problem. The way the game currently stands, the system only saves the game state every time the user moves between ...
1
vote
4answers
243 views

A formula for point calculation based on value A's proximity to value B

I am trying to find a formula to use for my rhythm game's scoring. Basically there is a Guide entity and a Live entity. You control the Live entity and have to match it as closely as possible to a ...
1
vote
1answer
123 views

Increase restitution (bounciness) of an object in a JavaScript formula

I'm going slightly around the houses on this one. I originally started a thread over on Stack Overflow about it but then it seemed to diverge into mathematics, with no joy from the SO community over ...
2
votes
2answers
354 views

How do I calculate consistent frame timings at 60fps?

I'm writing an HTML canvas game that uses requestAnimationFrame and therefore runs at 60fps, although this is more of a question about failing arithmetic than about JavaScript. If I measure the time ...
1
vote
1answer
469 views

PNG image as a level map for 2d game

I've been using a tilemap editor for making levels, but I was wondering if there was a way to use PNG images as the level map, as maps created in tiled editor are graphically uninteresting. ...
6
votes
3answers
705 views

Basic isometric projection in Javascript

I've been working on porting an old closed source game to Javascript with Canvas and I've come to a slight problem. Right now, to display the land, I just have a pretty basic loop that just draws the ...
1
vote
2answers
721 views

How do I generate a 2d grid-based map without screwing it up?

I'm relatively new to the mechanics of game development - catching up fast, but there are still some things that escape me. For example: generating a fully-accessible map on a 2d grid. See the ...
2
votes
3answers
172 views

Instantiate objects that share same variable

I'm just wondering how to instantiate the same objects that all share the same variables, except their positions. I'm basically working on the scene of my HTML5 game, and I've build a streetlamp post ...
2
votes
2answers
337 views

Best way to store NPCs, Monsters, Shops, etc for JavaScript game? [closed]

OK, let's say I have a JavaScript game (preferably on jQuery framework) and its using HTML5 Canvas. What would be your way of storing data to map out shops, monsters, and NPCs? I was thinking maybe ...