Category: the knowledge
-
Animation
See also: System: ANIMATION this is NOT necessarily movement – in fact, for frame based animation, it is likely not to be… So, this is just for the animation bit. There will also need to be a bit that has data about the sequence: This is the sort of data TILED will produce. See TILED…
-
Scene Graphs/Display Lists
See also: System: CAVEATS – consider the tech you are using and how it handles coordintaes – Phaser – Container – A Container, as the name implies, can ‘contain’ other types of Game Object. When a Game Object is added to a Container, the Container becomes responsible for the rendering of it. By default it…
-
Movement
See also: collision System: input The basics: Moving left – then flipping the direction Movement is context based – for example, the background moves when in an ‘over world’ type map (such as map in LTTP), but not necessarily if you are in a small room which will totally fit with the game screen (like…
-
Optimisation Tips
See also: for anything that you are using… JS – is single threaded… (is this still the case in 2022?) – yes it is! https://www.geeksforgeeks.org/javascript/mutlithreading-in-javascript/ use anonymous functions (arrow functions) to reduce memory usage Off load onto GPU Graphics Smaller images are usually painted faster than bigger ones. Scaling is evil. Sprite sheets work a…
-
Game states
See also: Game loop Games states help you arrange the game into logical groupings Only swap between states when necesary, and only the bits that are necessary – e.g. …structuring your game loop like this will make it much, much easier to do things such as switching game scenes and levels. It means that you…
-
Data model
See also: Progression and achievement system Requirements: Layers OBJECT LAYERS – export as data COLLISION (folder) – export as data GRAPHICS (folder) – export as data and graphics Question – is it better to generate background/foreground map at runtime (or at load/set up time) – or load a complete graphic? I feel that its better…
-
Randomness
Well, do you even need it? Apple changed the ipod shuffle play algorithm – because random can clump, but we don’t think it should… Seed Were it is – e.g. the running game i made, had a selection of predefined map sections that were ‘randomly’ selected – so long as there was not the same…
-
Level Design
See: Progression – Quest design. Consider what data needs to be maintained between levels/sections Also, consider what does NOT need to maintained – e.g. having sub sectional maps for particular purposes, which have particular data (like objects/locked things etc.) that are no longer required later, but don’t need to be ‘checked’ for from that point…
-
Functional Programming
Immutability – always use ‘const’ to declare variables Separate data and functions Data is represented by JS objects (JS’s version of arrays or hashes…) – it is a constant source of truth Functions act separately and make a modified copy of the data First-class functions – allows us to treat functions the way we treat…
-
Game loop
See also: Game states optimisation A game loop should be able to: SOURCE: https://gameprogrammingpatterns.com/game-loop.html Javascript – best practices for performant gameloops Performance is based upon how many things a game has to do each iteration of the loop. If you can defer a task, good. If you can store and reuse something, good. Consider if…