Author: admin

  • Tiled images

    See also: System: For tiled images, it is usual to have something like: Use TILED image editor (https://www.mapeditor.org/) to edit  Also aseprite A good outline of using tiled: Creating a Mario style level in Python / Pygame with a visual level editor [Tiled] A good JS focused one: Pokémon JavaScript Game Tutorial with HTML Canvas…

  • Search

    See also: System: First – what is built into the language? in two stages – sort the data, then search it Merge sort – O(nlog n) – Ω(n) if only one number quit else sort left half of numbers sort right half of numbers merge sorted halves https://www.geeksforgeeks.org/sorting-algorithms/ Resources

  • Scrolling

    See also: System: single layer – multi directions parallax Camera in a moveable, inner boundary What we want – character moves around in the ‘inner boundary’ – when they reach the egde, camera will start to move remains independant to size of map – but is defined by  Resources

  • Sprite management

    See also: System: Make spriteObjects for each ‘thing’ in the game – including x/y position on origin sprite sheet Push them onto a sprites array loop through the array and render each item Resources the kittykat thing…

  • Parallax backgrounds/endless scroll

    See also: System: needs a single variable to control the scrolling – otherwise there may be a gap which changes over time… Covered in AGDwJS p 316 (Creating the Scrolling Background) Requirements: This one works by –  2 instances of image one next to another when image 2 gets to 0, reset both instances: image…

  • 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…