"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
0answers
17 views
Zoom only the particular object in unity
I am working on a sample to zoom the particular object when clicked on it.I have used the following code var zoom : int =15; var defaultFov : int=60; var smoothness : int=5; var isZoomed : ...
-1
votes
0answers
16 views
Info on how to develop a game similar to Pursued [on hold]
I'm interested in understanding how a map game like Pursued is developed. Link -> http://pursued.nemesys.hu/ Since i am a total novice, i have no idea of how to place overlays like in Pursued and i ...
0
votes
0answers
16 views
Dynamic navigation mesh generation algorithm
I'm working on a 2D game (top down / zelda like view) I'm struggling with navigation mesh generation, in complex scenarios my homemade algorithm is lost and too slow... I would really love to see a ...
2
votes
1answer
32 views
Unity, how do I pause the Audio in the Level? [closed]
I wanna pause the Audio if I press the Pause Button also, I need help.. Pause Script: #pragma strict var pausemenu: GameObject; public function pause() { pausemenu.SetActive(true); ...
0
votes
0answers
17 views
Organize js files in html5 game [closed]
First attempt at making an html5 game here, so please be gentle... I am at a point into development (sailing towards 500 lines in my main.js) where I'd need to split the code in several parts. I have ...
0
votes
0answers
16 views
Access Unity Webgl output from browser and vice versa
I receive a package of Unity webgl and put that into a course in Wordpress. The index.html produced form Unity is accessed inside an iframe there. This must be able to count user click when accessing ...
0
votes
0answers
13 views
Movement prediction on client
Im pretty new to game development. Currently I try to predict the movement of the player on the client. But my client and my server are calculating different values. Im using a delta time for the ...
1
vote
1answer
43 views
Should I use the pathfinding client side or server side? [closed]
I'm developping a game where the user can walk in a room (with the others players). There are some obstacles that blocks the user. I'm using a Javascript pathfinding library to find where the user can ...
0
votes
1answer
24 views
Updating code to include states
The Problem I am having a problem in that I am finding it hard to understand how to update my current code so that it uses states. I am creating a game, the game has a menu, each page in the game ...
0
votes
1answer
29 views
How does this point2LineDist() method works?
I was browsing Wolf3D JS port and bump into that method : /** * @description calculates distance between a point (x, y) and a line. * @memberOf Wolf.Math * @param {number} x X coord of point * ...
0
votes
0answers
21 views
Chrome Canvas bug on Mac OS X when switching spaces?
I have a simple Breakout clone created using the <canvas> element and the 2d context. Whilst playing the game in Google Chrome (version: 49.0.2623.87 (64-bit)) if I switch spaces within Mac OS ...
4
votes
4answers
161 views
How decoupled should game logic and rendering be?
From a data perspective, how decoupled should game logic and rendering be? How much does it have to know about each other? Take a look at the following example. I'm going to use javascript because ...
0
votes
1answer
19 views
Oscillating an object left and right based on it's current orientation
I'm currently implementing a fire animation in HTML5 Canvas using the phone's accelerometer. Regardless of the phones orientation, the triangles for the fire move upward. So you can spin your phone ...
0
votes
1answer
67 views
2D Animated Tile rendering
The current game I've been working on needs to have animated tiles. I have a code for Tile and TileMap from my previous game that I recycled. However, it does not support tile animations. The tile ...
1
vote
1answer
38 views
Does pausing the canvas draw restores the FPS to higher value in a HTML5 game?
I set Frame Per Second of 60 for my game. But after 1 minute it gets to a significantly lower value - around 8 FPS. Does pausing the canvas drawing restores the FPS to higher value? If it does, how ...
0
votes
1answer
60 views
Can I use JavaScript for Unity 5? [duplicate]
Sorry for my bad English. I wanted to know how similar is JavaScript with Unity Script. I know that Unity Script is not JavaScript and it was done for marketing purposes but I just wanted to know if ...
0
votes
3answers
105 views
Inconsistent AABB collision detection
I'm making an endless jumper as my first game and I'm running into some problems with the one-way collision detection. Collisions are detected correctly most of the time but occasionally the player ...
1
vote
1answer
42 views
Java - Adjusting the speed of an object during movement
I am trying to get an object to move (on java canvas) in the same angle but at different speed within the X and Y axis. Below you can see how i have implemented the movement of the object. xPosition ...
0
votes
0answers
26 views
Circular motion
I'm working on a to-scale simulation of the Solar System with HTML5 Canvas but a problem appeared which I am unable to solve. All the astronomical objects I've added have a point-of-reference (i.e. ...
0
votes
1answer
55 views
Efficient way to store entities in javascript
I am trying to design a game from strach with Javascript. It's a 2D game (a kind of Zelda on old devices). I am trying to find an efficient way to store my data because I know I will have to face ...
0
votes
0answers
9 views
Adding calls to an Entities update function
So I am trying to add a property to my entity function then in order for it to update I need to call it within the entity's update function so this is how I create the entity var sprite = ...
1
vote
1answer
59 views
How should I efficiently clear and redraw my canvas with lots of animated sprites?
My current solution is to clear the entire canvas and redraw all sprites on every requestFrame(). This works but feels inefficient: I only need to clear the part of the canvas made invalid by ...
0
votes
0answers
17 views
JavaScript — Unity Movement Bug
Hello fellow programmers ! I have been working on a game lately and It's going pretty good. Today I decided to make a new car for it since it's a racing game. When I was modelling the car I ...
0
votes
0answers
40 views
storing hexagon-based (x/y) movements in a database
Im developing a hex(agon)-grid based game. The game is turn-based. Players move stuff on the map and they need to be allowed to issue movement-orders. Units move a certain amount of movement-points ...
0
votes
1answer
36 views
Hybrid App - Game Encyclopedia Image Asset
An in-game encyclopedia usually consists of entries and images for things related to the game. For example, pokemon's pokedex. Image of Pokemon, text description and so on. I've happen to encounter a ...
-1
votes
1answer
53 views
What JavaScript and or Html should engine I should use? [closed]
I took some classes on JavaScript and I know some html5. I took these classes so I can Learn Game Development!! I want to use JavaScript and not C# or C++ because I want easy cross platform with the ...
0
votes
1answer
53 views
Collision between free player and tilebased map
so I'm working on some sort of platformer in javascript where the map is tilebased but the player can move freely. Now, i have a problem with collision detection/response. It's kind of obvious what ...
0
votes
1answer
15 views
Mousedown event not performing drawImage
I've been working on the basic gameplay. I'm to a point where I think it should draw a card in the quadrant clicked/tapped, but nothing is happening. I can't see what's wrong. Please help. My only ...
0
votes
1answer
38 views
Why are my canvas drawings larger than the actual image?
For the following page source, I've finally gotten a grip on rendering the cards. I'm puzzled why they appear about 2.5x larger on the canvas. <html> <head> <style> ...
0
votes
2answers
37 views
Struggling to define js sprite sheet
I've been working on this for a couple days, unable to get anything to load. Here is the whole page. Please help me find what I'm doing wrong. Right now, I'm only trying to render the first card in ...
0
votes
1answer
36 views
How to display a lot of small objects using WebGL?
Introduction The game scene contains a lot of 10x10 pixel elements: for 1980x1200 px. screen the number of elements on the scene can vary from 0 to 23760 (elements cannot intersect). The live ...
2
votes
1answer
95 views
JavaScript 2D liquid flow
Brand new to games/graphics and I'm attempting to find a method to create a 2D liquid effect with JavaScript. Ideally I could adjust the viscosity and flow from a gas/fog effect to oil and between. ...
-4
votes
1answer
55 views
Can someone explain this function? [closed]
How does the spawn function work? var max_bollar = 15; var i = 0; var timecounter = 0; var bollarcounter = 0; var spawn_delay = 5; var min_spawn_delay = 25; var max_spawn_delay = 500; var balls = []; ...
2
votes
3answers
79 views
How to center a tilemap in Phaser?
In Phaser, I am loading a Tilemap from JSON. I would like my Tilemap to display in a particular position (for simplicity here I say the middle of the screen). var map = ...
0
votes
1answer
45 views
Javascript 2D game tile textures
I am using a texture atlas for my tiles. Of course I need to get the sub-images to draw them on the canvas as separate tiles. Right now I can think of two ways to implement this. Divide the texture ...
-1
votes
2answers
39 views
How can I get information from a function
Okay, so if I use this code to randomly spawn balls at the top of the screen, how do i get them to move down: var max_bollar = 10; var i = 0; var timecounter = 0; var bollarcounter = 0; var ...
0
votes
2answers
84 views
How can i call a thing a lot of times (game: dodger)
Hey I am new to coding and i want to know how to get the same thing to hapen until i "say" stop. The game is that you need to dodge stuff that is falling, i was thinking that i could use a while loop ...
1
vote
1answer
46 views
How can I create a spacial grid? [closed]
I just created a tile map for my game, and its a side profile game. The game looks sort of like Terraria, where there is blocks you can place and break. I want the player to be able to collide with ...
1
vote
1answer
66 views
How do I deal with AABB sweep ghost collisions?
I've been trying to wrap my head around this for some time now. I wrote an implementation of AABB sweep collision detection. I though I understood the idea but it didn't work as expected. I rewrote ...
0
votes
0answers
14 views
Pixel collision detection between two images is not working in Phaser.js [duplicate]
I am applying collision between two images. But the two collided images are not taking the pixels to collide with each other. The collided images are overlapping each other but at some point, the ...
3
votes
0answers
59 views
Change color of bitmap
I am attempting to understand the easeljs ColorFilter and its use with cache. There is quite a bit of information at the easeljs site but it's not clear based upon the examples and documentation. ...
0
votes
1answer
38 views
Random equidistant points like a tree branch (JS)
I'm working on an algorithm to generate a "graph" like array of points in my game world. See Image Below: Here is what i'm working on so far, which will generate the black line.. but this may not ...
1
vote
1answer
24 views
how to follow(center) a box inside canvas element
If inside a canvas I draw a box, and the I add arrows to move it, the box will eventually be out of my reach since it goes out the border and I cant see it. How could I follow the box so that it is ...
3
votes
0answers
35 views
Image won't scale after click
Despite being a long-time developer I've never played with JavaScript libraries or any sort of graphics development. With my son we're trying to create something interesting and are using ...
0
votes
1answer
58 views
How do I sync the gameobjects to server in C# unity?
I have been working on Game that consists of 10 Game Objects that have to be sync by the server values. The server decides that which game object will win and then sends command to my side(Client ...
0
votes
1answer
49 views
javascript efficient collision detection [closed]
I have a processing game where I am having serious lag problems with collision detection. I am using the most effective code I can think of however after about 9 levels in The game gets unbearably ...
1
vote
1answer
37 views
Color Based Collision Javascript (Cocos2d-js)
Im looking to make an isometric game...so my partner designed the isometric map (jpg image) along with the map objects (png) on adobe ilustrator... so the thing is i would like to set the player path ...
0
votes
1answer
40 views
My polygons only register a collision if they are the same shape and directly over top of each other
I'm trying to learn about 2d polygon collision detection/handling and have ran into a snag. After running through lots of tutorials and sample code I've attempted to implement my own polygon class ...
4
votes
1answer
114 views
Fixed Time Step Flutter
I've seen a lot of questions about this problem, but really no solution. Hopefully I can explain the issue well enough that I can get some sort of closure on this problem. I'm using a Fixed Time ...
1
vote
1answer
214 views
How Can I Find a Shape on 2D Array?
For the code in my test project, I want to find 2D[,] array shape on the char[][] list. I created an actual map with 'char[][]' array. So, how can I find a tileChar's shape on the worldChar array? ...