"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. ...
-1
votes
1answer
285 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
159 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
282 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
179 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
492 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
129 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
226 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
226 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 ...
35
votes
7answers
2k 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
576 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 ...
15
votes
3answers
793 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
4answers
2k 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 ...
1
vote
2answers
442 views
Multiple setInterval in a HTML5 Canvas game
I'm trying to achieve multiple animations in a game that I am creating using Canvas (it is a simple ping-pong game). This is my first game and I am new to canvas but have created a few experiments ...
1
vote
1answer
378 views
How do I go from a simple html5 tic tac toe game to an online 2 player game?
I've been working on an online 2 player Tic Tac Toe solution for blackberries. both old and new. And so far I have html5 code that has a 3 x 3 layout that switches between x and o for the game ...
1
vote
1answer
313 views
A* Start path finding in HTML5 Canvas
I'm trying implement A* Start path finding in my games(which are written with JavaScript, HTML5 Canvas). Library for A* Start found this - ...
6
votes
2answers
249 views
What is the standard way of delivering HTML5 games to portals and such?
Let me explain what I mean by "standard way of delivering"...
Think about Flash games sites. Flash games can be delivered as a single file, either hosted by the site, or, I guess, provided by someone ...
1
vote
1answer
157 views
Calculate travel time on road map with semaphores
I have a road map with intersections. At intersections there are semaphores. For each semaphore I generate a red light time and green light time which are represented with syntax [R:T1, G:T2], for ...
4
votes
6answers
617 views
Should I refer to browser-based games as HTML5 games or Javascript games?
First of all, I know that there are alternatives to both HTML5 and Javascript, but I worded the question so generally ("browser-based") because if I had said "HTML5" or "Javascript" games that would ...
1
vote
1answer
474 views
What is wrong with my Dot Product?
I am trying to make a pong game but I wanted to use dot products to do the collisions with the paddles, however whenever I make a dot product objects it never changes much from .9 this is my code to ...
0
votes
1answer
353 views
How do I do JavaScript Array Animation
I'm making a game but don't know how to do Array Animation with the png Array and game Surface that I made below. I'm trying to make it so that when the Right arrow key is pressed, the character ...
1
vote
1answer
142 views
Manually updating HTML5 local storage?
I'm just starting out HTML5 game developement (and game dev in general) and watching all the videos and tutorials available something has crossed my mind.
Everyone keep saying I should set the ...
5
votes
3answers
651 views
Split a 2D scene in layers or have a z coordinate
I am in the process of writing a 2D game engine, and a dilemma emerged. Let me explain the situation...
I have a Scene class, to which various objects can be added (Drawable, ParticleEmitter, ...
0
votes
0answers
121 views
Existent js libs for tileset / map loading and rendering? [closed]
I'm building an rts style overhead tileset game with JavaScript (particularly using Ember.js framework as a base). The map is so large that I'd very much like to be able to load and render the board ...
1
vote
3answers
1k views
How do I structure a 2D platform level?
I'm doing a 2D platformer but I don't know how they are usually built.
The approach I'm looking at is making it tilebased, with ground tiles on bottom row, then platforms on some places in "mid-air" ...
1
vote
1answer
198 views
How to perform efficient 2D picking in HTML5?
I'm currently using an R-Tree for both picking and collision testing. Each entity on screen has a bounding box for collisions and a separate one for picking. Since entities may change position very ...
0
votes
2answers
456 views
Essential 2D engine features
I have decided to make a simple engine for a new game I'm working on, and now, I'm wondering: what are the essential features of a 2D game engine? Or, a game engine in general?
0
votes
1answer
420 views
How to handle animations?
I am coding a simple 2D engine to be used with HTML5. I already have classes such as Picture, Scene, Camera and Renderer, but now I need to work on Animations.
Picture is basocally a wrapper for a ...
0
votes
2answers
150 views
DrawImage doubt
What is the best option for animation in a game (HTML5 Javascript)? Put all the images in one png and change the background.
Or create each image separately and draw with DrawImage?
2
votes
2answers
201 views
how to transform child elements position into a world position
I'm making a 2d space game in Javascript with canvas. In this game there's a bunch of spaceships, positioned in world space, with turrets, positioned relative to their parent ships. These objects also ...
6
votes
1answer
480 views
What is this JavaScript gibberish?
I am studying how to make a 2D game with JavaScript by reading open source JavaScript games and I came across this gibberish...
aSpriteData = [
"}\"¹-º\"À+º\"À+º\"À+º\"¿¤À ~C_ ...
3
votes
1answer
325 views
How to draw a global day night curve
I see many applications which have world-clock map, and I would like to make my own to enhance some of my mobile apps. I wonder if anybody has any knowledge where to start, how to draw a curved shadow ...
-2
votes
1answer
566 views
Extremely simple online multiplayer game [closed]
I am considering creating a simple multiplayer game, which focuses on physics and can accommodate up to 30 players per session. Very simple graphics, but smart physics (pushing, weight and gravity, ...
1
vote
1answer
211 views
How can I keep track of a battle log on a web game?
Recently I started working on a Web turn-based PvP RPG game. Now I'm working on the battle system but I encountered some issues:
How can I keep track of everything that happens in the battle? It ...
2
votes
1answer
578 views
Implement Fast Inverse Square Root in Javascript?
The Fast Inverse Square Root from Quake III seems to use a floating-point trick. As I understand, floating-point representation can have some different implementations.
So is it possible to ...
1
vote
2answers
975 views
Javascript A* path finding
I am trying to learn A* path finding. I am using this library - https://github.com/qiao/PathFinding.js
But there is one thing I don't understand how to do.
To find a path from player.x/player.y ...
0
votes
2answers
308 views
how do i make the JS/jquery tic tac toe squares only clickable once?
As i have it now my script makes the 3x3 grid clickable, and I dont know exactly how to turn on the click once it has been clicked. This is using jQuery and a simple if else statement to switch ...
0
votes
1answer
747 views
HTML5 Canvas Tileset Animation
How to do in HTML5 canvas Image animating?
I am have this code now: http://jsfiddle.net/WnjB6/1/
In here I am can add animations something like -> Animation.add('stand', [0, 1, 2, 3, 4, 5]);
But ...
0
votes
2answers
334 views
Calculating an experience formula
I'm having trouble working out a formula using this experience curve to get the total exp after each level. I bet its easy and im just over thinking it.
maxlvl = 10;
increment = 28;
baseexp = 100;
...
2
votes
1answer
228 views
Customize Colors for Sprites in Web Game
So I'm working on an html5/javascript/css3-based game. Without going into too much detail, I'm thinking of having the characters be simple 8 or 16-bit style sprites, but I'd like to allow the user to ...
1
vote
1answer
340 views
Collision detection in multiplayer games
This a followup to my previous question: How to implement physics and AoE spells in an MMO game?.
There, we concluded that all physics have to be done on the server, and that I should use cylinders ...
3
votes
3answers
717 views
HTML5 Canvas Game Timer
How to create good timer for HTML5 Canvas games?
I am using RequestAnimationFrame( http://paulirish.com/2011/requestanimationframe-for-smart-animating/ )
But object's move too fast.
Something like ...
8
votes
5answers
387 views
What implications does JIT (javascript/canvas) vs. AOT (Flash) have in terms of browser based game performance?
In my experience, even till this day, I still see more of a visual lag in entity movement / animation in JavaScript (Canvas) based games than I do in Flash based games.
Why is this - what exactly is ...
1
vote
2answers
264 views
Frustum Culling/Only rendering what's viewed by the Camera in HTML5 Canvas?
I coded up a simple 2D Camera for my HTML5 Canvas-Based Game Engine but I noticed the performance wasn't very good. So a lot of people suggested only rendering things that are shown by the camera but ...
1
vote
0answers
124 views
How do I keep user input and rendering independent of the implementation environment?
I'm writing a Tetris clone in JavaScript. I have a fair amount of experience in programming in general, but am rather new to game development.
I want to separate the core game code from the code that ...
3
votes
1answer
456 views
Validating multiplayer actions when using Javascript Game Engines client-side
I am using one of the many javascript game engine (impactjs, craftyjs, melonjs, easeljs etc) out there to handle the animation client-side. And I have a way of calling server-side functions and ...
3
votes
2answers
145 views
Deactivate keyboard input on collision
I'm creating an online-canvas-game with a tank as player object.
Now I have several structures in my canvas, that shouldn't be able to be overdriven by the tank...
My solution is to detect the ...
-1
votes
0answers
64 views
ball 2d animation [duplicate]
Possible Duplicate:
canvas ball physics animation
I want to animate ball in html canvas like this.
ctx.beginPath();
ctx.arc(75, 75, 10, 0, Math.PI*2, true);
ctx.closePath();
ctx.fill();
...
3
votes
2answers
546 views
canvas ball physics animation
I want to animate ball in html canvas like this.
ctx.beginPath();
ctx.arc(75, 75, 10, 0, Math.PI*2, true);
ctx.closePath();
ctx.fill();
start position is left top corner and ball's maximum ...