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

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 views

Looking for simple gravity + collision Javascript library for platformer game [closed]

I've been looking all over, but all the libraries I've found seem to fall into two categories: "Everything and the kitchen sink," or "We detect collisions, but don't actually resolve ...
zachThePerson's user avatar
-1 votes
0 answers
48 views

other objects are moving with player [closed]

I was trying to locate other objects in world space but they where moving with camera and I couldn't able to locate them, Camera is moving with Player Car but other Obstacle cars are also moving ...
Kushal's user avatar
  • 1
-1 votes
0 answers
41 views

Spawning of enemies seems to be broken

I am working on a small video game in HTML, CSS, and JavaScript. The game is almost finished, but I am having a problem with the manner in which my enemies spawn. The following code is in the ...
Yash-902's user avatar
0 votes
0 answers
24 views

How to trigger a local file download for a screenshot from a Unity WebGL game?

Is it possible for a Unity WebGL app to trigger a local file download - binary data generated in the app, somehow triggering a browser download?
ina's user avatar
  • 284
21 votes
2 answers
7k views

What is a "normal" in game development

I'm new in Game development and probably this is a silly question. I had a look online but haven't found a clear answer, I did it bit quick but enough to evaluate that this is a confusing topic ...
Federico Baù's user avatar
-4 votes
1 answer
93 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 ...
David Humphrey's user avatar
1 vote
1 answer
138 views

How do I react to a variable having reached a certain value?

I am a new coder and im trying to learn html. i have started working on a clicker game but im trying to figure out how to give a reward when my total clicks var has reached a certain value. the reward ...
David Humphrey's user avatar
0 votes
1 answer
68 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 ...
hmmmm's user avatar
  • 1
0 votes
0 answers
66 views

How to properly overlay HTML over canvas with scaling?

If I have <div container> <my html overlay> <my game canvas> </div> The canvas has ...
B''H Bi'ezras -- Boruch Hashem's user avatar
1 vote
0 answers
52 views

How to set pivot point for rotating a sprite?

Is there a way to set the pivot point for rotating a sprite? The default option seems to be arbitrarily chosen point on the sprite or the mid point. ...
Naveen's user avatar
  • 111
0 votes
1 answer
76 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 ...
Jhon's user avatar
  • 1
0 votes
0 answers
37 views

How to implement 2D rigid body motion?

I'm already depending on two NPM packages for 2D collision and differential equations: sat rungeKutta I've a basic simulation structure, but don't know where to start with to use these two packages ...
Hydroper's user avatar
  • 101
0 votes
1 answer
50 views

Is it safe to store the state of a game in Javascripts localStorage?

I am going to be completely honest, this is not 100% about storing a game state in Javascript's localStorage, it is more to do with a utility program storing statistics. Since it can be related to ...
Rewind's user avatar
  • 111
0 votes
0 answers
18 views

Game character in the browser game appears on Android, but not on iOS

I have a problem with rendering the game on mobile platforms (the game is written on the Impact.js), the problem is only with the iOS actually, the screenshot below shows that the characters are ...
李白 puer's user avatar
0 votes
1 answer
84 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 ...
Yash-902's user avatar
1 vote
1 answer
158 views

Would it be possible to make a Game Genie like program in Javascript?

Game Genie was a tool for the NES that allowed users to input codes that were able to drastically able to change the mechanics of a game by getting CPU reads and replacing the game's response with its ...
Jake Miahn's user avatar
2 votes
1 answer
116 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 ...
Quack E. Duck's user avatar
0 votes
0 answers
48 views

Handle roads following in a javascript game

In a browser game made in HTML5/Javascript, I would like to handle the move of units in real-time. But units would have to follow some predefined roads... Canvas seems better than svg to handle ...
Charles Dexter Ward's user avatar
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 ...
Jake Miahn's user avatar
0 votes
0 answers
166 views

three.js shader to keep moving vertices of points cloud inside sphere

I am trying to achieve the effect of having a points cloud with moving points while also keeping them confined within a sphere of radius X. I have managed to do it without using shaders but I want to ...
Dimitris Karagiannis's user avatar
0 votes
0 answers
21 views

How is it possible to create a texture atlas from a list of images? [duplicate]

Given a list of images how is it possible to place them on a square image, so they take up the least amount of space?
Iter Ator's user avatar
  • 257
1 vote
1 answer
722 views

Do you need to know JavaScript to make games with RPG Maker?

Do I have to know how to code in JavaScript to make good games in RPG Maker MZ? I'm asking cause I know you don't really have to code in RPG Maker. I already tried some programming languages, so I ...
Inerzja's user avatar
  • 11
0 votes
0 answers
34 views

Mixamo -> Blender -> BabylonJS empty scene

I am following this tutorial on babylon.js and managed to export a .babylon file, but when I load it with: ...
Purefan's user avatar
  • 101
1 vote
0 answers
84 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 ...
Ricardinho's user avatar
0 votes
0 answers
32 views

Player Jumping inconsistent and bugged

I am having a lot of different issues while coding player jumping for my game. Sometimes when the player hits the jump key the jump is delayed and/or doesn't jump to the heigh it usually does. I am ...
cs6413110's user avatar
1 vote
1 answer
104 views

How to draw/calculate a parabolic arch to hit stationary target in Javascript

First off I must admit I'm really not good at math and am trying to learn but have had a hard time finding examples someone like myself can follow. I'm trying to figure out how to draw and calculate ...
cluelessgamedev's user avatar
0 votes
0 answers
88 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 ...
Harry's user avatar
  • 141
1 vote
2 answers
153 views

How to publish WebXR game on Quest or Steam stores?

I would like to develop a simple and small game for WebXR so that Quest, Index, etc. can play it. I would eventually like to be able to put it on the Quest store and Steam. Is there a way to publish a ...
Imperial A's user avatar
0 votes
1 answer
48 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 ...
Tobias B.'s user avatar
1 vote
1 answer
57 views

How to instantly break method call?

I'm making 2d Mobile game using JavaScript. I have method that controls every character (Dumb AI) on battleground. It using recursion to call another action. I want to add debuff system and had little ...
Jakub Dobrzeniecki's user avatar
0 votes
1 answer
34 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 ...
subtlefly's user avatar
0 votes
1 answer
16 views

why does my button lose the changed cursor and mouseover behaviour as soon as I attach a class to my file?

Using adobe animate cc - exporting to HTML5 and coding in JS (or at least trying to) If I just hit cntrl+enter in adobe animate the button works as expected. If I run the app from a web server using ...
subtlefly's user avatar
0 votes
2 answers
591 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 ...
EzioMercer's user avatar
0 votes
0 answers
69 views

How can I seamlessly loop a video (webm since it has transparencies) in javascript canvas?

I am trying to play a video from beginning to 10 seconds, then loop the video from second 3 to 10 untill a key "c" is pressed. if it is pressed once, play the video from where it is ...
KonMos's user avatar
  • 11
0 votes
0 answers
58 views

How to distribute values in a grid based system

Context: I'm working on a simple environmental simulation in Javascript. I created some simple plants that grow, reproduce, and pass along their traits to their offspring. The simulation was pretty ...
Joe Poppins's user avatar
0 votes
1 answer
165 views

How to stop player when they hit an axis aligned bounding box?

I'm in the process of creating a game using electron and HTML5. It's going to be a pretty basic story-based platformer, but I'm ...
Blue Herring's user avatar
0 votes
0 answers
41 views

How do i get this web app to use the up joystick button as an input

There is this reaction time test app that calculates the reaction time from the time you press a button, it works with the joystick buttons except for the directional buttons, this is the app: https://...
Amine Messai's user avatar
1 vote
1 answer
128 views

Randomly distribute damage among allies

Let's say I have regiments of varying sizes, 500, 1000, 4000 troops. I want to distribute 1000 troops worth of losses to them so that in aggregate they lose 1000 troops. I want to do it as a ...
Harry's user avatar
  • 167
0 votes
0 answers
69 views

How to create a basic strategic AI?

I started creating a Vue3 version of the classic Sid Meier game Colonization. I have the basic player mechanics in place and even created a map editor. So I have 3 of the 4X in place: Explore, Expand ...
Thomas's user avatar
  • 101
1 vote
1 answer
381 views

How can I protect against a cheater changing variables on the client?

I built a multiplayer fighting game with impactjs, socket.io and nodejs and faced with "change variables hack" (I want to call it like this). All my current logic with jump, running, shoot ...
李白 puer's user avatar
0 votes
1 answer
120 views

How to spread circles evenly around a point?

In my game there's a part where a bunch of circles need to evenly spread around a point. Like in this demo below: ...
Ryan Peschel's user avatar
1 vote
1 answer
410 views

Algorithm for taking the shortest path between two XY coordinates

I am making a simple game in Phaser (but the library doesn't really matter). I have an enemy that is moving towards the player on a 2 dimensional grid. I have written some code that makes the enemy ...
yesman's user avatar
  • 113
0 votes
1 answer
173 views

Invisible sprites with requestAnimationFrame

I'm trying to animate a sprite sheet. I have a single image, and multiple objects of the same type but drawn at different locations on the canvas. What I'm trying to do is have each object move with ...
polendina's user avatar
0 votes
0 answers
82 views

Octree build time crashes page for complex mesh

Using the standard three.js FPS example of octree implementation with a more advanced mesh, crashes the page on load. My first idea is to write a few functions to save the octee data to a file, then ...
B''H Bi'ezras -- Boruch Hashem's user avatar
0 votes
1 answer
59 views

How do I go about creating images, which are units with traits?

Lets say there are 5 units, displayed as images on an html5-canvas. Each image (unit) has a different size. For the game I need to know the size of that unit, and also it's middle point. How and where ...
23rfew's user avatar
  • 1
0 votes
1 answer
201 views

How to send a JS game using a Discord bot?

I have made a JavaScript game. Now I want to make a Discord bot that embeds it in a message, so a reader can click on the embed to play the game inside the chat. Something similar to this Snake game. ...
amazing mustard's user avatar
0 votes
1 answer
229 views

Efficient calculation of billboard sprite transformations

I'm currently adding a billboard mode to animated sprites and static sprites in my 3D engine. The code below works fine, but I want to know if a more optimized solution exists. I've heard about ...
Ra1jin's user avatar
  • 3
0 votes
1 answer
63 views

Remove 2D images from layer where overlapping layers hide them completely

I'm creating a 2d game (engine written in JavaScript) with layers system. I would like to have some post process to optimize the images and the layers. If there is too many images in one layer it ...
TreantBG's user avatar
  • 147
0 votes
0 answers
150 views

Game networking with physics different client and server languages

We are currently having only "turn based" multiplayer games in our party game lobby system. Now we considered to add realtime multiplayer games as well, for example golf in 3D. Our current ...
HodorKing's user avatar
0 votes
1 answer
159 views

Multiplayer game - Player position updates transmission pattern

I'm building a very basic 3D multiplayer game using Three.js and Socket.io where all the player does is move in an environment. Considering there will be ~ 100 players in a single room and all data ...
bhachawl2298's user avatar

1
2 3 4 5
29