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,432 questions
0
votes
0
answers
53
views
LootJS/Forge GLM injecting items fails due to mod-internal overwrite (Apocalypse Now/Lost Cities)
I am trying to have modded items in the chests of lost cites mod, and there is this problem I am facing, in which a mod called Apocalypse Now automatically injects its mod items into the chests ...
0
votes
0
answers
30
views
Toxiclibs softbody physics issue with jittering under weight
hopefully this is alright to post here. I'm learning to code and working on a thing (actually trying to reproduce this https://www.instagram.com/juhani.halkomaki/reel/DGFpqfCNgZe/ )
I have created a ...
0
votes
0
answers
47
views
Is it common/advisable to deploy a game using HTML for the frontend but also provide a backend native?
As a proof of concept I'd like to create the UI of a boardgame using SVG and HTML, so I can deploy it in desktop through Electron, mobile using Cordova and also hosting it in a website.
I also have ...
4
votes
1
answer
596
views
The button indexes are different between two controllers. Is there a work around?
I found that when you connect a controller, the buttons have a code. When I run console.log(navigator.getGamepads()[0].buttons), the A button on a Nintendo Switch ...
0
votes
0
answers
73
views
How to "cancel" a promise to make my fighting system work
I'm making a very basic clickable combat game with HTML and JavaScript. In the battles, the user starts the round, attacks, and then the enemies attack one by one.
On the player's turn, the user has ...
0
votes
0
answers
61
views
Using NFC without using NDEFReader
I am trying to build a Amiibo read-only game support for my phone, but the NDEFReaader is only supported in two different browsers that I don't and can't have. MDN Doc page.
So my question is how can ...
1
vote
1
answer
392
views
Is there a way to read data from an amiibo?
Just for the fun of it, is there a way I read (not write) data from an amiibo? I think it would be cool if I could make a mini-game that summons Mario if I put a Mario amiibo. Also, I know I shouldn't ...
1
vote
1
answer
291
views
Fixed timestep without cloning game state
I'm doing a JS game with hundreds of moving physical particles.
I've read the famous "fix your timestep" article. So far I've implemented basic prototype with janky game loop tied to FPS and ...
0
votes
0
answers
108
views
Line Of Sight in javascript DOM game
I am creating a 2D game in javascript using pure DOM, on my computer and on my cell phone WebGL or OpenGL do not work.
How can I create Lights and shadows effects using Line Of Sight, for example, I ...
0
votes
0
answers
108
views
`textSubImage2D` inconsistent performance
I have a problem when creating a texture with WebGL. The thing that I do not understand is that the first call with texSubImage2D with a canvas leads to the ...
0
votes
0
answers
66
views
Should I be adding a database functionality for my game rooms?
I'm a little confused on when it's needed to bring in Mongo or MySQL in a web browser multiplayer card game.
Here's my plan so far: I'm using React, Node.js, Express, and Socket.io. I'm having the ...
0
votes
1
answer
180
views
Web application for efficient placement of blocks
Task: to develop a function that efficiently places rectangular blocks in
rectangular 2D container. The location of the blocks in the container should be
as dense as possible in order to rationally ...
0
votes
1
answer
76
views
tubular mesh around any y=f(x). issue calculating normals
I used this to help create a 3d cylindrical mesh that wraps around any y = f(x).
Each vertex is calculated by a point P:
...
2
votes
1
answer
338
views
Padding in a vec3f array in WebGPU memory layout
I'm trying to write a WGSL structs parser (sort of webgpu-utils thing). In order to better understand the memory layout, I'm using wgsl offset computer as a helper.
Having the next struct:
...
-4
votes
1
answer
130
views
Why wont my code work
I have just started on a new short game and i am trying to figure out how to make a reward when i reach a certain value I expect that the counter starts at zero, and each time the button is clicked it ...
0
votes
1
answer
139
views
Improve performance of server updating game state
I have a Node.js game that sends update packets to players every 30ms.
The code I currently use works this way:
Get the entities within each player's vision.
Create a temporary object that stores ...
0
votes
1
answer
246
views
Camera movement with player
I'm developing a game using the html5 canvas, but I've never used it before and I'm having difficulty creating a camera. The intention is that it is the same as agar.io, where the player is centered ...
0
votes
1
answer
354
views
Trying to calculate hitbox vertices for my game and adding SAT collision
I am currently working on a basic HTML, CSS, and JavaScript game as a freshman high school summer project. I am currently trying to implement separating axis theorem (I spent a lot of time learning ...
2
votes
1
answer
214
views
Where is the illusion of a moving camera perspective coming from in this rotatable cube model?
Just for fun, I had been attempting to build a model cube in vanilla JS that can be moved and/or rotated. What I was going for was the simplest possible representation (so, no adjusting for ...
10
votes
2
answers
4k
views
Wondering if there is a more efficient way to store level data in my game?
I am trying to remake Super Mario Bros. in JavaScript and I am trying to figure out if there is a more efficient way to create and store the level data. I have created 1-1 and here's what the code ...
1
vote
0
answers
239
views
steering behaviors collision avoidance: vehicle shaking before arrive at destination
I have made a test sketch of collision avoidance using javascript, as you can see right here.
I want the vehicle to move to the clicked location, avoiding obstacles on the way. It is working, but not ...
0
votes
0
answers
139
views
How can i rotate an object based on the finger position?
I am using Lens Studio to build an AR effect and trying to use the position of the hand tracker fingertip to make a cube rotate. For example, as I move my finger on the x-axis the cube rotates in the ...
0
votes
1
answer
75
views
Adding requestAnimationFrame in isometric Tile grid Code is not working
Hi There this is my first Post on gamedev, and i hope everyone understand what i want :)
First of all my Code is an very Personal Version from one Github Isometric Map.
I Tryd now 2 Days to Add the ...
0
votes
1
answer
93
views
Why is this code keeping the listener which should be removed instead?
I am having some issues figuring out why this code still lets btn_1 call the function setstate3().
There is a function ...
0
votes
1
answer
1k
views
How to create global function for all .JSLIB files?
I can't understand how to work with .jslib files. I don't understand the syntax of this type of file. Also I couldn't find any easy explanation of it
The problem ...