Stack Exchange Network

Stack Exchange network consists of 174 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/...

0
votes
0answers
13 views

Where can I find a 100% working browserquest github repository [on hold]

The first repository I downloaded and installed work perfectly. That repository required me to use node js, web sockets, and socket io. Now after all these updates nothing works. Thanks in advance.
0
votes
1answer
49 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
42 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?
0
votes
0answers
26 views

Key presses are not responding well

The key presses are responding once, then doing the automatic key presses. The code is below and you can see what it does below that. ...
1
vote
1answer
74 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
21 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 ...
0
votes
0answers
22 views

How do I load tile map with phaser 3

I created a simple tilemap with tiled, and I'm trying to load it. The code and files can be seen here: https://codesandbox.io/s/qqq47wqv3w I'm not getting any errors in the console, but the canvas ...
0
votes
0answers
17 views

How to make sleeping bodies interact with sensors in box2d?

I am making a top-down multiplayer game using box2d. The map is much bigger than the player's screen. I want to send players only objects that they can see on their screens. I am doing this to prevent ...
1
vote
2answers
153 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 ...
0
votes
0answers
43 views

2d top-down camera with rotation on a tile map [duplicate]

Update: My first post was considered a duplicate, so, I am rewriting this one because I have not found a solution, just partial solutions. I am working at a 2d top-down game with tanks, the map is ...
1
vote
1answer
40 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
0answers
20 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
46 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
25 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
39 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
116 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
55 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
66 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
44 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
35 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
143 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
73 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
156 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
35 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
22 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
69 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
52 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
27 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
0answers
25 views

isogenic game engine: how can I read what state an entity in the user interface?

I recently found this engine, this engine as far as I know have limited documentation. I hardly found tutorial except from it's website ...
0
votes
1answer
51 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 ...
0
votes
0answers
53 views

Draw objects that move on an “infinite” map

I'm generating a game map using a mod function, so when I reach the boundaries of the map, I start generating the map again, I can generate the tiles by moving my character correctly, and when I reach ...
0
votes
1answer
110 views

Javascript-How to create a moving bullet animation from canvas

the bullet cant see to move at all ...
1
vote
3answers
84 views

Draw the HUD just once on the canvas

I am not able to draw only one HUD of my game on a separate canvas, so I do not have to redraw it to each frame, I have four functions, init(), render(), loop() and drawHUD(): init() is my function ...
1
vote
1answer
73 views

How to avoid rows on screen when cutting spritesheet tiles?

I'm having a problem with my spritesheet, I generate a map but when I zoom in on it I can observe these lines as in the image below: When I used the tiles each in their separate image, that did not ...
1
vote
2answers
64 views

Simulating Enums with Javascript

When developing in Javascript, it seems useful especially for event systems to use enum-likes, but not string comparison for performance considerations (also because it doesn't protect against typos). ...
0
votes
3answers
297 views

How to optimize collisions

I'm building a 2D MORPG using JavaScript, Node JS and socket.io To prevent cheating, I have to run all collisions for all players on my server. I'm currently doing fairly simple square collisions ...
0
votes
1answer
238 views

How to prevent (most) cheating (server-side) in my JavaScript, Node JS, socket.io MORPG?

I'm working on a fairly simple JavaScript + Node JS + socket.io (M)MORPG where multiple people play in the same world. This is actually working, but cheating is insanely easy at the moment. My goal ...
2
votes
1answer
77 views
0
votes
0answers
32 views

Handling “nested” user actions in client/server card game

I'm developing a card game in JavaScript in a functional programming style and I'm unsure what is the best way to implement the flow of player actions that require other player actions for their ...
1
vote
1answer
38 views

Online Browser Game Resource Incrementing Production Problem

I am working on a browser game where there are citys and their resource productions. Each player has their own production rate for each resource.Lets say stone as example. I have production rate,...
0
votes
0answers
61 views

Collisions between two objects in 2D space

I am implementing the collisions of my game in javascript, and at the moment what happens when the objects collide is that they have their speed changed to 0. What I'm starting to want to do is to ...
0
votes
0answers
21 views

Box2d detect separated none blocking floor as blocking wall

I'm trying to make my character walk on walls, it all goes okay-ish currently until this situation. Here's an image to show you how the wall looks like https://www.dropbox.com/s/5oyn55qpzljlhnl/...
0
votes
1answer
163 views

Camera with zoom that follows the player in javascript

I'm passing the time programming a little game in javascript, I've done what I'm trying this in several in game engine. And what I'm trying to do is generate the world while the player walks around ...
1
vote
0answers
69 views

Performance problems with scrolling html5 canvas for large tile-based game

I try programming a splix.io clone as an electron app and do the visualization via the html5 canvas. The movement across the tiles should look fluent like the original, so I target 60 frames a second. ...
0
votes
1answer
23 views

How to implement a Play As Guest feature on a mobile device using PhoneGap?

I have a Facebook Web Game that I converted to Android and iOS using PhoneGap. I can use Facebook for authentication on my mobile apps, but I would also like to allow the user to play as a guest. I've ...
0
votes
0answers
39 views

Marking up 2D polygon perimeter on an image

I'm working on a 2D game in JavaScript using the Web canvas. I plan to use AABB proximity detection and then point, line and polygon on polygon collision detection. Which means I need to define ...
1
vote
1answer
194 views

HTML5 Canvas - Drawing with Floats

I'm trying to implement a game where you have car moving along a line in HTML5 Canvas. Using a little bit of trigonometrie I managed to get the right x and y coordinates to add to the coordinates of ...
1
vote
1answer
38 views

UnrealEngine4 “backwards compatilibility”: Can I view a site that uses Unreal Engine4 on a very old laptop and still see in high definition?

Backwards compatible? The project: I want to render a high definition model on my personal website such that it'll be rendered in the highest definition possible on any device, from a 20-year-old ...