Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [javascript]

"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. http://en.wikipedia.org/wiki/JavaScript

1
vote
1answer
17 views

Why is my client's body drifting even after using data from the server, and how do I fix it?

I am trying to use Box2d on nodejs server with libGDX client. What I am trying to apply is authoritative server model so clients are just sending input data to server, server is running simulation and ...
1
vote
0answers
11 views

Box2D LibGDX Cant Create ChainShape Static Body in server side with same position client side

I am trying to create walls in server side which i have already created in client side.This is how i create them in client side: ...
1
vote
0answers
48 views

Is there any API that returns information about “all games”? [closed]

I'm building a project about games and I need to make a "portfolio" of games. Something like a catalog of Netflix, but about games, and I need some basic information about the game, like Publisher, ...
0
votes
1answer
32 views

Can a .exe file ported from a program like NW.js or Electron be put console stores?

I'm early in development working on a game in HTML5/JavaScript canvas, and I wondering if porting the game with some HTML/JS to .EXE converter would allowed it to be posted on consoles? I think it ...
0
votes
1answer
45 views

Make a variable go down as another goes up?

I am making a JavaScript game called "Spoop: The Clicker", and I have a variable shown by text: ...
0
votes
0answers
8 views

MelonJS - How can I change position of collided object (push or pull with player Entity)?

I'm getting started on game development with MelonJS and I don't get how can make a Pushable/Pullable Entity. I'm pretty sure that the approach I'm taking is not right since It cannot detect the ...
1
vote
1answer
70 views

How do I make sure everyone sees the same distance across different resolutions?

Hello game dev community. I have recently got into making games in a browser window, and me and a friend ran into a common problem. Let's say I have a game like diep.io, where users can control their ...
0
votes
0answers
13 views

How can I make a game-wide round timer with socket.io?

I'm making a javascript multiplayer networked game called "Ultimate Tag". It's basically a multiplayer tag with upgrade every time you tag someone. I want to have 5 minute rounds with timers, and a ...
0
votes
0answers
31 views

Return value from function in unity webgl and javascript communcation

I am using Unity webgl for my project and want to communicate from browser JavaScript to C#. One way is to call C# function from JavaScript using SendMessage. I am easily making call using this code ...
0
votes
2answers
41 views

How to limit speed while still adding external forces

I have a ship with a single thruster in space (no friction). My ship uses integration on every update, like this: (PSEUDO CODE) ...
0
votes
0answers
11 views

Find circles velocities after collision [duplicate]

In my program, I have multiple balls that are given a random velocity. I'd like to have it so after they collide, they "bounce" off each other. The balls have a mass, radius, position (Vector), and ...
0
votes
1answer
47 views

Controlling a thrustered 2D space ship with angular rotation and max speed

In my game I have a computer controlled ship that is accelerated by a thruster: with a constant force and in the direction of the ship's current orientation/rotation angle. Thrusting My ship has a ...
0
votes
0answers
19 views

How to make physics of motion on an inclined surface

There is the following platform: And a coin above it: And the following code using arcade physics: ...
1
vote
0answers
40 views

Phaser: InvalidStateError

I am using the Phaser framework for game development, but while working on it I face a bug which is annoying, I have the following message: InvalidStateError: An attempt was made to use an object ...
0
votes
1answer
27 views

Phaser: How to call a function inside another function?

So I actually have the following code that works: ...
0
votes
0answers
11 views

Phaser: How to use a simple timer from 0 to 3

I am using the following code (which is a simplified snippet in order to make it more readable): ...
2
votes
0answers
78 views

How to port an html5 canvas game to sell on PC / Console?

I am trying to make a 2D platformer, but I want to use html5 canvas since I find it much easier to create 2D games with it than with Unity. I am wondering if there is some way I can bundle my game so ...
0
votes
1answer
66 views

How do I move an object in a square pattern?

I have some bots that can move via setting the x and y. I have already been able to make them move in a circle pattern, but how do I make them rotate around the player in a square pattern? I'm not ...
0
votes
0answers
26 views

When the motion button is pressed, the shape of the character changes and always goes to the left direction

good day. When the motion button is pressed, the shape of the character changes and always goes to the left direction. Why is this happening and what is the solution? Pressing two buttons moves to ...
0
votes
1answer
151 views

“RENDER WARNING: there is no texture bound to the unit 0” When not Rendering Texture

I have a webgl program that sometimes renders textures, but mostly renders triangles or lines. When I am not rendering a texture, webgl gives the warning, "...
0
votes
0answers
9 views

Crossword puzzle [duplicate]

How do you make the keyboard arrow keys interactive so that when the user presses one of these it will move the cursor in that direction; I am working in html. Thanks Angela Jackson
0
votes
0answers
93 views

Collision detection not working in Phaser 3

I am new to phaser. So I started working on a game but I am stuck at implementing collision detection. I want to do it between a static group(dot) and a Sprite(obs). function create(){ ...
0
votes
1answer
33 views

Why are not the images loaded in Phaser?

I am starting to use phaser to create games and I found a problem that I can not find for more tests that I did. I can not show the images I am uploading. You only see a small square in the center, (I ...
0
votes
1answer
25 views

Why does my value increase a ton when the tab switches from inactive to active?

I basically have a lerp function similar to this one: Client interpolation for 100% serverside game when a new server update is received, the update frequency is added to a variable (msAhead) and the ...
1
vote
1answer
32 views

I keep coming across an error “Cannot read property 'innerHTML' of undefined”

I'm new to game designing and have to create a game for my project but I keep coming across an error to do with: index.html:93 Uncaught TypeError: Cannot read property 'innerHTML' of undefined ...
0
votes
1answer
99 views

How to use arrow keys to navigate between cells in a crossword puzzle

I am making a crossword puzzle, using a canvas. How do you get the keyboard arrows to interact with the screen so that when the user presses any of the arrow keys, the cursor will advance to the next ...
-1
votes
1answer
58 views

How to use JavaScript language in unity?

I recently read somewhere that the unity engine supports JavaScript language but I have a question. How to use JavaScript language in unity engine?
1
vote
1answer
82 views

What should i use as a board for my game? [closed]

I'm a beginning programmer and i need to make a game. The rough idea revolves around fleets fighting in turn based battles while you control your factions resources and manpower. The original concept ...
2
votes
1answer
23 views

Why does the first red-zone sometimes appear too close to the border in my battle-royale red-zone feature?

The Problem: If you've ever played or watched some gameplay of a battle royal game (like PUBG, for example), you'll always find an event during any battle called the red zone. Basically, at a ...
1
vote
3answers
263 views

RPG quest system

So I have made a small RPG where you can create char, update skills, buy items, fight other users etc. Now to make the game more extended I need quests. And I need a little bit of help here. Right ...
1
vote
1answer
56 views

Bump and push entities without a physics engine

I have seen on many games the ability to push entities around and bump into enemies/characters. What is this called? I have implemented Matterjs to accomplish this with Pixijs but it seems overkill ...
0
votes
1answer
41 views

detect collision between two circles and sliding them on each other

I'm trying to detect collision between two circles like this: ...
0
votes
1answer
104 views

Canvas HTML5 Top View -> Isometric

We are working in a simple MP strategy game using Node, Express and Sockets! I'm wondering if there's an easy approach to a transformation to make a Top View game into a 3D Isometric, without adding a ...
0
votes
1answer
35 views

PhaserJS: Detecting intersection

I'm making a card game to get my legs with phaser. I have an row of overlapping, face down cards. I want to detect when any card is covered by another card. The deck is shuffled before being placed ...
0
votes
1answer
53 views

how to draw a dashed path in Javascript

I need to draw a brick curved path but i need to be able to put an arrow pointing to any a brick by API. something like this: i thought to use canvas but i'm not sure i can get a reference to each ...
3
votes
1answer
121 views

How to reduce the total time spent checking against my world bounds?

I'm making a game engine and currently I use a function for checking a new position after movement to prevent game objects from escaping the world: ...
1
vote
1answer
65 views

HTML5 game pases when you go to another tab

I'm making a simple game and I use requestAnimationFrame. Now the problem is that each I change to another tab the game pauses and when I return the game continues. ...
1
vote
3answers
102 views

Splice enemy array to destroy enemy (js game)

I am currently working on a basic space invaders game. So far I have created the enemies, a main character, and a laser beam, collision detection between enemy and bullet, however when my bullet ...
0
votes
1answer
60 views

Realtime Multiplayer - How to handle user updates coming in different times

I have a game loop that sends new positions of every player to other players. But there is no guarantee that the users will send the server their new positions at the same time. Actually if their ...
0
votes
1answer
46 views

Why can't I load images in processing.js and let them be dynamic?

I can't easily load images. I can only render an image once unless I put this: <img src="images/papermario.png" hidden></img> in my html. I also still ...
0
votes
2answers
278 views

Implementations for storing entities in an ECS system

I'm restructuring my model of entities, components and systems, where entities are: ...
-1
votes
1answer
146 views

Game engine with javascript scripting [closed]

Javascript is my favorite language and a few years ago Unity had a options to create JS scripts but its removed for now. So is here any strong engine like Unity wich still support JS for scripting?
-1
votes
2answers
164 views

How do I calculate the total XP to reach a particular level, when each level takes 10% more?

How do I calculate the amount of XP for a level where the first level is 110, and each level after is 10% more than the last. Preferably to do without a loop because the levels will have to be ...
0
votes
0answers
43 views

How should I make a Tile-based Plat-former engine using Processing js?

I'd like to know what structures I should use for creating a Tile-based Platformer. I've created platformers before using processing js. Is there any documentation on this? Before I do this I'd like ...
0
votes
1answer
30 views

Setting a jump counter in my 2d platformer built with phaser

I have a platforming game, written in javascript with the Phaser.js framework, where my character collects objects. I thought trying to collect all objects in the least amount of jumps would be ...
0
votes
2answers
97 views

Why is my spritesheet displaying all messed up in game?

I'm having an issue I don't quite understand, where my spritesheet is looping strangely and not showing the full sprite I want, even though I feel like I'm specifying it correctly. My code is in ...
1
vote
1answer
57 views

Efficiently calculate 2d world position based on parent(s) recursively

I am writing a small 2d html5 game engine in javascript that relies on the concept of a hierarchy. The scene is the root node or entity, and its children make up the game objects. These children can ...
0
votes
1answer
31 views

How can I add acceleration to the movement of an object in a game

Below is the code that I'm using to move an object: ...
0
votes
1answer
52 views

Checking distant 2D objects from the player in pure javascript

I'm checking if the objects are too far from the player to be able to disable some things, I'm doing so: ...
0
votes
1answer
26 views

Getting an object to move in another objects direction

I have a player and an enemy, both have x and y values, and I want to move the enemy to the player and have them 'touch' over time in a speed that I can determine, I tried calculating the angle ...