"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. ...
5
votes
1answer
439 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
226 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
205 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 ...
1
vote
0answers
56 views
How to work with edge Texture
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
225 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 ...
0
votes
2answers
1k 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
477 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
375 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
112 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 ...
0
votes
0answers
169 views
Most popular JS game engines (2d) [closed]
I'm trying to create my first JS/Canvas game and after looking around for a while on the internet, I found a LOT of JS libraries/engines/whatnot that help you in this task.
I was wondering what are ...
1
vote
1answer
357 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
475 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
219 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
176 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
393 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
331 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
221 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
445 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
1k 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
530 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
190 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 ...
1
vote
2answers
209 views
Sprite animation problem
I have this sprite I have to animate. The sprite is 7 images total but animation is 10 frames (2 positions are repeated).
The order I want to go through the frames is like this:
3 -> 4 -> 5 -> 6 -> ...
4
votes
3answers
2k 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
390 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
votes
1answer
267 views
Best framework and technology for developing simple multiplayer web-based game [closed]
I want to develop an online browser game in HTML and Javascript, just like this one: http://play.typeracer.com/.
I am new to these technologies, so pardon me for any vague questions:
What should ...
0
votes
1answer
689 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 ...
-1
votes
1answer
127 views
Interacting with box2D objects
How can I interact with an object in box2d, I'm completely new to this so I have no clue what to do. The box is created like this:
bodyDef.type = b2Body.b2_dynamicBody;
fixDef.shape = new ...
1
vote
3answers
619 views
What Javascript game engines are out there, other than Impact? [closed]
Does anybody know of a decent (meaning preferably free ;)) alternative to Impact? Any suggestions are very much appreciated!
2
votes
2answers
259 views
How can my “world” provide the information required to render itself?
I am writing a JavaScript game that provides a top down view of the player, to eventually create a ray caster that can render the view in faux 3D (the top down view will end up as the mini-map).
A ...
17
votes
5answers
3k views
Implementing features in an Entity System
After asking two questions on Entity Systems (1, 2), and reading some articles on them, I think that I understand them much better than before.
But, I still have some uncertainties, and mainly they ...
0
votes
2answers
359 views
Platformer movement and collisions
I'm working on a platformer but I'm stuck at the player movement and collisions.
Right now I'm not including the grid at all in the movement, but it's time I do it. I've read this article on how to ...
1
vote
1answer
426 views
HTML5 Canvas Depth Sorting
I'm have problem with Isometric. I'm don't know how to name this "problem", but I'm show you some sceen what I get and what I'm need to get.
My code now drawing something like: ...
1
vote
1answer
477 views
Easy way to do gravity in a simple game?
I'm looking for an easy, beginner friendly way to do gravity in a platformer.
I've looked into Box2D tutorials, but they all seem very complicated.
All I want is a class that takes into account if my ...
8
votes
3answers
1k views
Why is it a bad idea to store methods in Entities and Components? (Along with some other Entity System questions.)
This is a followup to this question, which I answered, but this one tackles with a much more specific subject.
This answer helped me understand Entity Systems even better than the article.
I've ...
0
votes
1answer
91 views
Tilting a platform on its axis?
I'm wondering how I can tilt a platform on it's center/axis.
For example, if the player steps on the left of the center, it should tilt to that side like in this picture.
Can a platform like this ...
7
votes
2answers
646 views
What is the best way to handle simultaneous collisions in a physics engine?
I'm writing a 2d physics engine in javascript so that I can learn more about physics in video games. I have it working correctly for rigid body collisions, except for if any body collides with two or ...
8
votes
3answers
2k views
Entity Component System based engine
Note: I'm programming this in Javascript, but it should be language agnostic in the most part.
I am thinking about converting my engine to an ECS based one.
I get the basic idea (note: this is ...
1
vote
1answer
834 views
Crafty.js multiplayer platform game, keeping players in sync
I'm using crafty.js to create a very simple platform game. It doesn't need to stop cheating, it's actually just seeing other players move around, and it doesn't need to have collision detection ...
-1
votes
1answer
282 views
How do I make more bullets shoot in this game code?
I'm having trouble in the "Bullet.prototype.draw = function ()" section of this code below. I'm trying to fix it so that I can shoot more at a time instead of just one bullet like it is now. Thus, ...
4
votes
1answer
157 views
What is the optimal way for updating different entities in an engine?
EDIT: half of my question seemed to disappear, but thankfully, it was still in the clipboard.
When I say entities, I mean instantiations of various classes in my engine (example class: ...
4
votes
2answers
277 views
What would be the problems with using a singleton design pattern for my engine?
I'm desiging an HTML5 2D game engine in Javascript, and currently, I use the singleton pattern.
There is only one global object in the namespace called simply Engine. All other objects are ...
7
votes
8answers
1k views
HTML5 game obfuscation
HTML5 games have viewable source code. Is there a way to make them like swf file?
How to hide the game algorithm?
What do you think of the Firefox JavaScript Deobfuscator Plugin and obfuscation?
0
votes
2answers
176 views
Any social gaming services for JavaScript games?
I'm currently planning on building a HTML5/JavaScript game for the various platforms (Browser, iOS, Android, and WinMo7). I, obviously, would like there to be simple multiplayer (1v1, asynch), ...
4
votes
2answers
482 views
Optimizing isometric drawing function
I need help optimizing my Draw(); function to draw only what is visible in the viewport. Currently I'm drawing the whole Map array in a diamond shape. How can I make my function store only what is ...
0
votes
1answer
125 views
javascript function with game engine
I have coded my main menu for the game in html/css and need the image buttons to function with the engine using JavaScript.
For example:
Skip (Enable) Which skips the menu when you come back to play ...
5
votes
2answers
2k views
Realtime multi-player game design principles for Node.js
I've been reading the Valve article on multi-player networking which has been adapted from Yahn Bernier's 2001 paper called Latency Compensating Methods in Client/Server In-game Protocol Design and ...
1
vote
0answers
225 views
Open Source HTML/JS game(s) with license that would allow embedding in my app?
I'm working on an educational app for kids. At the end of the sign-up process, the kids must wait for a confirmation from their parents in order to gain access to the app.
While they wait for this to ...
-3
votes
3answers
225 views
Game getting progressively laggier?
I have a small game in HTML5 that uses socket.io to communicate with a node.js server. Now my problem is that, ever since I did my last update on it it seems to have something "chunk up" in the ...
33
votes
7answers
1k views
Managing text-maps in a 2D array on to be painted on HTML5 Canvas
So, I'm making a HTML5 RPG just for fun. The map is a <canvas> (512px width, 352px height | 16 tiles across, 11 tiles top to bottom). I want to know if there's a more efficient way to paint the ...
0
votes
2answers
552 views
Lighting effects with 2D sprites
I would like to know how to best achieve lighting effects with 2D.
I guess the only way is to make sprites of the area to be lit in specific colors?
Say I have a streetlamp, and around this place ...