"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. ...
0
votes
2answers
56 views
In an asynchronous server environment where player input and timed events modify data is using an in-memory array problematic?
So let's say I have a server running on node.js, and there is an array of player objects...
At an interval, all of these player objects are looped and processed for events and changes that are based ...
-1
votes
1answer
197 views
Drawing polygons in 3D
I have recently been working on a 3D engine from scratch, using JavaScript and HTML5. I've successfully created lines (although slightly buggy) and points, but I can't figure out faces. My current ...
0
votes
0answers
148 views
Swept sphere to line segment intersection in 2D
How can you determine when a moving sphere intersects a line segment, and the normal of that intersection?
Ideally Javascript, but anything that's tidy, simple and self-contained and easy to port to ...
2
votes
0answers
501 views
HTML5/JS - Choppy Game Loop
I have been experimenting with HTML5/JS, trying to create a simple game when I hit a wall. My choice of game loop is too choppy to be actually of any use in a game.
I'm trying for a fixed time step ...
-1
votes
2answers
224 views
Remove enemy when bullet hits enemy
For my education I have to make a basic game in HTML5 canvas. The game is a shooter game. When you can move left -> right and space is shoot. When I shoot the bullets will move up. The enemy moves ...
2
votes
1answer
176 views
Collision detection problems - Javascript/Canvas game
What I want to do:
I simply want the have a 2D array to represent my game map.
I want a player sprite and I want that sprite to be able to move around my map freely using the keyboard and also have ...
1
vote
2answers
559 views
Efficient collision detection - tile based HTML5/Javascript game
I'm building a basic RPG game and I'm looking at collisions/pickups etc now.
It's tile based and I'm using HTML5 and Javascript.
I use a 2D array to create my tilemap.
I'm currently using a switch ...
-1
votes
1answer
436 views
HTML5 platformer collision detection problem
I'm working on a 2D platformer game, and I'm having a lot of trouble with collision detection. I've looked trough some tutorials, questions asked here and Stackoverflow, but I guess I'm just too dumb ...
1
vote
1answer
143 views
Adapting Javascript game for mobile
I'm currently developing a Javascript web game for desktop users. It is a sort of tower-defense game that relies on mouse input only, developed on canvas using EaselJS. In the future, or perhaps ...
8
votes
4answers
1k views
Staggered Isometric Map: Calculate map coordinates for point on screen
I know there are already a lot of resources about this, but I haven't found one that matches my coordinate system and I'm having massive trouble adjusting any of those solutions to my needs.
What I ...
1
vote
1answer
183 views
How can I detect and compensate for system related lag?
The best example I can think of is Doom 3. It seemed to me that if there was any kind if lag the game would pause and then resume without "fast forwarding" to catch up. I'm trying to figure out a good ...
1
vote
1answer
216 views
Architectural advice - websockets javascript/php integration
Myself and a friend have started making a game, he's likely to be using impact.js for the user interaction etc, but we need multiplayer functionality so some form of websockets for TCP connections ...
0
votes
2answers
376 views
Animating sprites in HTML5 canvas
I'm creating a 2D platformer game with HTML5 canvas and javascript. I'm having a bit of a struggle with animations. Currently I animate by getting preloaded images from an array, and the code is ...
4
votes
1answer
264 views
Glenn Fiedler's fixed timestep with fake threads
I've implemented Glenn Fiedler's Fix Your Timestep! quite a few times in single-threaded games.
Now I'm facing a different situation: I'm trying to do this in JavaScript. I know JS is ...
0
votes
1answer
76 views
Questions for QueryAABB
I'm currently having trouble getting my head around QueryAABB, and hope to find some answers here.
The LowerBound of an AABB the upper-left corner (and vice versa). Why is that and what idea is ...
4
votes
1answer
92 views
How to detect whether an Object came to sleep at a specific position?
I'm currently writing a small game with box2dweb and I need some direction for this: I'm throwing a Box and have to hit a specific place and trigger an event when the object that's been thrown isn't ...
15
votes
7answers
528 views
Do I need a Point and a Vector object? Or just using a Vector object to represent a Point is ok?
Structuring the components of an engine that I am developing along with a friend (learning purposes), I came to this doubt.
Initially we had a Point constructor, like the following:
var Point = ...
-2
votes
1answer
153 views
How do I set an event off when player is on certain tile?
Here is the code I use to create and print my map to the canvas:
var board = [];
function loadMap(map) {
if (map == 1) {
return [
...
2
votes
2answers
192 views
Stop a rotating object at a specified angle?
I'm working in JavaScript with HTML5 and the canvas. I have an object which is rotating at a certain speed, and I need the object's rotation to slow down gradually and the front of the object to stop ...
-1
votes
1answer
211 views
Camera game 2d Javascript using box2d
I'm cloningg, i'm doing camera 2d in angry bird game using javascript html5 game and box2d.js .
I'm using context.translate(x,y) to move canvas, but i meet an error like this : many image
of birds ...
1
vote
3answers
334 views
Issues with shooting in a HTML5 platformer game
I'm coding a 2D sidescroller using only JavaScript and HTML5 canvas, and in my game I have two problems with shooting:
1) Player shoots continous stream of bullets. I want that player can shoot only ...
2
votes
2answers
306 views
Help w/ iPad 1 performance for tile-based DOM Javascript game
I've made a 2D tile-based game with DOM/Javascript. For each level, the map data is loaded and parsed, then lots of tiles ( elements) are drawn onto a larger "map" element. The map is inside of a ...
2
votes
1answer
911 views
HTML5 point and click adventure game code structure with CreateJS
I'm a programming beginner.
I made a tiny one scene point and click adventure game to try to understand simple game logic and came up with this:
CreateJS features prototypes for creating bitmap ...
0
votes
2answers
223 views
HTML5 as application for tablets?
I'm looking at creating a tablet application (iPad, Nexus, Surface...). I've heard it's possible to create it using HTML5 canvas. I was wondering if it was limited to canvas, if div/input/table can ...
0
votes
1answer
166 views
how to devise a scoring algorithm based on elapsed time and number of moves [closed]
I want to devise an score algo for my game.
I want to award high scores to players who achieve the goal in minimum time and least number of moves.
I did this but its not going correctly:
var score = ...
2
votes
2answers
304 views
Making an interactive 2D map
So recently I have been working on a Legend of Zelda: A Link to the Past clone, and I am wondering how I could handle certain map interactions (like cutting grass, lifting rocks, etc).
The way I am ...
7
votes
1answer
149 views
Javascript keyDown - no event approach
I'm making game in JavaScript. I have canvas for drawings and game loop. I'd like to make method readKeyboard, in game loop, to check if there is any pressed key. I don't want to attach event to ...
5
votes
2answers
436 views
UV texture mapping with perspective correct interpolation
I am working on a software rasterizer for educational purposes and I am having issues with the texturing.
The problem is, only one face of the cube gets correctly textured. The rest are stretched ...
3
votes
5answers
560 views
2D Collision detection for Pinball Game
So far in previous games I have used simple 2D collision with boxes then checking at pixel level for a collision.
If making a pinball game in nearly a lot of frames the ball will be in contact with a ...
5
votes
1answer
304 views
Jump handling and gravity
I'm new to game development and am looking for some help on improving my jump handling for a simple side scrolling game I've made. I would like to make the jump last longer if the key is held down ...
1
vote
3answers
224 views
OOP implementation of BUFFS and Stats. Suggestion
I am developing an MMORPG server using NodeJS.
I am not sure how to implement Buffs, i mean, equipped objects or used skills have effects on the Player() which has many Stats(), some of them have a ...
2
votes
1answer
380 views
Making a Photo Hunt Game using Javascript and HTML5 [closed]
I am looking for a way to make a photo hunt game using HTML5 and Javascript. Where should I start after the images. And How would I make clickable areas on the image, using javascript?
If you know of ...
0
votes
1answer
95 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 = ...
3
votes
4answers
713 views
What would be a good way to implement/render a 2D tiled map for a browser game?
I've made this little RPG Ruby game I did while learning and now I'd like to make it into a browser game. I've already set up Sinatra framework to serve it, so what I am looking for, before everything ...
-1
votes
1answer
591 views
2D Game Dev Resources/Tutorials for Windows (Phone) 8 Development? [closed]
I am really exited about the launch of windows 8, windows phone 8 so I decided to start learning how to develop games for them. I was even more exited when I found out that html, css, javascript can ...
3
votes
3answers
620 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
182 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
473 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
101 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
147 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 = ...
-4
votes
1answer
313 views
Smooth scrolling a staggered iso map [closed]
I got a staggered iso map that I want to be able to drag scroll with the mouse. I have it almost working but it is a bit glitchy, especially near the borders. Maybe you have an idea how to fix that.
...
-1
votes
1answer
333 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
509 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 ...
5
votes
5answers
718 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
72 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
156 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
210 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
143 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
213 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"- ...
0
votes
3answers
341 views
Can these game be fully coded in html5/javascript?
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 ...