Skip to main content

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
1 answer
2k views

I have this function to get the rotation angle from my sprite and a target: ...
Pavul Zavala's user avatar
0 votes
1 answer
126 views

I am making a HTML5 game using javascript with canvas. I am implementing a custom font adding @font-face style tag to header in the .html file, then if I set ...
Pavul Zavala's user avatar
1 vote
0 answers
55 views

EDIT I've actually commented out the motion in my code and adapted it to try reproduce this post.After a chat with @DMGregory he told me to use velocity reflection but as you can see in the following ...
JSmith's user avatar
  • 123
0 votes
1 answer
253 views

I am working on a coding/gaming application. I am currently stuck in the daily missions part. So, the user receives some missions each day, such as solving a problem, following another user, or ...
nour karoui's user avatar
0 votes
1 answer
135 views

I'm developing a top-down shooter and I currently have a PhysicsSystem which operates on TransformComponents. Basically, it ...
Ryan Peschel's user avatar
2 votes
2 answers
245 views

I'm trying to implement collision detection with raycasting for my 2D javascript game. The game uses equally-sized tiles as its level structure so to optimize collision detecton I'm trying to use a ...
Siggy7786's user avatar
1 vote
1 answer
203 views

I'm writing a 2D roguelike that uses an Entity Component System and I'm having trouble deciding between the traditional OOP approach versus a data-driven approach to implementing buffs and debuffs. ...
Ryan Peschel's user avatar
0 votes
0 answers
246 views

I'm developing a real-time browser roguelike using an ECS and currently I'm unsure of how to handle time. As of right now, whenever I need the current time, I just call ...
Ryan Peschel's user avatar
0 votes
2 answers
1k views

I am working on my first 2D game with Phaser 3. I have set up VS Code with a node.js https server and run it to deploy the game on localhost. While the game gets compiled successfully and deployed, I ...
bhagya's user avatar
  • 11
2 votes
1 answer
926 views

I'm developing a 2D roguelike with an Entity Component System (ECS) and I've been struggling with this question a lot the past week. For example, let's say you have various effects that occur when an ...
Ryan Peschel's user avatar
0 votes
0 answers
1k views

Let's say we have three enemies, a bear trap, a fire trap, and a minotaur. When you walk over the bear trap, the game spawns an invisible entity that, upon the player colliding with it, slows the ...
Ryan Peschel's user avatar
0 votes
1 answer
66 views

Let's say we have two vectors A and B. Is there a way to use Three.js' Ray or Raycaster classes to cast a line between vector A and vector B and check is it passes through a mesh in the scene? I know ...
Rick Stanley's user avatar
1 vote
2 answers
4k views

I am implementing an ECS with "archetypes" similar to how they are defined in Unity: A unique combination of component types is called an Archetype. For example, a 3D object might have a ...
EnderShadow8's user avatar
1 vote
0 answers
1k views

I am making an HTML5 game, which involves one audio being played multiple times at once. I searched this issue up and found this: https://stackoverflow.com/questions/25654558/html5-js-play-same-sound-...
Coder2195's user avatar
  • 123
1 vote
1 answer
2k views

Im making simple 2D space shooter with use of html5 and JavaScript. The idea is simple, shoot down as many aliens as you can. I made it to the point where I have player which can move and rotate, but ...
asqit's user avatar
  • 13
1 vote
1 answer
128 views

I'm making a game with HTML canvas (not WEBGL). I have zombies that go to the center of the screen, but for now they are just circles. I want to give them two arms, like the arms players have in ...
Justiniscoding's user avatar
0 votes
1 answer
206 views

I made a simple Snake game designed for trying Snake bots. I thought the base map functions work, but now I found there is an error. What I need is to properly translate any coordinates outside the ...
Tomáš Zato's user avatar
1 vote
0 answers
108 views

Okay, so I've started making a game using Khan Academy's Processing JavaScript, and I'm trying to delag it a bit since the framerate is very shaky. So, I've taken the advice of someone, and they told ...
Potato's user avatar
  • 111
0 votes
1 answer
279 views

I was making a html game and all the elements are blurry is there a fix to this? I use css but it makes it blurry Code ...
Giuca002's user avatar
2 votes
0 answers
111 views

I want to make a function like areColliding which takes two polygons as args. I also want to cover cases like and the dreaded because I am trying to create a ...
user avatar
0 votes
1 answer
103 views

I kind of new to making games been doing it for a few months and want to make games in a browser so I took the w3schools game example and I'm trying to add on to the game until I make a recreation of ...
Giuca002's user avatar
0 votes
1 answer
379 views

Couldn't find this answered already, surprisingly. For example, for a game (in my case a 2D top-down one), there could be advantages to doing so. For example, whenever you want to change an entity's ...
Ryan Peschel's user avatar
1 vote
1 answer
1k views

Please point me to the duplicate if this has been asked before. I couldn't find it. Basically, I am creating a 2d top-down game where the player is represented by a circle, and the tiles are ...
Ryan Peschel's user avatar
0 votes
1 answer
383 views

I'm developing a top-down 2D game in Javascript using an Entity-Component-System architecture and I'm struggling with the question of exactly how to implement temporary buffs / permanent passives. For ...
Ryan Peschel's user avatar
0 votes
2 answers
94 views

I'm developing a game which uses a standard Entity-Component-System. Every frame, the PhysicsSystem runs, which, among other things, updates the position of ...
Ryan Peschel's user avatar
0 votes
0 answers
87 views

I'm sure this has been asked before, but I couldn't find the thread. Let me know if you can locate the duplicate. So, I have a my level is an array of tiles, where a tile can either be solid or ...
Ryan Peschel's user avatar
4 votes
2 answers
727 views

I'm trying to figure out the best way of rendering my layered tiled maps with WebGL, and have come across this tutorial several times: https://blog.tojicode.com/2012/07/sprite-tile-maps-on-gpu.html ...
Ryan Peschel's user avatar
0 votes
1 answer
561 views

I'm developing a procedural dungeon generator using pre-built rooms and currently I'm using A* pathing to create corridors to connect one room's door to another room's door. The problem with this is ...
Ryan Peschel's user avatar
1 vote
2 answers
4k views

I'm making a game with Python, using Pygame. I want to publish my game on itch.io so that it's playable in the browser. Is there a way to do this? If so, how?
Devin Little's user avatar
1 vote
1 answer
413 views

Let's say I have a 100x100 map of tiles where each tile is 16x16 pixels. How would I get all tiles along a path? For example, let's say I wanted to get a list of all tiles along the shortest direct ...
Ryan Peschel's user avatar
0 votes
0 answers
930 views

Sorry if this question doesn't make sense, I'm still very new to WebGL / OpenGL. Basically, I'm trying to draw a tilemap similar to the one in Stardew Valley. Here's a screenshot from that game: https:...
Ryan Peschel's user avatar
2 votes
2 answers
3k views

I'm developing a top-down 2D tile-based canvas game. I have a single sprite sheet of all my tiles, and then a JSON tile map array of where they're placed. Previously I would render all the layers of ...
Ryan Peschel's user avatar
0 votes
0 answers
180 views

I'm making a top-down Javascript canvas game using the Entity Component System architecture. For an entity to be drawn on the screen every frame, it needs a ...
Ryan Peschel's user avatar
0 votes
1 answer
143 views

I'm developing a top-down game using Javascript and Canvas in an ECS architecture. I'm wondering, which of these is better from a design / elegance point of view? Method 1: Combining the ability ...
Ryan Peschel's user avatar
0 votes
1 answer
333 views

I am developing an isometric game like Anno 1602. I have an isometric tilemap. The default tilesize is 64x31. My goal is to show the area a building has influence to. For that I want to show a circle ...
pr4xx's user avatar
  • 101
2 votes
2 answers
2k views

I am making a recreation of the 2D voxel game Terraria in JavaScript. Like most sandbox games, Terraria has lighting, but because I am using JavaScript, performance is going to be an issue. I have ...
luek baja's user avatar
  • 123
1 vote
0 answers
101 views

I'm working on a small roguelike and I'd like to be able to tag the various "regions" generated via the Map generators so that I can use it as a lookup to environment descriptions. I see ...
erik's user avatar
  • 1,378
0 votes
0 answers
101 views

This was the closest question on found here: Help with a Fast 2D Grid-Based world rendering technique I'm doing a basic 2d grid where each box is filled with a texture pulled from a chipset. I'm ...
Seph Reed's user avatar
  • 275
0 votes
1 answer
89 views

When the client clicks it spawns a unit on the client-side which moves in a predetermined path, it also emits an event to the server which indicates that the client has spawned a unit. Once received ...
Ethan Payne's user avatar
0 votes
1 answer
244 views

Specifically talking in the context of JavaScript game development. For example, I can use the language specific timeout mechanism: ...
Adam Arthur's user avatar
-1 votes
1 answer
124 views

I'm Universo and for the longest time had coding issues around the concept of time-based sprite animation basically, do not know how to implement it and any code or explanation simple or complex that ...
Dominic Hughes's user avatar
0 votes
0 answers
79 views

Hi I recently created a javascript game, in this game, math random is used to pick a random shape. The shapes are in strings, and the associated numbers within the string are then used to show a color....
user145312's user avatar
1 vote
3 answers
2k views

Say I have three entities: Player, Spikes, and Zombie. All of them are just rectangles and ...
kibe's user avatar
  • 111
0 votes
1 answer
294 views

I'm trying to implement the Seperating Axis Theorem by following this article I found on MDN. Unfortunately, I'm not too geometry savvy and I wasn't able to find any good, simple implementation ...
Gian's user avatar
  • 113
0 votes
1 answer
55 views

When you run the project, you can see that the first circles have a black border around them. When I remove the Game.drawLines(), the circles don't have the border ...
stonefish's user avatar
0 votes
1 answer
597 views

I'm looking at this three.js cubemap example, and it runs fine in my browser when loaded from that page. After much strain to find and download the files - it does not run? What am I doing wrong, with ...
greenthings's user avatar
2 votes
1 answer
263 views

I am trying to make a raycasting game. Everything is rendered correctly except when the ray is facing up (angle > PI) or facing right(angle > 0.5PI and < 1.5PI) lines are drawn on walls. I am ...
Wojak2121's user avatar
1 vote
2 answers
2k views

I'm developing a 2D ant simulation in JavaScript. I'd like to implement a quadtree to store the positions of ants and other markers. I approximate all of these entities as circles, and I'm only ...
Aaron Eads's user avatar
0 votes
1 answer
647 views

I want to know how Camera works in game of Celeste. Currently what I have is, camera follows the player using interpolation: ...
eguneys's user avatar
  • 247
1 vote
1 answer
401 views

I am following the boardgame.io tutorial, but I do not want to use either of the two implementation options covered in the tutorial (React and Parcel). The tutorial requires a framework or bundling ...
Jim U's user avatar
  • 263

1 2
3
4 5
29