"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
1answer
134 views

Basic Use of ApplyImpulse

I am trying to apply a force to a bunch of b2_dynamicBodys, but it seems to only work for a random number of items and then stops with an error. //create some items to move bodyDef.type = ...
4
votes
5answers
2k views

What would be a good way to implement/render a 2D tiled map for a browser game?

I coded a a little RPG in ruby and I used an array to contain the map squares. The elements of the array (which defines the X coordinates) are arrays themselves whose elements defines the Y ...
5
votes
3answers
1k views

HTML5 game programming style [closed]

I am currently trying learn javascript in form of HTML5 games. Stuff that I've done so far isn't too fancy since I'm still a beginner. My biggest concern so far has been that I don't really know what ...
4
votes
2answers
234 views

Will setInterval give me Delay?

I am setting up a JavaScript Server for my Game. Am I understanding this correctly: If I use setInterval to call a function every second, and takes 2 seconds to process. Then I am going to "stack ...
1
vote
1answer
786 views

javascript game loop and game update design

There is a main game loop in my program, which calls game update every frame. However, to make better animation and better control, there is a need to implement a function like updateEveryNFrames(n, ...
2
votes
1answer
153 views

How to handle shoot instructions, in a multiplayer TD

I'm currently working on a Multiplayer Tower Defense game, using ImpactJS & Node. I seek some clarification about how to handle projectiles from towers, let me explain. So the server is running ...
2
votes
1answer
184 views

Send less Server Data with “AFK”

I am working on a 2D (Realtime) MultiPlayer Game. With Construct2 and a Socket.IO JavaScript Server. Right now the code does not include the Array for each Player. var io = ...
-1
votes
1answer
498 views

Attach my sprite with Box2d [closed]

I'm coding Javascript(HTML5) with Box2D. And I want to ask how to attach Sprite with Box2D. This is function My sprite: function My_Sprite() { this.m_Image = new Image(); this.m_Position = ...
2
votes
1answer
2k views

Specifying force and angle in ApplyImpulse in box2d

I need to apply an impulse on a object with a particular force and at a particular angle in Box2d. If I am right the syntax would be the following: body.GetBody().ApplyImpulse(new ...
7
votes
5answers
2k views

How do I protect sending scores from HTML5 games to my server

On backend I am using java. I have a game in HTML5; when user completes it I sends an Ajax call to save the score to database. Now, someone can easily use tools like Fiddler and firebug to modify this ...
-2
votes
2answers
75 views

canvas graphic output doesn't work [closed]

at the moment i'm developing a 3D-Vector-Coordinates-to-2D-Canvas-Calculation. the code is ready, the canvas too, but something doesn't work right... You can find my code at ...
1
vote
1answer
324 views

WebGL: Texture appears as black

I have a simple WebGL canvas, where I'm attempting to render a texture on a square. When working with textures as local files, all is fine. But when I try to load a texture from the web, I get a black ...
-2
votes
2answers
237 views

Should I use javascript to make a windows 8 game? [closed]

Windows 8 game development is designed mainly for C++ (which I don't know), but can be done in JS (which I do know). Is it worth it to learn C++ or should I continue with JS?
3
votes
1answer
216 views

Game based on Ajax polling for 12 players

I am planning on writing a small browser game. The webserver is a shared server, with no root / install possible. I want to use AJAX for client/server communication. There will be 12 players. So ...
0
votes
1answer
307 views

creating a simulation game, what type of knowledge is needed? [closed]

I am a beginner in game development. As a part of learning and fun, want to create a game in java-script and html5. I am planning a game that we were used to play in childhood, that is "new business"- ...
-1
votes
3answers
462 views

Can these game be fully coded in html5/javascript? [closed]

I mean the mechanics of the game. Would it be possible? -Pokemon GBA series, rendering the world would be easy, but what about battle mechanics? -MapleStory, after seen dragonbound.net which is an ...
2
votes
1answer
238 views

How can I repeat only a portion of an image in Javascript?

So I'm trying to repeat a portion of my spritesheet as a background. So far, I have attempted this: var canvas = $("#board")[0], ctx = canvas.getContext("2d"), sprite = new Image(); ...
-1
votes
1answer
225 views

Using copyrighted sprites [duplicate]

Possible Duplicate: How closely can a game resemble another game without legal problems I was thinking about making a pacman clone, I know there is a similar question here Using Copyrighted ...
8
votes
1answer
1k views

Depth interpolation for z-buffer, with scanline

I have to write my own software 3d rasterizer, and so far I am able to project my 3d model made of triangles into 2d space: I rotate, translate and project my points to get a 2d space representation ...
2
votes
1answer
401 views

Object detection in bitmap JavaScript canvas

I want to detect clicks on canvas elements which are drawn using paths. So far I have stored element paths in a JavaScript data structure and then check the coordinates of hits which match the ...
2
votes
3answers
262 views

General directions on developing a server side control system for JS/Canvas Action RPG

Well, yesterday I asked on anti-cheat JS, and confirmed what I kind of already knew that it's just not possible. Now I wanna measure roughly how hard it is to implement a server side checking that is ...
23
votes
6answers
4k views

Anti-cheat Javascript for browser/HTML5 game

I'm planning on venturing on making a single player action rpg in js/html5, and I'd like to prevent cheating. I don't need 100% protection, since it's not going to be a multiplayer game, but I want ...
2
votes
1answer
2k views

Unity3d - setting gameobject position by percentage of view

I am having trouble finding a way to set a gameobject's position with regards to the screen size. I am building a 2d game that I will be putting on iPhone, iPad, and Android. I need to be able to set ...
1
vote
3answers
3k views

Slow Firefox Javascript Canvas Performance?

As a followup from a previous post, I have been trying to track down some slowdown I am having when drawing a scene using Javascript and the canvas element. I decided to narrow down my focus to a ...
2
votes
2answers
3k views

Rotate sphere in Javascript / three.js while moving along x/z plane

I have a sphere/ball in three.js which I want to "roll" around on the x/z plane. For the z axis I could simply do this no matter what the current x and y rotation is: sphere.roll_z = ...
4
votes
3answers
2k views

List of 3D libraries based on WebGL [closed]

Is there a up-to-date list of WebGL libraries or articals with comparison? Until now I heard only three.js and GLGE.
5
votes
1answer
804 views

Javascript Canvas Drawing Efficiency

I have just recently started some experiments with game development in Javascript/HTML5, and so far it has been going pretty well. I have a simple test scene running with some basic input handling, ...
3
votes
3answers
517 views

Semi Fixed-timestep ported to javascript

In Gaffer's "Fix Your Timestep!" article, the author explains how to free your physics' loop from the paint one. Here is the final code, written in C: double t = 0.0; const double dt = 0.01; double ...
0
votes
3answers
268 views

Buffer System For Items

I am going to reference this image of what I want to accomplish in JavaScript. This is the Diablo buffer system. This question may be a bit advanced (or possibly not even allowed). But I was ...
2
votes
0answers
80 views

How to work with edge Texture [duplicate]

Im not sure if i use the right terms, but im not able to find something to start with. Im trying to develop a little HTML5 game. I have a ground with a texture and now I want to make a surrounding ...
-2
votes
1answer
394 views

Direction of the bullet - how to have something else than left, right, top, bottom

I'm making a simple shooter game using canvas and javascript. The current code can be seen here. To know which way I want the bullet to be shot, I simply have a direction property that can have 4 ...
1
vote
2answers
3k views

How to handle 3D collisions using raycasting (with a reflection vector?)

I'm making a game using THREE.JS, and I want my character to walk on the terrain, and collide with static 3D objects (=AABB boxes) that are on that terrain. The problem is: THREE.JS has only a ...
1
vote
3answers
721 views

What is a currently a good game stack for simple Javascript 2D multiplatform game?

I'm looking for advice from someone can help me avoid common pitfalls in developing light weight, quick-to-market games. Yeah, I've heard of Google ;-), but a trip down Google lane does not beat solid ...
3
votes
1answer
560 views

Creating a frozen bubble clone [closed]

This photo illustrates the environment: http://i.imgur.com/V4wbp.png I'll shoot the cannon, it'll bounce off the wall and it's SUPPOSED to stick to the bubble. It does at pretty much every other ...
1
vote
2answers
137 views

Including sprite file for mobile games

I'm making a simple online RPG for Android & IOS using HTML5 & Phonegap and was wondering: should I include sprite file with the game for downloads (because of bandwidth)? What should I do ...
1
vote
1answer
424 views

Is Javascript ready for game development?

I'm hearing about the new HTML 5 features which allow graphics to be rendered, audio to be played, etc. My question is, does that mean Javascript is ready for a graphics intensive game, or is the ...
0
votes
2answers
874 views

Calculating angle between two vectors to steer towards a target

I have been trying to implement a path following steering behaviour for AI in a 2D racing game. I have two vectors: futurePosition represents the predicted future position given the car's current ...
1
vote
1answer
272 views

Recreating Doodle Jump in Canvas - Platforms spawning out of reach

I have started to recreate Doodle Jump in HTML using Canvas. Here's my current progress. As you can see, if you play it for a few seconds, some platforms will be out of the player's reach. I don't ...
-1
votes
2answers
191 views

Dealing with new animations in html5

Wish I knew of a better title, but the issue is rather specific. So the producer of the game I'm working on has given me new animations to put in the game. I knew there might be issues right off when ...
1
vote
1answer
576 views

User input in game loop

I am building a simple multi-player fly-around-a-3D-world game in Javascript/webGL/websocket (Chrome, Firefox mostly). How should I handle and process user input? My preliminary design (untested) is ...
4
votes
2answers
407 views

Where and how to promote an HTML5 game engine?

I've recently completed an engine, called Irenic. Now, I was wondering, how could one promote it? The process surely is different than promoting a game, because a game can be played by almost anyone, ...
2
votes
1answer
394 views

Detect mouse click on a bezier curve's neighborhood

I'm developing a game in HTML5 and JavaScript using Canvas API for drawing graphics. I want to detect if the user has clicked on a bezier curve which has the line width of 20 pixels (something like ...
4
votes
2answers
692 views

How to implement AI for fighting game

I built a 2D fighter yesterday. The second 'player' does hardly anything. Actually, nothing. To be honest, I have never made a game before that had an opponent like this. So my question is, how ...
7
votes
3answers
3k views

Javascript and PHP for real-time multiplayer?

I'm wondering if combining Javascript clientside with PHP/mysql serverside is a good idea for HTML5 real-time multiplayer (small scale) browser games? My technical knowledge is very limited, and even ...
-2
votes
1answer
879 views

Cocos2D game engine javascript is too slow on mobile

i developed a game using cocos2D javascript that works fine on web browsers but when i run it on mobile ( iPhone 4s , android nexus) the FPS was dropped to 20 - 22 on iPhone (max) how to optimize it ...
-4
votes
1answer
229 views

MasterMind Game Algorithm Problem [closed]

Please find below the code that I use to make a MasterMind like game. For now people can see the PC selection so I can check if my algorithm works. Further more colors are only as visual part and ...
2
votes
2answers
259 views

How do I render an animation where some frames appear twice?

I am animating a sprite. The sprite has 7 different frames, but the animation is 10 frames long. This is because 3 of the original frames appear twice in the animation: 3 -> 4 -> 5 -> 6 ...
4
votes
3answers
4k views

Open source level editor for HTML5 platform game?

A natty GUI editor is very helpful to create level map. I want to use some open-source choices rather than build my own from scratch. I found Tiled Map Editor but it doesn't work for what I want. ...
2
votes
2answers
1k views

Quaternions - how to limit axis?

Is there any possibility to limit quaternions to move only in x & y axis (like in Eulers- yaw and pitch, without rolling)? I's there any equation or something similar to do this? Some example: ...
1
vote
1answer
1k views

JavaScript rendering: Canvas or DIV?

I am planning on developing a multiplayer RPG (kinda like RuneScape, but don't worry, with a different gameplay) and i want to do this in the browser. Now before saying things like "A MMORPG is hard ...