All Questions
Tagged with design-patterns javascript
12 questions
0
votes
1
answer
116
views
How to design a system that allows for custom equations of movement?
I'm developing a top-down shooter and I currently have a PhysicsSystem which operates on TransformComponents. Basically, it ...
2
votes
1
answer
871
views
Is it better design to store event effects within an Entity itself, or within a system?
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 ...
0
votes
1
answer
342
views
How to decide whether a Buff should be a component or a Buff object in an ECS?
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 ...
0
votes
1
answer
126
views
Should abilities have their state and functionality separated?
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 ...
2
votes
0
answers
1k
views
Idle game: calculating resource generation/consumption
I'm making an idle game in the vein of Melvor Idle and I've run into a problem calculating the yield and consumption of resources while the user is away. For those who don't know, many idle games have ...
0
votes
1
answer
3k
views
Tips on how to architect your JavaScript game with classes
OK, so I'm creating a <canvas> game using JavaScript (ES6+) features like Classes. It's straight from the vue-cli and <...
0
votes
1
answer
135
views
design / data structures
I'm working on a game which I'm writing in Javascript and then porting to iOS/Android via phonegap/cordova.
For the most part, I understand how to code and how to get what I want to happen, BUT I ...
0
votes
1
answer
234
views
Efficient way to store entities in javascript
I am trying to design a game from strach with Javascript.
It's a 2D game (a kind of Zelda on old devices).
I am trying to find an efficient way to store my data because I know I will have to face ...
2
votes
1
answer
3k
views
How should I efficiently clear and redraw my canvas with lots of animated sprites?
My current solution is to clear the entire canvas and redraw all sprites on every requestFrame(). This works but feels inefficient:
I only need to clear the part of the canvas made invalid by ...
0
votes
1
answer
101
views
Application components dependancy and decoupling
In my client application I have two major components:
GameCore - wrapper that handles everything about running the actual game
NetworkClient - A layer that takes care of communicating(receiving/...
5
votes
1
answer
567
views
City/Nation Builder - Unlocking game elements over time
Current Git (Needs more documentation)
Current working prototype to play with (Git code is after a BIG refactor)
Background: I'm making a javascript text city/nation builder along the lines of A ...
7
votes
2
answers
1k
views
Capitalizing on JavaScript's prototypal inheritance
JavaScript has a class-free object system in which objects inherit properties directly from other objects. This is really powerful, but it is unfamiliar to classically trained programmers. If you ...