<?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: Karthik PM</title>
    <description>The latest articles on DEV Community by Karthik PM (@karthik52).</description>
    <link>https://dev.to/karthik52</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%2F822607%2F4026042c-a2a7-4412-9ed0-5eb4fb2868cd.png</url>
      <title>DEV Community: Karthik PM</title>
      <link>https://dev.to/karthik52</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karthik52"/>
    <language>en</language>
    <item>
      <title>Making a game in python after my first sem of basic python programing course</title>
      <dc:creator>Karthik PM</dc:creator>
      <pubDate>Sun, 27 Feb 2022 17:27:00 +0000</pubDate>
      <link>https://dev.to/karthik52/my-first-game-in-python-after-my-first-sem-of-basic-python-programing-course-4np2</link>
      <guid>https://dev.to/karthik52/my-first-game-in-python-after-my-first-sem-of-basic-python-programing-course-4np2</guid>
      <description>&lt;p&gt;code of the project:&lt;a href="https://dev.toclick%20here"&gt; https://github.com/Karthik-PM/MyProjects/tree/main/Blasteroids&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;well this project was my first python project and I made this game at the end of my first year of college with the basic knowledge I gained from a basic intro python class in my first semester of university , now this a simple 2D game where there is a rocket and some objects and the rocket shoots those objects and if I have enough points then I can move to the next round.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Vz53u6HP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s73p31yaec0e3c34uur6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Vz53u6HP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s73p31yaec0e3c34uur6.png" alt="Image description" width="800" height="478"&gt;&lt;/a&gt;&lt;br&gt;
now how did I make this .&lt;br&gt;
first of all I got to know about a library know as pygame through my professor at university.&lt;/p&gt;

&lt;p&gt;step by step process of how I made this game:&lt;/p&gt;

&lt;p&gt;first of all as a beginner in coding I was intimidated by coding it self lol (crying in pain TvT) &lt;/p&gt;

&lt;p&gt;so first I learned how to create a game loop , now as we know that our game must play until it game over , so you need to use a continuous while loop where the loop only breaks if you press the close button or exit.&lt;/p&gt;

&lt;p&gt;now after I created a game loop I got to know about various functions in the library , like how to store pictures in variables (its know also known assets).&lt;/p&gt;

&lt;p&gt;then Imported lot of images like space ship, meteoroids and a bomb which when hit will be game over.&lt;br&gt;
then I found about a file in pygame library where I can import music and I added that.&lt;br&gt;
 after thats done it looked like a decent game I played and I showed it to my mom (and she was like its so dull , give it more levels and stuff)&lt;/p&gt;

&lt;p&gt;so I made my first progress as level one &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1nEwjZfJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfd6o4b9qcj8opyvktsn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1nEwjZfJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gfd6o4b9qcj8opyvktsn.png" alt="Image description" width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;then I decided to make level to so i set a Hight score system in the game using the file I/O concept in python (which i didn't learn in my python course , got it through googling stuff like how to store permanent values in python or something lol .&lt;br&gt;
so i store the value of the current score in a notepad and then retrieve it and convert it to an integer and put a comparison that if the score reaches above a highscore it will make a sound saying high score and if the point moves about a certain value that means it has leveled up and then i change its backround image and then slowly build up my game and this is my end result&lt;br&gt;
&lt;a href="https://twitter.com/Karthik36906306/status/1438865061590700043"&gt;https://twitter.com/Karthik36906306/status/1438865061590700043&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;so if you are a fresher like me and have some gotten some basic idea of python i recommend you to do this project.&lt;/p&gt;

&lt;p&gt;so first before you start you need to have the pygame library so &lt;br&gt;
first of all you need to download pip (use this link &lt;a href="https://pypi.org/project/pip/"&gt;https://pypi.org/project/pip/&lt;/a&gt;)&lt;br&gt;
and then use that to download your python libraries in your terminal type &lt;/p&gt;

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

&lt;p&gt;basic things to learn after you have everthing to start using pygame:&lt;br&gt;
1) learn to make a game loop&lt;br&gt;
2) learn to store sprites in variables&lt;br&gt;
3) learn to play music in the game&lt;br&gt;
4) how to set backround&lt;br&gt;
5) how to make multiple frames &lt;br&gt;
if you guys learn this you will have something to start with and rest you guys have google , search for every doubts its very usefull.&lt;/p&gt;

</description>
      <category>python</category>
      <category>beginners</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
