<?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>DEV Community: damanita</title>
    <description>The latest articles on DEV Community by damanita (@damanita).</description>
    <link>https://dev.to/damanita</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%2F868461%2F264d7ab7-aa79-40b9-a600-623b0ef47532.png</url>
      <title>DEV Community: damanita</title>
      <link>https://dev.to/damanita</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/damanita"/>
    <language>en</language>
    <item>
      <title>CSS clamp() Method</title>
      <dc:creator>damanita</dc:creator>
      <pubDate>Wed, 18 Jan 2023 16:59:26 +0000</pubDate>
      <link>https://dev.to/damanita/css-clamp-method-3234</link>
      <guid>https://dev.to/damanita/css-clamp-method-3234</guid>
      <description>&lt;p&gt;Hi there! &lt;/p&gt;

&lt;p&gt;Recently, I've learnt a new functionality in CSS, which I've never known about before. I decided to share it with you, because I believe that it is very valuable and practical to use. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;clamp()&lt;/strong&gt; method has three values. The first is the &lt;strong&gt;minimum&lt;/strong&gt;, the second is the &lt;strong&gt;preferred&lt;/strong&gt; and the third is the &lt;strong&gt;maximum&lt;/strong&gt; value. This function allows you to set a value that will not decrease beyond the minimum and increase above the maximum, i.e. it &lt;strong&gt;clamps the middle value of the range&lt;/strong&gt;. Below you will find a link to check it out:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://jsfiddle.net/2kdbe680/2/" rel="noopener noreferrer"&gt;https://jsfiddle.net/2kdbe680/2/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In my opinion, this is a very practical method, because you don't have to adjust font size to the screen size. It's a different approach to media query and depending on the situation might be very useful.&lt;/p&gt;

&lt;p&gt;Do you have experience using it? Please drop a comment.&lt;/p&gt;

&lt;p&gt;Thank you for reading! &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>html</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How can you execute a function after pressing a button or actually any other HTML element.</title>
      <dc:creator>damanita</dc:creator>
      <pubDate>Fri, 26 Aug 2022 18:04:13 +0000</pubDate>
      <link>https://dev.to/damanita/how-can-you-execute-a-function-after-pressing-a-button-or-actually-any-other-html-element-mpb</link>
      <guid>https://dev.to/damanita/how-can-you-execute-a-function-after-pressing-a-button-or-actually-any-other-html-element-mpb</guid>
      <description>&lt;p&gt;Hi there!&lt;/p&gt;

&lt;p&gt;Today I am going to show you how you can execute a function after clicking on an HTML element. &lt;/p&gt;

&lt;p&gt;You have to query an element from the document. There are &lt;strong&gt;few ways&lt;/strong&gt; you can do it like &lt;code&gt;getElementByClassName&lt;/code&gt; or &lt;code&gt;querySelector&lt;/code&gt;. I will use &lt;code&gt;getElementById&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const button = document.getElementById("buton");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Assign a listener to this element (button), which will be triggered a function after the element was clicked:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;buton.addEventListener("click", function() {
   alert("Hello there!")
 });

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, an alert will be displayed with the text '&lt;strong&gt;Hello there!&lt;/strong&gt;'&lt;/p&gt;

&lt;p&gt;You can also assign a named function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function clickButton() {
   alert("Hello there!");
 }

 button.addEventListener("click", clickButton);

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As I mentioned above, you have &lt;strong&gt;several ways&lt;/strong&gt; to query for an element from a document. Here is a link, with more examples, eg.: how to assign a listener to each element from a list of elements: &lt;a href="https://jsfiddle.net/8jo9vhsa/1/"&gt;https://jsfiddle.net/8jo9vhsa/1/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have any suggestions, feel free to write a comment.&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A simple RPG game - Part 2- a new look for my project.</title>
      <dc:creator>damanita</dc:creator>
      <pubDate>Thu, 16 Jun 2022 18:05:46 +0000</pubDate>
      <link>https://dev.to/damanita/a-simple-rpg-game-part-2-a-new-look-for-my-project-4em1</link>
      <guid>https://dev.to/damanita/a-simple-rpg-game-part-2-a-new-look-for-my-project-4em1</guid>
      <description>&lt;p&gt;In the last article, I described the idea for my &lt;strong&gt;RPG game&lt;/strong&gt;. However, I'm not entirely satisfied with the result, that's why I want to improve it by rewriting it, giving more functionalities, refreshing visualization(look and feel) and spending more time on good code practices(eg.: functions naming, splitting into modules/classes, etc).&lt;/p&gt;

&lt;p&gt;I decided on &lt;strong&gt;pixel art&lt;/strong&gt;, because this type of art seems to be simple and suitable for the type of game I'm creating. Besides, I like it :-)&lt;/p&gt;

&lt;p&gt;You can see the new graphics below. I used different &lt;strong&gt;color palettes&lt;/strong&gt; and I am finally satisfied with the overall result. Let me know what you think.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yxAJSkzw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3t2ztafaz42tecu04ja.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yxAJSkzw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n3t2ztafaz42tecu04ja.png" alt="RPG game" width="880" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next steps would be to design a few different game levels and how users can interact with it.&lt;/p&gt;

&lt;p&gt;That's it for now. Just a short update. I will keep you posted on my progress on the project.&lt;/p&gt;

&lt;p&gt;If you have any &lt;strong&gt;suggestions&lt;/strong&gt;, please write a comment.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>A simple RPG game - personal project to improve my programming skills</title>
      <dc:creator>damanita</dc:creator>
      <pubDate>Sun, 12 Jun 2022 21:31:02 +0000</pubDate>
      <link>https://dev.to/damanita/a-simple-rpg-game-personal-project-to-improve-my-programming-skills-3og7</link>
      <guid>https://dev.to/damanita/a-simple-rpg-game-personal-project-to-improve-my-programming-skills-3og7</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;I have been working on a &lt;strong&gt;game&lt;/strong&gt; for a while, where you fly a spaceship, destroy enemies and collect coins that allow you to buy additional skills for the ship. However, one of my good friends who is an experienced programmer told me that my project could be improved. He also advised me to share my progress, which would help me to stay motivated to learn and focus on my project. That is why I decided to write this article in which I want to describe what I have done and what are my next steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  I have already &lt;strong&gt;implemented&lt;/strong&gt; following features:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Game rules
&lt;/h3&gt;

&lt;p&gt;The main character of this game is a &lt;em&gt;spaceship&lt;/em&gt; that collects coins(points). Points appear after destroying opponents. If the spaceship collects enough coins, it can buy skills to improve his statistics. The game also has two types of enemies. One of them is the &lt;em&gt;‘alien’&lt;/em&gt;, which takes away points from the ship during collision. The other is &lt;em&gt;‘UFO’&lt;/em&gt;, which shoots towards the ship and also takes points away from it. Then when the spaceship destroys enemies, it will be able to collect coins(points) from these enemies after they disappear. The goal of the game is to destroy all opponents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Spaceship skills
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Laser length&lt;/strong&gt; - collect coins from a greater distance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ship speed&lt;/strong&gt; - faster ship movement&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Bullets speed&lt;/strong&gt; - destroy opponents more efficiently&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Technologies used
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Pixi JS&lt;/strong&gt;&lt;br&gt;
Here is a list of a few things which came to my mind while I started using it. And this is just my opinion which means you don’t have to agree.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;advantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;easy API&lt;/strong&gt; - there is just the right amount of functions to use like drawing an image or a shape, rotating it compared to other libraries where API is to complex&lt;/li&gt;
&lt;li&gt;very similar to &lt;strong&gt;canvas&lt;/strong&gt; with few additional functions - easier to learn&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;graphics&lt;/strong&gt; - you can very easily and effectively draw various geometric figures &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;examples&lt;/strong&gt; - you can find small examples on many topics&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MIT license&lt;/strong&gt; - you can use it in commercial projects&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;disadvantages&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;3D&lt;/strong&gt; - you can not use 3D graphics&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Look and feel of the game
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;On the &lt;strong&gt;right&lt;/strong&gt; side skills and statistics of your ship are displayed. Skills can be bought by the given amount of coins.&lt;/li&gt;
&lt;li&gt;On the &lt;strong&gt;left&lt;/strong&gt; side there is actual gameplay happening.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is what my game looks like now, but like I said, I want to improve it, add different features and make my code cleaner.&lt;/p&gt;

&lt;h2&gt;
  
  
  Next things I want to &lt;strong&gt;implemented&lt;/strong&gt;:
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Game levels
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Each of these levels will be more difficult.
Increasing value of skills per level&lt;/li&gt;
&lt;li&gt;The character will need to spend more resources/gold coins&lt;/li&gt;
&lt;li&gt;Stronger opponent at the end of each level aka boss :D&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Ship skills
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;different &lt;strong&gt;ships&lt;/strong&gt; or additional &lt;strong&gt;equipment&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;bullets range&lt;/strong&gt; - destroys enemies from a greater distance&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;packages&lt;/strong&gt; - the character can obtain skills from the package which would show up after killing a boss instead of paying for it&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;I am writing this game, because I want to learn something new, expand my programming skills and build my portfolio. &lt;/p&gt;

&lt;p&gt;Additionally, I would be very grateful for any advice and support which would help me in continuing this project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thank you&lt;/strong&gt; for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>Hi there!</title>
      <dc:creator>damanita</dc:creator>
      <pubDate>Thu, 26 May 2022 22:21:08 +0000</pubDate>
      <link>https://dev.to/damanita/hi-there-2jap</link>
      <guid>https://dev.to/damanita/hi-there-2jap</guid>
      <description>&lt;p&gt;I'm new here and I'm learning programming. I want to share with you my new knowledge about programming and get to know your opinions. Thank you very much for your understanding! &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>css</category>
      <category>html</category>
    </item>
    <item>
      <title>Hi!</title>
      <dc:creator>damanita</dc:creator>
      <pubDate>Thu, 26 May 2022 22:14:20 +0000</pubDate>
      <link>https://dev.to/damanita/hi-1c8f</link>
      <guid>https://dev.to/damanita/hi-1c8f</guid>
      <description></description>
    </item>
  </channel>
</rss>
