<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Indieklem</title>
    <description>The latest articles on Forem by Indieklem (@indieklem).</description>
    <link>https://forem.com/indieklem</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F627145%2Feeb845cd-154c-491c-9ac2-06b8943e849e.jpg</url>
      <title>Forem: Indieklem</title>
      <link>https://forem.com/indieklem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/indieklem"/>
    <language>en</language>
    <item>
      <title>How to make our game colors accessible to everyone</title>
      <dc:creator>Indieklem</dc:creator>
      <pubDate>Thu, 27 Jul 2023 16:13:42 +0000</pubDate>
      <link>https://forem.com/indieklem/how-to-make-our-game-colors-accessible-to-everyone-8cb</link>
      <guid>https://forem.com/indieklem/how-to-make-our-game-colors-accessible-to-everyone-8cb</guid>
      <description>&lt;p&gt;In this article, we'll take a look at how to make our colors easier to understand. Lack of accessibility is a hindrance to reading the game and, in the end, it's the user who pays the price.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is estimated that &lt;strong&gt;around 8% of boys&lt;/strong&gt; have some form of color blindness, while the figure is &lt;strong&gt;less than 1% for girls&lt;/strong&gt;. This means that approximately one boy in 12 and one girl in 200 are affected by this color vision disorder.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you don't want to degrade the gaming experience for these players, you've come to the right place.&lt;/p&gt;

&lt;p&gt;Are you starting from scratch and don't know where to find your colors? I recommend &lt;a href="https://lospec.com/palette-list"&gt;Lospec&lt;/a&gt;, a site where other artists offer their palettes.&lt;/p&gt;




&lt;h2&gt;
  
  
  At the beginning, a definition of accessibility
&lt;/h2&gt;

&lt;p&gt;Let's take a look at the definition of "accessibility" given on the French government's design website:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Digital accessibility means making digital content and services understandable and usable for people with disabilities.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;However, we should point out that accessibility is not limited to people with disabilities.&lt;/p&gt;

&lt;p&gt;Many factors other than our retina can affect the legibility of our interfaces, such as a poorly calibrated screen, a pair of glasses with tinted lenses or the sun's rays falling on our monitor.&lt;/p&gt;




&lt;h2&gt;
  
  
  Check the contrast between text and background colors
&lt;/h2&gt;

&lt;p&gt;Contrast, in accessibility, refers to the difference in brightness or color between elements to make content more readable and understandable.&lt;/p&gt;

&lt;p&gt;Let's say we have a beautiful yellow #F4D160. How do we know which colors to use to write on top of it? Or conversely, can I use my yellow text to write on a gray, white, black, blue or purple background?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://color.review/"&gt;Color Review&lt;/a&gt; is one of the best sites for working on this subject. It allows us to confirm that the contrast between my background color and my text color (foreground) is valid according to WCGA (&lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/"&gt;Web Content Accessibility Guideline&lt;/a&gt;) standards.&lt;/p&gt;

&lt;p&gt;All that remains is to test each of the color combinations we wish to use, and let the tool indicate whether or not the ratio is sufficient.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Yellow on black #001C30? Yes.&lt;/li&gt;
&lt;li&gt;Yellow on white #FFFFFF? That's no.&lt;/li&gt;
&lt;li&gt;Write purple #9726B6 on yellow? Titles yes, smaller texts no.&lt;/li&gt;
&lt;li&gt;Write blue #7573D1 on yellow? That's a no.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zK7-Woza--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/clr2ps4taq3itpzlpa2p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zK7-Woza--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/clr2ps4taq3itpzlpa2p.png" alt="Image description" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Improving legibility for people with color blindness
&lt;/h2&gt;

&lt;p&gt;The second point that interests us when we talk about accessibility is Daltonism, the famous visual anomaly that affects color perception, and which affects around 8% of boys and 1% of girls.&lt;/p&gt;

&lt;p&gt;Of course, it's unthinkable that we should leave these people out in the cold, so let's do all we can to make their gaming experience as pleasant as possible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Modify your color palette
&lt;/h3&gt;

&lt;p&gt;One solution is to adapt our color palette so that all users can approach it correctly. To this end, there are &lt;a href="https://www.whocanuse.com/"&gt;websites&lt;/a&gt; and &lt;a href="https://www.color-blindness.com/color-blindness-tools/"&gt;applications&lt;/a&gt; that simulate certain types of vision. This makes it much easier to see how colors are perceived by other people, and to correct (or not) accordingly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nW5MpHgd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6rvsh9lx7ef06i49bz1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nW5MpHgd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q6rvsh9lx7ef06i49bz1.png" alt="Image description" width="800" height="697"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Create a specific palette
&lt;/h3&gt;

&lt;p&gt;A second solution is to create a color-blind mode in the game options. Can't agree on the colors to provide to all your players? Let's create a specific palette for color-blind people.&lt;/p&gt;

&lt;p&gt;Several games offer this option, including World Of Warcraft :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MlhePvxC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tq8oa3uumo6coej92c3b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MlhePvxC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tq8oa3uumo6coej92c3b.png" alt="Image description" width="800" height="615"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Color, yes, but not only
&lt;/h2&gt;

&lt;p&gt;What we need to understand here is that, despite our best efforts, there's always a risk that the player won't see what we're trying to show him if we rely solely on color.&lt;/p&gt;

&lt;p&gt;For example, if you open the Wikipedia page dedicated to the subject of color blindness, you can read that &lt;a href="https://en.wikipedia.org/wiki/Achromatopsia"&gt;achromatopsia&lt;/a&gt; is a disease that manifests itself by a total absence of color vision. In this case, even perfect contrast and a suitable palette may not be enough.&lt;/p&gt;

&lt;p&gt;Let's imagine for a moment that we want to represent a state where the life bar has reached a critical stage. Instinctively, the first idea would be to change the color of the gauge from green to red. Here's the vision of someone suffering from this rare case of color blindness:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--INRiJoDJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6gdu6o454lzmzyhdkwtd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--INRiJoDJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6gdu6o454lzmzyhdkwtd.png" alt="Image description" width="544" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's immediately more complicated, if not impossible, to understand the information, because it's based solely on the use of colors.&lt;/p&gt;

&lt;p&gt;One of the easiest ways to correct this problem is to play with another element. We can, for example, choose to remove the life bars as they diminish, in addition to changing the color. The result is instantly more digestible and readable:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--519rgYR_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/buf5flaoibdbdfs9fy1l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--519rgYR_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/buf5flaoibdbdfs9fy1l.png" alt="Image description" width="544" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Game menus as a battle horse
&lt;/h3&gt;

&lt;p&gt;Although it may seem trivial, this is a recurring error in many video game menus.&lt;/p&gt;

&lt;p&gt;To compensate for this, some designers choose to add extra elements to differentiate items from one another: an outline, an arrow, a line...&lt;/p&gt;

&lt;p&gt;The Animal Crossing menu, for example, features a cursor in addition to yellow highlighting (left), while Crash Bandicoot's selection is indicated only by a color change:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0C3lpiiJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78etnsqhfkpf9hj6msgu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0C3lpiiJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78etnsqhfkpf9hj6msgu.png" alt="Image description" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Finally, a few recurring phrases
&lt;/h2&gt;

&lt;p&gt;Here are a few phrases that come up (too) often when we talk about accessibility, and my response to them.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Accessibility takes too long to set up&lt;/strong&gt;, I'll do that later.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yes, making your game accessible is an extra workload. Nevertheless, putting the right practices in place at the outset saves time later on.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Accessibility is a constraint&lt;/strong&gt;, it limits my creativity&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Yes, accessibility is a constraint. But what about the poor gameplay experience you’ll create for your players? It’s worst.&lt;/p&gt;

&lt;p&gt;Game Jam is the very essence of the word "compulsion", and yet thousands of games, each more extraordinary than the last, are created every year.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;If I understand my interface&lt;/strong&gt;, then the others too&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Apart from the fact that over-inflated self-confidence is rarely a good thing, it's rare for a design element to be perfect.&lt;/p&gt;

&lt;p&gt;That's where user reviews come in. Having the ability to capture user feedback, learning to ask the right questions, or knowing how to analyze usage data are just some of the many skills of a good &lt;a href="https://fr.wikipedia.org/wiki/Exp%C3%A9rience_utilisateur"&gt;UX Designer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Don't just rely on your own opinion, learn from others and, above all, ask your players for their opinion.&lt;/p&gt;




&lt;h2&gt;
  
  
  Want to learn more?
&lt;/h2&gt;

&lt;p&gt;I strongly invite you to explore this vast subject, in particular via these links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/"&gt;Web Content Accessibility Guideline&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://uxplanet.org/heres-what-you-need-to-know-about-color-accessibility-in-product-design-aecbd0c30628"&gt;Uxplanet&lt;/a&gt; - Here’s What You Need to Know About Color Accessibility in Product Design&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Links of the moment
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://store.steampowered.com/app/1637320/Dome_Keeper/"&gt;Dome Keeper&lt;/a&gt; - or the art of using a limited palette to make a beautiful game&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/indieklem/status/1680217512858857472"&gt;Our game&lt;/a&gt; - part co-op, part turn-based, we only use 32 colors&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://minijamofficial.com/"&gt;Mini-jam&lt;/a&gt; - feel like getting into video games, but have no idea how to go about it? Start here!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/bytecauldron/awesome-gamemaker#getting-started"&gt;Game Maker Studio resources&lt;/a&gt; - chart your course through the world of Game Maker Studio&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/Gogolitus/status/1634596725045198850"&gt;Some brush ideas&lt;/a&gt; - for your future pixel art landscapes&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/huttaburger/status/1631353948354273283"&gt;Pixel art inspiration&lt;/a&gt; - minimalist, with few colors, to keep with the newsletter theme&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/atiupin/status/1679914253275234322"&gt;Tip of the moment&lt;/a&gt; - from (rip) Twitter&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://twitter.com/indieklem/status/1677246534000205826"&gt;The interface of the moment&lt;/a&gt; - because if you haven't figured it out yet, we like it here!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Do you have a link that talks about video games, interfaces, game dev or design? Let me know.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Want to receive the next article in your mailbox directly? &lt;a href="https://indieklem.substack.com/about"&gt;Subscribe here&lt;/a&gt;, and build step by step better interfaces for your games.&lt;/p&gt;

</description>
      <category>design</category>
      <category>ui</category>
      <category>gamedev</category>
      <category>gamemaker</category>
    </item>
    <item>
      <title>Creating a grid with Game Maker Studio 2</title>
      <dc:creator>Indieklem</dc:creator>
      <pubDate>Sat, 08 Oct 2022 09:14:18 +0000</pubDate>
      <link>https://forem.com/indieklem/creating-a-grid-with-game-maker-studio-2-20k2</link>
      <guid>https://forem.com/indieklem/creating-a-grid-with-game-maker-studio-2-20k2</guid>
      <description>&lt;p&gt;If you want to create a checkerboard level for a chess game, or a turn-based game like Advance Wars 2 (which by the way is a great game, if you don't know it, play it!), you're in the right place to start. In this tutorial, we will learn how to create a grid using a 2-dimensional board. Then we'll fill in the grid with the different objects in our level.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MPR95lC8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yst449m5qo4uubwkg2sp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MPR95lC8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yst449m5qo4uubwkg2sp.png" alt="Image description" width="800" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick introduction: the 2D table
&lt;/h2&gt;

&lt;p&gt;When I talk about a 2D array in GameMaker Studio, it is simply an array where each entry contains... another array. Most development languages have this type of variable, and it is a must in video games. In this way, you can store a lot of information in an orderly way, whether it's your future level or a list of characters and their favorite colors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Player
array_2d = [
    ["Mario", "Red", 1],
    ["Luigi", "Green", 2],
    ["Peach", "Pink" , 3]
];

// Output result
array_2d[0,0] = "Mario";
array_2d[0,1] = "Red";
array_2d[0,2] = "1";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To learn more, I invite you to &lt;a href="https://manual.yoyogames.com/GameMaker_Language/GML_Overview/Arrays.htm"&gt;visit this page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initialization and creation of the grid
&lt;/h2&gt;

&lt;p&gt;To begin, we will create an object called oGrid and initialize in its create event a 2D table which will be used as a level. We wish to obtain a level of 20 squares in length and width, with squares of 32 pixels.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Create event oGrid

depth = -1000;

// Width &amp;amp; Height size
gridWidth  = 20;
gridHeight = 20;

// Box size
boxSize = 32;

// Create 2D array filled with 0
for(var i = 0; i &amp;lt; gridWidth; i++){
    for(var j = 0; j &amp;lt; gridHeight; j ++){
        global.grid[i, j] = 0;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's put this object in our room and... Congratulations! We have an object oGrid which contains a 2D array:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;depth -1000 so that the grid is above the rest&lt;/li&gt;
&lt;li&gt;gridWidth and gridHeight is the size of the grid&lt;/li&gt;
&lt;li&gt;boxSize is the size of each square&lt;/li&gt;
&lt;li&gt;And global.grid the variable that contains our grid, currently all cells contain the value "0"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As you have seen, we use the word global to define our grid. Being an essential element of our game, and as we will use it often, it is better to use this type of variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Draw the grid with the draw_line() function
&lt;/h2&gt;

&lt;p&gt;To view our 2D table we can use the debugging tool provided by Game Maker Studio, and then look at what is in the variable global.grid. The second solution is to draw it on the screen. Knowing that this solution facilitates our life during the debugging phase, here is what we must write in the draw event of the object oGrid to make our grid appear:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Draw event oGrid

// Set opacity &amp;amp; color
draw_set_alpha(.5);
draw_set_color(c_green);

// Loop trought each row and column
for (var i = 0; i &amp;lt; gridWidth; i+=1){
    draw_line(0, i*boxSize, room_width, i*boxSize);
}

for (var j = 0; j &amp;lt; gridHeight; j+=1) {
    draw_line(j*boxSize, 0, j*boxSize, room_height);
}

// Reset opacity &amp;amp; color
draw_set_color(c_white);
draw_set_alpha(1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With these few lines of code, we now display the 400 cells (20 * 20, I'm a math whiz, but this is good) of our level:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;draw_set_alpha and draw_set_opacity allow you to change the opacity and color of the lines&lt;/li&gt;
&lt;li&gt;The two loops for go through the grid&lt;/li&gt;
&lt;li&gt;And draw_line draws horizontal and vertical lines at each iteration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kNsnlFSb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvz6aiwyjbyiovcqyh8o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kNsnlFSb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vvz6aiwyjbyiovcqyh8o.png" alt="Image description" width="800" height="834"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding walls in the level
&lt;/h2&gt;

&lt;p&gt;Let's add elements to our level and then transfer them to our grid. I propose that we add walls: to do this, we need to create a oWall and assign it a sprite. For this tutorial, I advise to use a sprite of 32px by 32px.&lt;/p&gt;

&lt;p&gt;Then use the room editor in Game Maker to place the object in question in the level. To make it easier let's set the grid size to 32px and use the snapThis way the elements will always be positioned on a multiple of 32.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hRUpEsHc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ync265q138kbwkv4xja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hRUpEsHc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ync265q138kbwkv4xja.png" alt="Image description" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At this point we have a grid drawn and objects in our level, but the two are not linked. Indeed, the objects are present in the room, but at no time have we added them to our global.grid. I don't want to keep the suspense going any longer, that's what we'll do now.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inserting the walls in the grid
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Create event oWall

// Array position
var _x = x / oGrid.boxSize;
var _y = y / oGrid.boxSize;

// Add id to the array
array_set(global.grid[_x], _y, id);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations, every object oWall of our room is now added to our grid when it is created. Be careful, for this to work, make sure that the oGrid is created before your objects oWall in the order of creation of your room, otherwise you will try to access a variable that does not yet exist.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xOvcVnKn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t188h2ema2yjr1nka8qv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xOvcVnKn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t188h2ema2yjr1nka8qv.png" alt="Image description" width="800" height="834"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add objects on several squares at the same time
&lt;/h2&gt;

&lt;p&gt;Let's imagine a world where one of your walls is 32px wide and 16px high (incredible, I know). With our code, it will be added only on the square where it originates, and not on all the squares it overlaps. Here's how to fix this problem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Create event oWall

// Array position
var _x = x / oGrid.boxSize;
var _y = y / oGrid.boxSize;

// Obj size
var _width  = sprite_width / oGrid.boxSize;
var _height = sprite_height / oGrid.boxSize;

// Add the id of the object on the grid
for (var i = 0; i &amp;lt; _width; ++i) { 
    for (var j = 0; j &amp;lt; _height; ++j) {
        // Add id to the array
        array_set(global.grid[i + _x], j + _y, id);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We calculate the size of the object in relation to its variables sprite_width and sprite_height&lt;/li&gt;
&lt;li&gt;We translate this into number of cells with / oGrid.boxSize&lt;/li&gt;
&lt;li&gt;We loop on these and modify array_set() to add the object on the boxes in question&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Detect the walls contained in the grid
&lt;/h2&gt;

&lt;p&gt;That's great, now our grid contains the ID of the objects added to the room. Let's try to modify our code to view the grid to show the boxes blocked by walls.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Draw event oGrid

// Set opacity &amp;amp; color
draw_set_alpha(.5);
draw_set_color(c_green);

// Loop trought each row and column
for (var i = 0; i &amp;lt; gridWidth; i+=1){
    draw_line_width(0, i*boxSize, room_width, i*boxSize, 1);
}

for (var j = 0; j &amp;lt; gridHeight; j+=1) {
    draw_line_width(j*boxSize, 0, j*boxSize, room_height, 1);
}

// Display values
for (var i = 0; i &amp;lt; gridWidth; i+=1) {
    for (var j = 0; j &amp;lt; gridHeight; j+=1) {
        var _value = array_get(global.grid[i], j);
        if(_value != 0) {
            draw_set_color(c_red);
            draw_rectangle(i * boxSize, j * boxSize, i * boxSize + boxSize, j * boxSize + boxSize, false);
        }

    }
}

// Reset opacity &amp;amp; color
draw_set_color(c_white);
draw_set_alpha(1);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Our table is browsed with the loops for&lt;/li&gt;
&lt;li&gt;Then the values contained for each iteration are retrieved with array_get(global.grid[i], j)&lt;/li&gt;
&lt;li&gt;And finally, if it is different from 0 which is our base value, we display a red rectangle with draw_rectangle()&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l4dI9LTT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxsg8tgihvt7hu0eqgbd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l4dI9LTT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxsg8tgihvt7hu0eqgbd.png" alt="Image description" width="800" height="834"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;We have a grid, which contains the walls of our room, and we know how to detect them. And that's it for this tutorial! Here is what you can do next:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add more than one object per box&lt;/li&gt;
&lt;li&gt;Destroy a wall by clicking on the right square&lt;/li&gt;
&lt;li&gt;Adding elements on the fly&lt;/li&gt;
&lt;li&gt;Move a character square by square, checking for collision&lt;/li&gt;
&lt;li&gt;Or use path finding algorithms to ensure that a path is available&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you have any questions about this tutorial or a specific need, let me know in comments so we can talk about it together.&lt;/p&gt;

&lt;p&gt;See you later!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://indieklem.com"&gt;https://indieklem.com&lt;/a&gt; on October 8, 2022.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>gamemaker</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>8 UI/UX tips about password design</title>
      <dc:creator>Indieklem</dc:creator>
      <pubDate>Tue, 09 Nov 2021 10:25:28 +0000</pubDate>
      <link>https://forem.com/indieklem/8-uiux-tips-about-password-design-5bbn</link>
      <guid>https://forem.com/indieklem/8-uiux-tips-about-password-design-5bbn</guid>
      <description>&lt;p&gt;With the multiplication of saas (service as a software) these last years and the security problems linked to the fact of having an identical password for each service, I find myself using the « Forgot password » page much more often than before.&lt;/p&gt;

&lt;p&gt;If this can be corrected beforehand thanks to password managers such as 1Password or LastPass, with the « no password » methods implemented by tools like Slack or the social login here are a few UI/UX tips to apply to the design of your « Login » and « Forgot password » pages.&lt;/p&gt;

&lt;p&gt;Users who try to log in, create a new password or reset their password will be eternally grateful to you.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Add a button to hint the password
&lt;/h2&gt;

&lt;p&gt;The first thing to do to avoid mistakes is to offer your users the possibility to see the characters they just typed in the password field. This feature is often represented by an « eye » icon on the right of the field.&lt;/p&gt;

&lt;p&gt;It’s simple, basic, as my favorite singer would say but it’s not always available.&lt;/p&gt;

&lt;p&gt;For those who know the browser console (press F12 now and enter a wonderful world) you can simply change the type= »password » of the password field to type= »text » and see what you have written.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3najof2gxn56gcygkks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc3najof2gxn56gcygkks.png" alt="Hint the password"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Show if the Caps Lock key is on
&lt;/h2&gt;

&lt;p&gt;Tell your users if the Caps Lock key is enabled when they type their password.&lt;/p&gt;

&lt;p&gt;But don’t worry if it’s not, there is no need to display the text « Caps Lock is Off ». Few users will see the message and act accordingly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd35m4coyg59syje4lx7t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd35m4coyg59syje4lx7t.png" alt="Caps lock key is on"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Show if the Num Lock key is on
&lt;/h2&gt;

&lt;p&gt;The same UI/UX design practice can be applied with the Num Lock key&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05cdjt1o9nlus8f01o7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05cdjt1o9nlus8f01o7e.png" alt="Num Lock key is on"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Limit password conditions and display them
&lt;/h2&gt;

&lt;p&gt;Display precise explanations when creating the password, don’t hide them in an tooltip to bring them out only when your user makes an error. Save him time and frustration. A real time validation is also a real plus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbsyfq6w8n14l8xddj1t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqbsyfq6w8n14l8xddj1t.png" alt="Limit the password conditions and display them"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Show the conditions required when creating the password
&lt;/h2&gt;

&lt;p&gt;Remember… It was 6 months ago, to create his password you asked your user to add:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;At least 1 uppercase&lt;/li&gt;
&lt;li&gt;At least 1 number&lt;/li&gt;
&lt;li&gt;At least 8 character&lt;/li&gt;
&lt;li&gt;And the last 3 digits of his credit card (Wait, what? Did you really ask that?)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A security measure, a fashion effect, a copy cat because the competitor was doing the same or a useless waste of time? It doesn’t matter, you did it. And today he doesn’t remember these constraints that you imposed. So if he makes a mistake while login, make his life easier and remind him. Remind him the conditions required days, weeks, months or years ago, I promise you it will help him.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5dkhmkrzf5ze2ncfsqx8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5dkhmkrzf5ze2ncfsqx8.png" alt="Show the conditions"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Delete the password confirmation field
&lt;/h2&gt;

&lt;p&gt;If you follow the previous steps, especially the one that allows the user to see what they are writing, then the password confirmation field that was a safety feature (a long time ago in a galaxy far, far away) to avoid errors becomes obsolete. It’s already a pain to type the password once, don’t make it twice.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femq9b3z2e0r5ers0duup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Femq9b3z2e0r5ers0duup.png" alt="Delete the password confirmation field"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Fill the email field on the forgot password page
&lt;/h2&gt;

&lt;p&gt;The process when your user realizes he have forgotten their password often looks like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comes to the login page&lt;/li&gt;
&lt;li&gt;Types in his credentials&lt;/li&gt;
&lt;li&gt;Receives an error message&lt;/li&gt;
&lt;li&gt;Realizes that he does not remember his login information&lt;/li&gt;
&lt;li&gt;Clicks on the link « Forgot your password »&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s where the magic happens, because at this point in the user’s journey, you already know their email address. Yep. They just typed it in a few seconds ago. All you need do to is to fill it on the present page so that they don’t have to write the same things over and over again. Remember in design every second saved matter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86wlsbkinat43d9fqi2h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86wlsbkinat43d9fqi2h.png" alt="Fill the email field"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. Suggest creating a new password rather than automatically generating a new one
&lt;/h2&gt;

&lt;p&gt;Who’s going to remember your long, complicated machine-generated password? Spoiler Alert: no one. Whether it is for security reasons or to let the user use his password manager, it’s better to let the user create a new password rather than randomly generate one in the email they will receive from you.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc1eir5f2qanyn6nxkvi2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc1eir5f2qanyn6nxkvi2.png" alt="Link to new password generation"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR:
&lt;/h2&gt;

&lt;p&gt;Here is 8 UI Tips to make the life of your user easier on your login and password lost pages. Remember, less friction is more conversion. You don’t want to spend time fighting with bad interface, neither does your user.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Add a button to hint the password&lt;/li&gt;
&lt;li&gt;Show if the Caps Lock key is on&lt;/li&gt;
&lt;li&gt;Show if the Num Lock key is on&lt;/li&gt;
&lt;li&gt;Limit password creation conditions and display them&lt;/li&gt;
&lt;li&gt;Show the conditions required when creating the password&lt;/li&gt;
&lt;li&gt;Do not add a password confirmation field&lt;/li&gt;
&lt;li&gt;Pre-fill the email field on the forgot password page&lt;/li&gt;
&lt;li&gt;Suggest creating a new password rather than automatically generating a new one&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;👋🏻 Thanks for reading me, this article was originaly posted on &lt;a href="https://jimmylollipop.com/" rel="noopener noreferrer"&gt;Jimmy Lollipop&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ux</category>
      <category>uiweekly</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
