<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>lập &#8211; AnonyViet &#8211; English Version</title>
	<atom:link href="https://en.anonyviet.com/tag/lap/feed/" rel="self" type="application/rss+xml" />
	<link>https://en.anonyviet.com</link>
	<description>The most popular website for sharing information technology, computer networks, and security knowledge. Stay up to date with the hottest news and tips</description>
	<lastBuildDate>Thu, 02 Feb 2023 20:49:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>

<image>
	<url>https://en.anonyviet.com/wp-content/uploads/2023/01/cropped-ico-logo-75x75-1.png</url>
	<title>lập &#8211; AnonyViet &#8211; English Version</title>
	<link>https://en.anonyviet.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>[Lập trình Game] LESSON 0: Introduction to Godot and Installation</title>
		<link>https://en.anonyviet.com/lap-trinh-game-lesson-0-introduction-to-godot-and-installation/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-lesson-0-introduction-to-godot-and-installation/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 20:49:38 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Godot]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[Introduction]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Lesson]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8505</guid>

					<description><![CDATA[[LẬP TRÌNH GAME VỚI ANONYVIET] LESSON 0: Introduction to Godot and Installation. Join the channel Telegram of the AnonyViet 👉 Link 👈 Hello everyone, today Anonyviet will guide you to program 2D ​​games using Godot Engine. The first lesson is an introduction, from lesson 1 I will guide you to program 2D ​​games with Godot [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div id="ftwp-postcontent">
[LẬP TRÌNH GAME VỚI ANONYVIET]  LESSON 0: Introduction to Godot and Installation.</p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> of the <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<p><strong>Hello everyone, today Anonyviet will guide you to program 2D ​​games using Godot Engine.  The first lesson is an introduction, from lesson 1 I will guide you to program 2D ​​games with Godot Engine from basic to advanced.  It&#8217;s easy to name it (:D) call me DeathGM.</strong></p>
<p>I see that many of you have a passion for game programming but don&#8217;t know how to program, and then ask what is needed for game programmers, is it difficult, te le, .. So I decided to share my experience with you. friends to help those who do not know programming but have a passion for making games.</p>
<p>This is an open Game Engine, supporting many languages ​​such as: C++, C#, Python, Java but if you want to program with the above, you have to improve additional software and it&#8217;s difficult to install, I&#8217;ve been searching for a week and still don&#8217;t know how to install it. (@@) and users should decide to use its own language for programming and it&#8217;s a arduous process when the Tutorial is full of Western, Russian, Spanish, .. do, I swear to you When it comes to difficult parts, it hacks my brain and I don&#8217;t understand anything (:v)..Go to the main topic.</p>
<h2 id="ftoc-godot-engine" class="ftwp-heading"> GODOT ENGINE:</h2>
<p>-As for Godot programming is not difficult and easy, easier than unity and UE4 why?  For this reason:</p>
<h3 id="ftoc-uu-diem" class="ftwp-heading"><strong>Advantage:</strong></h3>
<p>+ Better structure.  Everything about sense is more Node than Unity system, simple Signals (don&#8217;t know how to explain this :v)</p>
<p>GDScript is easy to learn, and nothing more than necessary.  Also, having the editor built into the same window is great.</p>
<p>+ Great 2D support.  No weird flat 3D scene like Unity.</p>
<p>+ Small download, works on Linux.</p>
<p>+ Great documentation.</p>
<h3 id="ftoc-nhuoc-diem" class="ftwp-heading"><strong>Defect:</strong></h3>
<p>+ Limited use.  Few answers to questions/instructions.  Asset stores are few.</p>
<p>+ If working in a team will be disadvantageous.  If you make a team game, you should do it with Unity or UE4.</p>
<p>+ Weak graphics scaling.  If you want to modify the graphic realism of your game to any degree, then you will have to write that part yourself.</p>
<p>Just talking through the speakers, you can see more at <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fgodot-engine-game-engine-dang-de-lap-trinh-game-cho-nguoi-moi%2F" rel="noopener noreferrer" class="local-link">Godot Game Engine Introduction</a> For more details:</p>
<h2 id="ftoc-cai-dat" class="ftwp-heading"><strong>Setting</strong></h2>
<p>Now we will proceed with the installation.</p>
<p><strong>Step 1:</strong> No Page: <a target="_blank" href="https://en.anonyviet.com/next-link/?url=https%3A%2F%2Fgodotengine.org%2F" rel="noopener external nofollow" class="ext-link" onclick="this.target='_blank';">https://godotengine.org/</a> to download.  Current Version At The Time Of Writing Is <strong>3.1.2</strong></p>
<p><strong>Step 2:</strong> Download And Unzip</p>
<p>Download Open Up Click Wizad To Extract To Desktop Desktop</p>
<p><strong>Step 3:</strong> Open Up And Start Game Programming!</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fcai-dat-godotengine-1.jpg" rel="noopener" class="local-link"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-17569" src="https://anonyviet.com/wp-content/uploads/2020/02/cai-dat-godotengine-1.jpg" alt="install godotengine" width="587" height="357" srcset="https://anonyviet.com/wp-content/uploads/2020/02/cai-dat-godotengine-1.jpg 587w, https://anonyviet.com/wp-content/uploads/2020/02/cai-dat-godotengine-1-300x182.jpg 300w" sizes="(max-width: 587px) 100vw, 587px" title="[Lập trình Game]  LESSON 0: Introduction to Godot and Setup 10"/></a></p>
<p><strong>Scan:</strong> Find Your Project</p>
<p><strong>Import:</strong> Upload your Project</p>
<p><strong>New Project:</strong> Click to create Project Game.</p>
<p>-> Click <strong>New Project</strong>:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fcreate-new-project-1.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17570" src="https://anonyviet.com/wp-content/uploads/2020/02/create-new-project-1.jpg" alt="create new project" width="468" height="375" srcset="https://anonyviet.com/wp-content/uploads/2020/02/create-new-project-1.jpg 468w, https://anonyviet.com/wp-content/uploads/2020/02/create-new-project-1-300x240.jpg 300w" sizes="auto, (max-width: 468px) 100vw, 468px" title="[Lập trình Game]  LESSON 0: Introduction to Godot and Setup 11"/></a></p>
<ul>
<li><strong>Project Name:</strong> Project name (project that you work on)</li>
<li><strong>ProjectPath:</strong> Project save path</li>
<li><strong>Renderer:</strong> the graphics you choose to make the game</li>
</ul>
<p>Now Choose <strong>Address Path</strong> Then Click Game <strong>Create Folder</strong> at Project Name To Create</p>
<p>After clicking Create folder will be like this:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fcreate-folder-1.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17571" src="https://anonyviet.com/wp-content/uploads/2020/02/create-folder-1.jpg" alt="create folder" width="471" height="145" srcset="https://anonyviet.com/wp-content/uploads/2020/02/create-folder-1.jpg 471w, https://anonyviet.com/wp-content/uploads/2020/02/create-folder-1-300x92.jpg 300w" sizes="auto, (max-width: 471px) 100vw, 471px" title="[Lập trình Game]  LESSON 0: Introduction to Godot and Setup 12"/></a></p>
<p>Now your job is to use it!!</p>
<p>New in will display like this:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2FGodot-Engine-giao-dien-1.jpg" rel="noopener" class="local-link"><img alt="[Lập trình Game] LESSON 0: Introduction to Godot and Installation" title="[Lập trình Game] LESSON 0: Introduction to Godot and Installation" post-id="8505" fifu-featured="1" decoding="async" loading="lazy" class="aligncenter size-full wp-image-17572" src="https://anonyviet.com/wp-content/uploads/2020/02/Godot-Engine-giao-dien-1.jpg" alt="[Lập trình Game]  LESSON 0: Introduction to Godot and Installation 4" width="581" height="311" srcset="https://anonyviet.com/wp-content/uploads/2020/02/Godot-Engine-giao-dien-1.jpg 581w, https://anonyviet.com/wp-content/uploads/2020/02/Godot-Engine-giao-dien-1-300x161.jpg 300w" sizes="auto, (max-width: 581px) 100vw, 581px" title="[Lập trình Game]  LESSON 0: Introduction to Godot and Setup 13"/></a></p>
<p>You choose <strong>2D</strong> to make 2D Game!</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2F2d-1.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-17573 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/2d-1.jpg" alt="how to create games with Godot" width="481" height="284" srcset="https://anonyviet.com/wp-content/uploads/2020/02/2d-1.jpg 481w, https://anonyviet.com/wp-content/uploads/2020/02/2d-1-300x177.jpg 300w" sizes="auto, (max-width: 481px) 100vw, 481px" title="[Lập trình Game]  LESSON 0: Introduction to Godot and Setup 14"/></a></p>
<p>As for the above pictures, I will explain in the next video!.</p>
<p style="text-align: right;"><strong>DeathGM </strong></p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;17568&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-lesson-0-introduction-to-godot-and-installation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/02/Godot-Engine-giao-dien-1.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập trình Game] LESSON 1: Create moves for the character</title>
		<link>https://en.anonyviet.com/lap-trinh-game-lesson-1-create-moves-for-the-character/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-lesson-1-create-moves-for-the-character/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 20:00:41 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Lesson]]></category>
		<category><![CDATA[moves]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8490</guid>

					<description><![CDATA[Okay, and welcome to the series Game programming with Godot Engine 3.2 and today I will guide you to move up, down, left, right for my first character. Join the channel Telegram belong to AnonyViet 👉 Link 👈 Character creation First we open the software. You pay attention in Section scene This is where you [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div id="ftwp-postcontent">
<p>Okay, and welcome to the series <strong>Game programming with Godot Engine 3.2</strong> and today I will guide you to move up, down, left, right for my first character.</p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> belong to <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<h2 id="ftoc-tao-nhan-vat" class="ftwp-heading">Character creation</h2>
<p>First we open the software.  You pay attention in Section <strong>scene</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fscence.jpg" rel="noopener" class="local-link"><img decoding="async" class="aligncenter wp-image-17604 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/scence.jpg" alt="scene" width="298" height="218" title="[Lập trình Game]  LESSON 1: Create moves for the character 24"/></a></p>
<p>This is where you will implement your Node.  View Posts <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fgodot-engine-game-engine-dang-de-lap-trinh-game-cho-nguoi-moi%2F" rel="noopener noreferrer" class="local-link">What are Nodes?</a>?</p>
<p>Here you can choose <strong>Other Node</strong> Or <strong>2D sense</strong> all okay.  This article I choose <strong>Other Node</strong></p>
<p>Once created, it will appear below, and I renamed it <strong>World</strong>:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fnode-world.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17605" src="https://anonyviet.com/wp-content/uploads/2020/02/node-world.jpg" alt="[Lập trình Game]  LESSON 1: Create moves for the character 12" width="557" height="130" srcset="https://anonyviet.com/wp-content/uploads/2020/02/node-world.jpg 557w, https://anonyviet.com/wp-content/uploads/2020/02/node-world-300x70.jpg 300w" sizes="auto, (max-width: 557px) 100vw, 557px" title="[Lập trình Game]  LESSON 1: Create a move for the character 25"/></a></p>
<p>Next, press the sign<strong> +</strong> or press the combination <strong>Ctrl + A</strong> to create a new Node under World</p>
<p>And you find <strong>KinematicBody2D</strong> for myself:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fcreate-new-node.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17606" src="https://anonyviet.com/wp-content/uploads/2020/02/create-new-node.jpg" alt="[Lập trình Game]  LESSON 1: Create moves for the character 13" width="623" height="404" srcset="https://anonyviet.com/wp-content/uploads/2020/02/create-new-node.jpg 623w, https://anonyviet.com/wp-content/uploads/2020/02/create-new-node-300x195.jpg 300w" sizes="auto, (max-width: 623px) 100vw, 623px" title="[Lập trình Game]  LESSON 1: Create moves for the character 26"/></a></p>
<p>Then stay <strong>KinematicBody2D</strong> select <span style="color: #3366ff;"><strong>CollsionShape2D</strong> </span>and <span style="color: #3366ff;"><strong>Sprite</strong> </span>Please</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2FKinematicBody2D.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-17607 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/KinematicBody2D.jpg" alt="KinematicBody2D" width="246" height="192" title="[Lập trình Game]  LESSON 1: Create moves for the character 27"/></a></p>
<p>And here after creating, you have <strong>1 Moving Characters</strong> Basic can be anything (main character, enemy,..)</p>
<p><strong>KinematicBody2D:</strong> Means Kinetic Body (used to create object like a character)</p>
<p><strong>Sprites:</strong> Use to create your character&#8217;s photo</p>
<p><strong>CollsionShape2D:</strong> Collision shape (used to determine where to collide with another object)</p>
<p>In the <strong>sprite</strong> you click and drag <strong>icon.png</strong> or any other image you want to use as a character, drag into the texture.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fkeo-icon.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-17608 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/keo-icon.jpg" alt="drag icon.png" width="624" height="291" srcset="https://anonyviet.com/wp-content/uploads/2020/02/keo-icon.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/02/keo-icon-300x140.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập trình Game]  LESSON 1: Create moves for the character 28"/></a></p>
<p>And here it appeared:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fxuat-hien-nhan-vat.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17609" src="https://anonyviet.com/wp-content/uploads/2020/02/xuat-hien-nhan-vat.jpg" alt="[Lập trình Game]  LESSON 1: Create moves for the character 14" width="399" height="258" srcset="https://anonyviet.com/wp-content/uploads/2020/02/xuat-hien-nhan-vat.jpg 399w, https://anonyviet.com/wp-content/uploads/2020/02/xuat-hien-nhan-vat-300x194.jpg 300w" sizes="auto, (max-width: 399px) 100vw, 399px" title="[Lập trình Game]  LESSON 1: Create moves for the character 29"/></a></p>
<p>Next click on <strong>CollsionShape 2D</strong> and stay <strong>Inspector</strong> select<strong> Shape > New RectangleShape2D</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2FNew-RectangleShape2D.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17610" src="https://anonyviet.com/wp-content/uploads/2020/02/New-RectangleShape2D.jpg" alt="[Lập trình Game]  LESSON 1: Create a movement for the character 15" width="625" height="203" srcset="https://anonyviet.com/wp-content/uploads/2020/02/New-RectangleShape2D.jpg 625w, https://anonyviet.com/wp-content/uploads/2020/02/New-RectangleShape2D-300x97.jpg 300w" sizes="auto, (max-width: 625px) 100vw, 625px" title="[Lập trình Game]  LESSON 1: Create moves for the character 30"/></a></p>
<p>At the character&#8217;s face interface, you <strong>drag the dot on the blue line and the red dot on the purple line so that it is equal to the sprite</strong>.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fkeo-dau-cham.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17611" src="https://anonyviet.com/wp-content/uploads/2020/02/keo-dau-cham.jpg" alt="[Lập trình Game]  LESSON 1: Create moves for the character 16" width="631" height="239" srcset="https://anonyviet.com/wp-content/uploads/2020/02/keo-dau-cham.jpg 631w, https://anonyviet.com/wp-content/uploads/2020/02/keo-dau-cham-300x114.jpg 300w" sizes="auto, (max-width: 631px) 100vw, 631px" title="[Lập trình Game]  LESSON 1: Create moves for the character 31"/></a></p>
<h2 id="ftoc-code-cho-nhan-vat-di-chuyen" class="ftwp-heading">Code for the character to move</h2>
<p>So that&#8217;s it <strong>Finished character creation</strong> Next is Code.</p>
<p>You click <strong>KinematicBody2D</strong> and choose for yourself as the image to create the script:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Ftao-script.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17612" src="https://anonyviet.com/wp-content/uploads/2020/02/tao-script.jpg" alt="create scripts" width="312" height="227" srcset="https://anonyviet.com/wp-content/uploads/2020/02/tao-script.jpg 312w, https://anonyviet.com/wp-content/uploads/2020/02/tao-script-300x218.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/02/tao-script-120x86.jpg 120w" sizes="auto, (max-width: 312px) 100vw, 312px" title="[Lập trình Game]  LESSON 1: Create moves for the character 32"/></a></p>
<p><em><strong>Script:</strong></em> <em>Where you will code and that code will apply to run the game and your character</em></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fattach-node-script.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17613" src="https://anonyviet.com/wp-content/uploads/2020/02/attach-node-script.jpg" alt="attach node script" width="375" height="327" srcset="https://anonyviet.com/wp-content/uploads/2020/02/attach-node-script.jpg 375w, https://anonyviet.com/wp-content/uploads/2020/02/attach-node-script-300x262.jpg 300w" sizes="auto, (max-width: 375px) 100vw, 375px" title="[Lập trình Game]  LESSON 1: Create moves for the character 33"/></a></p>
<ul>
<li>Language: The language used for programming</li>
<li>Path: Path to save</li>
<li>Load: Create scripts</li>
</ul>
<p>And press <strong>Load</strong>.</p>
<p>After clicking Load, the interface of the Code writing page will appear <strong>delete all content from line 4 to line 17</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fgiao-dien-code.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17614" src="https://anonyviet.com/wp-content/uploads/2020/02/giao-dien-code.jpg" alt="code interface" width="623" height="158" srcset="https://anonyviet.com/wp-content/uploads/2020/02/giao-dien-code.jpg 623w, https://anonyviet.com/wp-content/uploads/2020/02/giao-dien-code-300x76.jpg 300w" sizes="auto, (max-width: 623px) 100vw, 623px" title="[Lập trình Game]  LESSON 1: Create moves for the character 34"/></a></p>
<h3 id="ftoc-khai-bao-bien" class="ftwp-heading">Declare variable</h3>
<p>Type yourself a code that declares a variable as follows:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fkhai-bao-bien.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17615" src="https://anonyviet.com/wp-content/uploads/2020/02/khai-bao-bien.jpg" alt="[Lập trình Game]  LESSON 1: Create moves for the character 17" width="379" height="221" srcset="https://anonyviet.com/wp-content/uploads/2020/02/khai-bao-bien.jpg 379w, https://anonyviet.com/wp-content/uploads/2020/02/khai-bao-bien-300x175.jpg 300w" sizes="auto, (max-width: 379px) 100vw, 379px" title="[Lập trình Game]  LESSON 1: Create a move for the character 35"/></a></p>
<p>Anyone who has programmed, knows how to declare a variable. ^^ It&#8217;s basic and for those who don&#8217;t know, I&#8217;ll explain as follows:</p>
<p><strong>var:</strong> declare a variable to use it.  VD: <em>var tocdodichuyen</em>, <em>var ketqua</em>, <em>var huongdichuyen</em></p>
<p>So what is var conversion = Vector2() where Vector2() is ?</p>
<p>Vector2(): is a variable used for math in 2D and in math, you know the x, y coordinate axes, &#8230;</p>
<p>in here:</p>
<ul>
<li>x = horizontal movement</li>
<li>y= straight motion</li>
<li>func _physics_process is a physical process i.e. kinematicbody2D</li>
<li>func _ready is process ready: when you declare a variable in ready it will be preloaded when the game loads</li>
</ul>
<p>In physics_process, you also declare a variable as above, but it is loaded when it moves</p>
<p>pass: yes or no</p>
<h3 id="ftoc-code-chuyen-dong" class="ftwp-heading">Motion code</h3>
<p>Code for me the following part.  Here is the code <strong>right and left movement</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fcode-chuyen-dong.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17616" src="https://anonyviet.com/wp-content/uploads/2020/02/code-chuyen-dong.jpg" alt="motion code" width="401" height="343" srcset="https://anonyviet.com/wp-content/uploads/2020/02/code-chuyen-dong.jpg 401w, https://anonyviet.com/wp-content/uploads/2020/02/code-chuyen-dong-300x257.jpg 300w" sizes="auto, (max-width: 401px) 100vw, 401px" title="[Lập trình Game]  LESSON 1: Create moves for the character 36"/></a></p>
<p>Here I will explain the passage <strong>if . statement</strong> Please.  Who has learned programming, the if statement is no longer difficult</p>
<p><strong>if input.is_action_pressed(“ui_right”):</strong> is: when you press right arrow key it will move right And vice versa with  <strong>elif</strong> is to the left and <strong>else</strong>: is that it will stay still after moving.</p>
<p><strong>move_and_slide</strong> (move and glide): make your character move</p>
<p>Press <strong>F5</strong> or <strong>F6</strong> for a test run.</p>
<p><strong>F5</strong>: run default scene</p>
<p><strong>F6:</strong> run the scene being edited.  VD: <span style="color: #3366ff;">worldnumberone</span> is the default scene and <span style="color: #339966;">worldnumbervietnam</span> is the scene being edited.  When pressing F5 even in the scene <span style="color: #339966;">worldnumbervietnam</span> then it will run <span style="color: #3366ff;">worldnumeberone</span> if press F6 it will run <span style="color: #339966;">worldnumbervietnam</span> without running <span style="color: #3366ff;">worldnumeberone</span> )</p>
<p>If it is like this, you can edit it:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fchay-loi.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17617" src="https://anonyviet.com/wp-content/uploads/2020/02/chay-loi.jpg" alt="run error" width="311" height="180" srcset="https://anonyviet.com/wp-content/uploads/2020/02/chay-loi.jpg 311w, https://anonyviet.com/wp-content/uploads/2020/02/chay-loi-300x174.jpg 300w" sizes="auto, (max-width: 311px) 100vw, 311px" title="[Lập trình Game]  LESSON 1: Create moves for the character 37"/></a></p>
<p>Click as picture:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fsua-loi.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17618" src="https://anonyviet.com/wp-content/uploads/2020/02/sua-loi.jpg" alt="[Lập trình Game]  LESSON 1: Create moves for the character 18" width="546" height="203" srcset="https://anonyviet.com/wp-content/uploads/2020/02/sua-loi.jpg 546w, https://anonyviet.com/wp-content/uploads/2020/02/sua-loi-300x112.jpg 300w" sizes="auto, (max-width: 546px) 100vw, 546px" title="[Lập trình Game]  LESSON 1: Create moves for the character 38"/></a></p>
<p>We get as picture:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fo-khoa.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-17619 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/o-khoa.jpg" alt="move lock" width="322" height="193" srcset="https://anonyviet.com/wp-content/uploads/2020/02/o-khoa.jpg 322w, https://anonyviet.com/wp-content/uploads/2020/02/o-khoa-300x180.jpg 300w" sizes="auto, (max-width: 322px) 100vw, 322px" title="[Lập trình Game]  LESSON 1: Create moves for the character 39"/></a></p>
<p>When you press this it will help you <strong>fix the components inside it.</strong></p>
<p>And if you press the lock it will <strong>node lock</strong> back on the screen can&#8217;t move nor can&#8217;t press</p>
<p>Then we drag it to the middle:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fkeo-ra-giua.jpg" rel="noopener" class="local-link"><img alt="[Lập trình Game] LESSON 1: Create moves for the character" title="[Lập trình Game] LESSON 1: Create moves for the character" post-id="8490" fifu-featured="1" decoding="async" loading="lazy" class="aligncenter size-full wp-image-17620" src="https://anonyviet.com/wp-content/uploads/2020/02/keo-ra-giua.jpg" alt="[Lập trình Game]  LESSON 1: Creating moves for the character 19" width="593" height="316" srcset="https://anonyviet.com/wp-content/uploads/2020/02/keo-ra-giua.jpg 593w, https://anonyviet.com/wp-content/uploads/2020/02/keo-ra-giua-300x160.jpg 300w" sizes="auto, (max-width: 593px) 100vw, 593px" title="[Lập trình Game]  LESSON 1: Create a move for the character 40"/></a></p>
<p>Okay like this, you press the right and left arrows to see it move:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fxem-chuyen-dong-trai-phai.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17621" src="https://anonyviet.com/wp-content/uploads/2020/02/xem-chuyen-dong-trai-phai.jpg" alt="watch left-right movement" width="624" height="229" srcset="https://anonyviet.com/wp-content/uploads/2020/02/xem-chuyen-dong-trai-phai.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/02/xem-chuyen-dong-trai-phai-300x110.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập trình Game]  LESSON 1: Create moves for the character 41"/></a></p>
<p>If you want <strong>up and down movement</strong> then the code is as follows:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fchuyen-dong-len-xuong.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17622" src="https://anonyviet.com/wp-content/uploads/2020/02/chuyen-dong-len-xuong.jpg" alt="[Lập trình Game]  LESSON 1: Create a move for the character 20" width="462" height="325" srcset="https://anonyviet.com/wp-content/uploads/2020/02/chuyen-dong-len-xuong.jpg 462w, https://anonyviet.com/wp-content/uploads/2020/02/chuyen-dong-len-xuong-300x211.jpg 300w" sizes="auto, (max-width: 462px) 100vw, 462px" title="[Lập trình Game]  LESSON 1: Create moves for the character 42"/></a></p>
<p>And I have instructed you to program a basic character, then the next lesson will be about: Friction force after running, Gravity, Jumping, Ground.</p>
<p>Goodbye and see you in the next post.</p>
<p style="text-align: right;"><strong>DeathGM!</strong></p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;17603&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-lesson-1-create-moves-for-the-character/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/02/keo-ra-giua.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập Trình Game] Lesson 2: Gravity, moving surfaces and jumping</title>
		<link>https://en.anonyviet.com/lap-trinh-game-lesson-2-gravity-moving-surfaces-and-jumping/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-lesson-2-gravity-moving-surfaces-and-jumping/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 18:34:39 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[Gravity]]></category>
		<category><![CDATA[jumping]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Lesson]]></category>
		<category><![CDATA[moving]]></category>
		<category><![CDATA[surfaces]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8463</guid>

					<description><![CDATA[Next with the series of game programming with godot today I will guide you to the next lesson that is Gravity, Moving Surface and Jumping. Join the channel Telegram belong to AnonyViet 👉 Link 👈 Well before you do, if you want to reopen the sence you&#8217;re working on now, look under the FileSystem section [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div id="ftwp-postcontent">
<p><strong>Next with the series of game programming with godot today I will guide you to the next lesson that is Gravity, Moving Surface and Jumping.</strong></p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> belong to <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Well before you do, if you want to reopen the sence you&#8217;re working on now, look under the FileSystem section and double click on the sence you saved before and yours is saved here. <strong>World.tscn</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fworld.tscn_.jpg" rel="noopener" class="local-link"><img decoding="async" class="aligncenter size-full wp-image-17724" src="https://anonyviet.com/wp-content/uploads/2020/02/world.tscn_.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 34" width="327" height="318" srcset="https://anonyviet.com/wp-content/uploads/2020/02/world.tscn_.jpg 327w, https://anonyviet.com/wp-content/uploads/2020/02/world.tscn_-300x292.jpg 300w" sizes="(max-width: 327px) 100vw, 327px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 36"/></a></p>
<p><strong>Moving Surface:</strong> The moving surface is the part that we let our character move on it can be said to be like the road surface for us humans to walk on.</p>
<p>To create a surface, you do as I do and this is just the basics of the basics, if you want to create a moving surface like other games, it&#8217;s called <strong>tilemap</strong> and <strong>tileset</strong> I will guide you in the following article:</p>
<p>Create Node <strong>StaticBody2D</strong> under the authority of World</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fcreate-new-node-1.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17725" src="https://anonyviet.com/wp-content/uploads/2020/02/create-new-node-1.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 35" width="517" height="386" srcset="https://anonyviet.com/wp-content/uploads/2020/02/create-new-node-1.jpg 517w, https://anonyviet.com/wp-content/uploads/2020/02/create-new-node-1-300x224.jpg 300w" sizes="auto, (max-width: 517px) 100vw, 517px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 37"/></a></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2FStaticBody2D.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17726" src="https://anonyviet.com/wp-content/uploads/2020/02/StaticBody2D.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 36" width="246" height="205" title="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 38"/></a></p>
<p>LIVE <strong>StaticBody</strong> I will change my name back to <strong>floor</strong> (double click to change the name) and I changed the name too <strong>KinematicBody</strong> Fort <strong>Player</strong> Please.</p>
<p>And also in <strong>Node Player</strong> i will create <strong>2 Nodes </strong>To be <strong>Sprite</strong>: the photo for <strong>floor</strong> and <strong>Collsion</strong></p>
<p><strong>Collsion</strong> It is very difficult to explain here, so I will briefly explain it for you to understand.  VD:</p>
<p>When you create a sprite without <strong>collsion</strong> then it&#8217;s just an image, a painted image.  If you create <strong>1 sprite + collection</strong> then it means it&#8217;s like if you press a bag of balls against the wall with your hand, it will collapse, that&#8217;s when there is no <strong>collsion</strong> and when there is collsion it is like inside the ball bag there is a brick then when you press the ball bag there is a brick you cannot squeeze it because the brick it is hard.  Generally speaking<strong> sprite is the skin</strong> still<strong> collsion is bone</strong> in that skin.</p>
<p>Or you can understand <strong>collection is the frame</strong> to prevent the inner part for the sprite to work</p>
<p>Here <strong>StaticBody2D</strong> used for physical movement if you want to build a trap, bridge, something stationary or moving as an obstacle, use <strong>StaticBody2D</strong>.</p>
<p>Then you do the same<a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Flap-trinh-game-bai-1-tao-di-chuyen-cho-nhan-vat%2F" rel="noopener noreferrer" class="local-link"><strong>  Lesson 1</strong></a>  with Node player like this:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2FNode-player.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17727" src="https://anonyviet.com/wp-content/uploads/2020/02/Node-player.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 37" width="733" height="341" srcset="https://anonyviet.com/wp-content/uploads/2020/02/Node-player.jpg 733w, https://anonyviet.com/wp-content/uploads/2020/02/Node-player-300x140.jpg 300w" sizes="auto, (max-width: 733px) 100vw, 733px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 39"/></a></p>
<p>I will not give specific instructions, but you have to remember each post to go up.</p>
<p>On the floor, click on the sprite to notice the right part below the CanvasItem, then click on it<strong> Visiable > select Modulate</strong> and change the color to any color.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fmau.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17728" src="https://anonyviet.com/wp-content/uploads/2020/02/mau.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 38" width="585" height="299" srcset="https://anonyviet.com/wp-content/uploads/2020/02/mau.jpg 585w, https://anonyviet.com/wp-content/uploads/2020/02/mau-300x153.jpg 300w" sizes="auto, (max-width: 585px) 100vw, 585px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surface and 40 . jump"/></a></p>
<p>Here I change to <strong>black</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fmau-den.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17729" src="https://anonyviet.com/wp-content/uploads/2020/02/mau-den.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 39" width="346" height="186" srcset="https://anonyviet.com/wp-content/uploads/2020/02/mau-den.jpg 346w, https://anonyviet.com/wp-content/uploads/2020/02/mau-den-300x161.jpg 300w" sizes="auto, (max-width: 346px) 100vw, 346px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 41"/></a></p>
<p>And as the photo above you can see that <strong>sprite changed to black</strong>n but what <strong>collsion</strong> it&#8217;s on top again <strong>sprite</strong> then you change positions <strong>collsion</strong> go up <strong>sprite</strong> or click<strong> the eye on the right collsion </strong>to hide it and when hidden you don&#8217;t need to worry because it just hides and doesn&#8217;t do anything.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fan.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17730" src="https://anonyviet.com/wp-content/uploads/2020/02/an.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surface and 40 . jump" width="426" height="237" srcset="https://anonyviet.com/wp-content/uploads/2020/02/an.jpg 426w, https://anonyviet.com/wp-content/uploads/2020/02/an-300x167.jpg 300w" sizes="auto, (max-width: 426px) 100vw, 426px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 42"/></a> <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fan-mau.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17731" src="https://anonyviet.com/wp-content/uploads/2020/02/an-mau.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 41" width="332" height="189" srcset="https://anonyviet.com/wp-content/uploads/2020/02/an-mau.jpg 332w, https://anonyviet.com/wp-content/uploads/2020/02/an-mau-300x171.jpg 300w" sizes="auto, (max-width: 332px) 100vw, 332px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 43"/></a></p>
<p>And you lock it up like <strong>Node Player</strong>:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fkhoa-node.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17732" src="https://anonyviet.com/wp-content/uploads/2020/02/khoa-node.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 42" width="241" height="175" srcset="https://anonyviet.com/wp-content/uploads/2020/02/khoa-node.jpg 241w, https://anonyviet.com/wp-content/uploads/2020/02/khoa-node-120x86.jpg 120w" sizes="auto, (max-width: 241px) 100vw, 241px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 44"/></a></p>
<p>Well at the end of the post I will leave the zoom buttons with the keyboard for those of you who use a laptop without a mouse or a damaged mouse scroll button like me.</p>
<p>And choose <strong>floor</strong> You guys notice for me the 2 parts I&#8217;ve circled in the picture</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fchon-khoa.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17733" src="https://anonyviet.com/wp-content/uploads/2020/02/chon-khoa.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 43" width="446" height="184" srcset="https://anonyviet.com/wp-content/uploads/2020/02/chon-khoa.jpg 446w, https://anonyviet.com/wp-content/uploads/2020/02/chon-khoa-300x124.jpg 300w" sizes="auto, (max-width: 446px) 100vw, 446px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 45"/></a></p>
<p>The side <strong>dark white fruit</strong> is that it displays the grid (squares like pixels).</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fluoi.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17734" src="https://anonyviet.com/wp-content/uploads/2020/02/luoi.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 44" width="322" height="229" srcset="https://anonyviet.com/wp-content/uploads/2020/02/luoi.jpg 322w, https://anonyviet.com/wp-content/uploads/2020/02/luoi-300x213.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/02/luoi-120x86.jpg 120w" sizes="auto, (max-width: 322px) 100vw, 322px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 46"/></a></p>
<p>This grid is a bit small here, so I&#8217;ll zoom in</p>
<p>To zoom in, press the 3 dots next to it:<a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fdau-3-cham.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17735" src="https://anonyviet.com/wp-content/uploads/2020/02/dau-3-cham.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 45" width="283" height="237" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 47"/></a></p>
<p>Choose the last one <strong>Configure Snaps. </strong>Change <strong>Grid Step</strong> Fort <strong>32-32</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Ftang-luoi.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17736" src="https://anonyviet.com/wp-content/uploads/2020/02/tang-luoi.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 46" width="286" height="294" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 48"/></a></p>
<p>And it looks like the picture:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Ftang-luoi-to.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17737" src="https://anonyviet.com/wp-content/uploads/2020/02/tang-luoi-to.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 47" width="387" height="253" srcset="https://anonyviet.com/wp-content/uploads/2020/02/tang-luoi-to.jpg 387w, https://anonyviet.com/wp-content/uploads/2020/02/tang-luoi-to-300x196.jpg 300w" sizes="auto, (max-width: 387px) 100vw, 387px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 49"/></a></p>
<p>You can move the floor but you can see that it is not in the correct box so Godot gave us one more function that is <strong>move in pixels.</strong></p>
<p>On the one next to the one<strong> turn on pixels</strong> you click on floor and then turn it on:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fchuyen-px.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17738" src="https://anonyviet.com/wp-content/uploads/2020/02/chuyen-px.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 48" width="166" height="77" title="[Lập Trình Game]  Lesson 2: Gravity, moving surface and 50 . jump"/></a></p>
<p>Then our floor will move in pixels</p>
<p>And you put it down to make the floor move</p>
<p>Below the picture, if you pay close attention, you will see a blue umbrella, that umbrella is our screen, remember to put the floor inside this box.</p>
<p>Here I create more 1 <strong>the Node name</strong> <strong>is wall</strong> and there contains floor and <strong>floor I changed to 01</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fwall.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17739" src="https://anonyviet.com/wp-content/uploads/2020/02/wall.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 49" width="321" height="256" srcset="https://anonyviet.com/wp-content/uploads/2020/02/wall.jpg 321w, https://anonyviet.com/wp-content/uploads/2020/02/wall-300x239.jpg 300w" sizes="auto, (max-width: 321px) 100vw, 321px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 51"/></a></p>
<p>You set the location for <strong>floor</strong> then click on the <strong>01</strong> press combination <strong>Ctrl + EASY</strong> it will be duplicated and in the place of floor 01, you can pull it out if you don&#8217;t understand, look at the picture:</p>
<p>Doubled</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fnhan-doi.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17740" src="https://anonyviet.com/wp-content/uploads/2020/02/nhan-doi.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surface and 50 . jump" width="495" height="323" srcset="https://anonyviet.com/wp-content/uploads/2020/02/nhan-doi.jpg 495w, https://anonyviet.com/wp-content/uploads/2020/02/nhan-doi-300x196.jpg 300w" sizes="auto, (max-width: 495px) 100vw, 495px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 52"/></a></p>
<p>Now pull out</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fkeo-ra.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17741" src="https://anonyviet.com/wp-content/uploads/2020/02/keo-ra.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 51" width="498" height="267" srcset="https://anonyviet.com/wp-content/uploads/2020/02/keo-ra.jpg 498w, https://anonyviet.com/wp-content/uploads/2020/02/keo-ra-300x161.jpg 300w" sizes="auto, (max-width: 498px) 100vw, 498px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 53"/></a></p>
<p>It will come out 2</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2F2-cai.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17742" src="https://anonyviet.com/wp-content/uploads/2020/02/2-cai.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 52" width="319" height="180" srcset="https://anonyviet.com/wp-content/uploads/2020/02/2-cai.jpg 319w, https://anonyviet.com/wp-content/uploads/2020/02/2-cai-300x169.jpg 300w" sizes="auto, (max-width: 319px) 100vw, 319px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 54"/></a></p>
<p>So with 2 you can do it continuously to create a longer moving floor</p>
<p>But before creating the floor, you need to check if the collsion is equal or not to check if you turn on the collsion of 01 and 02.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fnhan-doi-lon.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17743" src="https://anonyviet.com/wp-content/uploads/2020/02/nhan-doi-lon.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 53" width="375" height="210" srcset="https://anonyviet.com/wp-content/uploads/2020/02/nhan-doi-lon.jpg 375w, https://anonyviet.com/wp-content/uploads/2020/02/nhan-doi-lon-300x168.jpg 300w" sizes="auto, (max-width: 375px) 100vw, 375px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 55"/></a></p>
<p>Like mine, it&#8217;s not very tight but the player still moves well.  If yours is skewed, adjust it to be flat.</p>
<p>Now create multiple ones,</p>
<p>I have created it:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Ftao-ra-nhieu-cai.jpg" rel="noopener" class="local-link"><img alt="[Lập Trình Game] Lesson 2: Gravity, moving surfaces and jumping" title="[Lập Trình Game] Lesson 2: Gravity, moving surfaces and jumping" post-id="8463" fifu-featured="1" decoding="async" loading="lazy" class="aligncenter size-full wp-image-17744" src="https://anonyviet.com/wp-content/uploads/2020/02/tao-ra-nhieu-cai.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 54" width="497" height="234" srcset="https://anonyviet.com/wp-content/uploads/2020/02/tao-ra-nhieu-cai.jpg 497w, https://anonyviet.com/wp-content/uploads/2020/02/tao-ra-nhieu-cai-300x141.jpg 300w" sizes="auto, (max-width: 497px) 100vw, 497px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 56"/></a>Run the program and you will see something like this:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fchay-chuong-trinh.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17745" src="https://anonyviet.com/wp-content/uploads/2020/02/chay-chuong-trinh.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surface and jumping 55" width="476" height="291" srcset="https://anonyviet.com/wp-content/uploads/2020/02/chay-chuong-trinh.jpg 476w, https://anonyviet.com/wp-content/uploads/2020/02/chay-chuong-trinh-300x183.jpg 300w" sizes="auto, (max-width: 476px) 100vw, 476px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 57"/></a></p>
<p>Does it look pretty bad?  But don&#8217;t worry you only learn the basics to do it and this is just a tutorial, but the first lesson will guide you to create 1 player and a complete tilemap and background, enemy too. .</p>
<p>You can move it down and it will be blocked by the floor</p>
<p>And that&#8217;s it, you have created the Moving Surface, followed by Gravity.</p>
<h2 id="ftoc-trong-luc" class="ftwp-heading"><strong>Gravitation:</strong></h2>
<p>When it comes to gravity, who doesn&#8217;t know 😀 the thing that helps us move easily.</p>
<p>To create gravity, you go to the player&#8217;s script.</p>
<p>Declare variable:</p>
<p>Declare 1 more gravity variable set it equal to 20</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fkhai-bien.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17746" src="https://anonyviet.com/wp-content/uploads/2020/02/khai-bien.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 56" width="310" height="126" srcset="https://anonyviet.com/wp-content/uploads/2020/02/khai-bien.jpg 310w, https://anonyviet.com/wp-content/uploads/2020/02/khai-bien-300x122.jpg 300w" sizes="auto, (max-width: 310px) 100vw, 310px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 58"/></a>In physics code for me as follows</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fphysics-code.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17747" src="https://anonyviet.com/wp-content/uploads/2020/02/physics-code.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 57" width="378" height="144" srcset="https://anonyviet.com/wp-content/uploads/2020/02/physics-code.jpg 378w, https://anonyviet.com/wp-content/uploads/2020/02/physics-code-300x114.jpg 300w" sizes="auto, (max-width: 378px) 100vw, 378px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 59"/></a></p>
<p><strong>Chuyendong</strong> is what helps us move along the x, y coordinate axes: <strong>Y</strong> is down-up, <strong>X</strong> is right-left.</p>
<p>here <strong>chuyendong.y</strong> that is, use the variable to call the y-axis because when we declare <code>chuyendong = Vector2()</code> mean <strong>change</strong> allowed to use x, y axes and here we call y-axis moving down by transition|  chuyendong.y += tocdo means chuyendong.y = chuyendong + inluc</p>
<p>and it means when <strong>change</strong> y + axis with inluc is 20 then it will move down with 20 times gravity.</p>
<p>And run the game:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fchay-game-2.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17748" src="https://anonyviet.com/wp-content/uploads/2020/02/chay-game-2.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 58" width="585" height="360" srcset="https://anonyviet.com/wp-content/uploads/2020/02/chay-game-2.jpg 585w, https://anonyviet.com/wp-content/uploads/2020/02/chay-game-2-300x185.jpg 300w" sizes="auto, (max-width: 585px) 100vw, 585px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surface and 60 . jump"/></a></p>
<p>We will see it drop and its Floor Collsion is an obstacle for our player to prevent the player from falling.</p>
<p>If your migration is like mine:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fchuyen-dong.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17749" src="https://anonyviet.com/wp-content/uploads/2020/02/chuyen-dong.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 59" width="436" height="334" srcset="https://anonyviet.com/wp-content/uploads/2020/02/chuyen-dong.jpg 436w, https://anonyviet.com/wp-content/uploads/2020/02/chuyen-dong-300x230.jpg 300w" sizes="auto, (max-width: 436px) 100vw, 436px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 61"/></a></p>
<p>Then you won&#8217;t be able to move up when you press the up arrow</p>
<p>And next is dancing.</p>
<h2 id="ftoc-nhay" class="ftwp-heading"><strong>Dance</strong></h2>
<p>To Code the dance part, you will code like me.</p>
<p>Delete section <strong>if input up</strong> and <strong>if input down</strong> Go</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fnhay-1.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17750" src="https://anonyviet.com/wp-content/uploads/2020/02/nhay-1.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surface and 60 . jump" width="412" height="147" srcset="https://anonyviet.com/wp-content/uploads/2020/02/nhay-1.jpg 412w, https://anonyviet.com/wp-content/uploads/2020/02/nhay-1-300x107.jpg 300w" sizes="auto, (max-width: 412px) 100vw, 412px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 62"/></a></p>
<p>And change</p>
<p><code>if input ui_left thành &gt; elif input.is_action ui_left</code></p>
<p>And the code adds an else part:</p>
<p><code>else:</code></p>
<p>The x-axis motion is 0||  = 0 rather than += (I will write it like this for you to understand and code it and also improve your coding ability)</p>
<p>After the code you press F6 to run the game will see it can move right to left and after stopping moving will stand still.</p>
<p><strong>Next comes the jumping part.</strong></p>
<p>Declare yourself a variable as:</p>
<p><strong>Nhaycao</strong> and assign it with <strong>-500</strong></p>
<p>Why assign it with<strong> -500</strong> simply because when you create the gravity variable, our player will fall along the y-axis right?  So here we assign -500 so that it will move upwards against gravity when jumping to a certain height because inluc is always set to 20, so after jumping it will force your player down.</p>
<p>You declare yourself 1 more variable <code>UP = Vector2(0, -1)</code></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fnhay-2.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17751" src="https://anonyviet.com/wp-content/uploads/2020/02/nhay-2.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 61" width="273" height="140" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 63"/></a></p>
<p>Variable <strong>UP</strong> This is a variable that allows you to jump to 0, -1 ||  0 is the x-axis, -1 is the y-axis</p>
<p>Next, give me the code for the part like the picture:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fnhay-3.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17752" src="https://anonyviet.com/wp-content/uploads/2020/02/nhay-3.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 62" width="427" height="71" srcset="https://anonyviet.com/wp-content/uploads/2020/02/nhay-3.jpg 427w, https://anonyviet.com/wp-content/uploads/2020/02/nhay-3-300x50.jpg 300w" sizes="auto, (max-width: 427px) 100vw, 427px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 64"/></a></p>
<p><code>if is_on_floor</code>  which means when you are on the floor (the floor we created) and only when on the floor it can do it.</p>
<p><code>if input ui_up</code>  Well, if you read the previous posts, you already know</p>
<p><code> chuyendong.y += nhaycao</code>  To be: <strong>change</strong> call y-axis and assign it with variable <strong>haycao</strong> when you press the up arrow key And When assigning it jumps why?  Then I explained in the declaration of the variable nhaycao</p>
<p>Ah in the <strong>move_and_slide()</strong> more for me <strong>UP</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fnhay-4.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17753" src="https://anonyviet.com/wp-content/uploads/2020/02/nhay-4.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 63" width="363" height="31" srcset="https://anonyviet.com/wp-content/uploads/2020/02/nhay-4.jpg 363w, https://anonyviet.com/wp-content/uploads/2020/02/nhay-4-300x26.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/02/nhay-4-360x31.jpg 360w, https://anonyviet.com/wp-content/uploads/2020/02/nhay-4-350x31.jpg 350w" sizes="auto, (max-width: 363px) 100vw, 363px" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 65"/></a></p>
<h2 id="ftoc-luu-y" class="ftwp-heading"><strong>Note:</strong></h2>
<p>Some notes when coding:</p>
<p>In the if statement you can notice the character >|  The blur to the right of the command is what sorts the commands</p>
<p>That is, the if statement that you enter the line to code without >|  then it will not execute eg this is not done</p>
<p><em>>|  if</em></p>
<p><em>>|Chuyendong = 0</em></p>
<p>Then it failed to execute and reported an error</p>
<p>And if like this:</p>
<p><em>>|  if</em></p>
<p><em>>|  >|  chuyendong = 2</em></p>
<p>Then it will work</p>
<p>How to move the sence and zoom keys for anyone who has a broken mouse wheel or uses a laptop:</p>
<ul>
<li><strong>Ctrl + – (the – sign):</strong> zoom out</li>
<li><strong>Ctrl + + (the + sign there):</strong> zoom in</li>
</ul>
<p>Middle click to move around or right click</p>
<p>Here you will see 3 white ones</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fnhay-5.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17754" src="https://anonyviet.com/wp-content/uploads/2020/02/nhay-5.jpg" alt="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 64" width="146" height="71" title="[Lập Trình Game]  Lesson 2: Gravity, moving surfaces and jumping 66"/></a></p>
<ul>
<li>1st one (4 those arrows): move Sprite</li>
<li>2nd one: Rotate the Sprite or press Ctrl to rotate</li>
<li>3rd one: Zoom in or out of the Sprite</li>
</ul>
<p>That&#8217;s it, the next lesson will be About Tilemaps and Tilesets, and then the character&#8217;s movement will be.</p>
<p style="text-align: right;"><strong>DeathGM!</strong></p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;17723&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-lesson-2-gravity-moving-surfaces-and-jumping/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/02/tao-ra-nhieu-cai.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập trình Game] Lesson 3: Tilemap and Tileset to create Map Game</title>
		<link>https://en.anonyviet.com/lap-trinh-game-lesson-3-tilemap-and-tileset-to-create-map-game/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-lesson-3-tilemap-and-tileset-to-create-map-game/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 17:10:45 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Lesson]]></category>
		<category><![CDATA[Map]]></category>
		<category><![CDATA[Tilemap]]></category>
		<category><![CDATA[Tileset]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8442</guid>

					<description><![CDATA[Next in the series Game programming with Godot I will teach you about tilemap and tileset and use it instead of moving surface. So what are Tilemaps and Tilesets? Join the channel Telegram of the AnonyViet 👉 Link 👈 Tilemap: tilemap is a grid of brick used to create the map (map) for the game. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div id="ftwp-postcontent">
<p><strong>Next in the series <a target="_blank" href="https://en.anonyviet.com/next-link?url=http%3A%2F%2Fanonyviet.com%2F%3Fs%3DGodot" rel="noopener noreferrer" class="local-link">Game programming with Godot</a> I will teach you about tilemap and tileset and use it instead of moving surface.</strong> <strong>So what are Tilemaps and Tilesets?</strong></p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> of the <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<ul>
<li><strong>Tilemap</strong>: tilemap is a grid of <strong>brick</strong> used to create the map (map) for the game.  Or in general <strong>Tilemap</strong> used for design <strong>level</strong> yours or can be understood as design <strong>sense</strong> your house, traps, clouds&#8230;</li>
<li><strong>Tilesets</strong>: is the library of tilemap.  If you don&#8217;t understand, you can understand as follows.  Tileset is the power supply <strong>brick</strong> for <strong>tilemap</strong> your.</li>
</ul>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg1.jpg" rel="noopener" class="local-link"><img alt="[Lập trình Game] Lesson 3: Tilemap and Tileset to create Map Game" title="[Lập trình Game] Lesson 3: Tilemap and Tileset to create Map Game" post-id="8442" fifu-featured="1" decoding="async" class="aligncenter wp-image-17847 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/g1.jpg" alt="[Lập trình Game] Lesson 3: Tilemap and Tileset to create Map Game" title="[Lập trình Game] Lesson 3: Tilemap and Tileset to create Map Game" width="434" height="279" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g1.jpg 434w, https://anonyviet.com/wp-content/uploads/2020/02/g1-300x193.jpg 300w" sizes="(max-width: 434px) 100vw, 434px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 48"/></a></p>
<p><strong>Here is a picture of tilemap &#038; tileset:</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg2.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17848" src="https://anonyviet.com/wp-content/uploads/2020/02/g2.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 45" width="303" height="203" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g2.jpg 303w, https://anonyviet.com/wp-content/uploads/2020/02/g2-300x201.jpg 300w" sizes="auto, (max-width: 303px) 100vw, 303px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 49"/></a> <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg3.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17849" src="https://anonyviet.com/wp-content/uploads/2020/02/g3.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 46" width="455" height="213" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g3.jpg 455w, https://anonyviet.com/wp-content/uploads/2020/02/g3-300x140.jpg 300w" sizes="auto, (max-width: 455px) 100vw, 455px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create a 50 . Map Game"/></a> <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg4.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17850" src="https://anonyviet.com/wp-content/uploads/2020/02/g4.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 47" width="432" height="282" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g4.jpg 432w, https://anonyviet.com/wp-content/uploads/2020/02/g4-300x196.jpg 300w" sizes="auto, (max-width: 432px) 100vw, 432px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 51"/></a></p>
<p>You can <strong>download assets</strong> that Anonyviet has provided here, you can either use the self-created version or download it online.</p>
<p style="text-align: center;"><span style="font-size: 14pt;"><strong><span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link/?url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1nmB93vjavqfErYilXGm8o0WPB-vHMdvk%2Fview%3Fusp%3Dsharing" rel="noopener noreferrer external nofollow" class="ext-link" onclick="this.target='_blank';">Download Link</a></span></strong></span></p>
<p style="text-align: center;">(<strong><a target="_blank" href="https://en.anonyviet.com/next-link/?url=http%3A%2F%2Fwww.fshare.vn%2Ffile%2F12X984KAG51H" rel="noopener noreferrer external nofollow" class="ext-link" onclick="this.target='_blank';">Backup</a></strong>)</p>
<h2 id="ftoc-cach-tao-tilemap-va-tilesets" class="ftwp-heading">How to create Tilemaps and Tilesets</h2>
<p>First you download the asset and put it in the folder where the project is saved:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg5.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17851" src="https://anonyviet.com/wp-content/uploads/2020/02/g5.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 48" width="804" height="230" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g5.jpg 804w, https://anonyviet.com/wp-content/uploads/2020/02/g5-300x86.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/02/g5-768x220.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/02/g5-750x215.jpg 750w" sizes="auto, (max-width: 804px) 100vw, 804px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 52"/></a></p>
</p>
<p>Then you create yourself a new sense by clicking<strong> plus</strong> next to tab <strong>World</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg6.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17852" src="https://anonyviet.com/wp-content/uploads/2020/02/g6.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 49" width="604" height="271" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g6.jpg 604w, https://anonyviet.com/wp-content/uploads/2020/02/g6-300x135.jpg 300w" sizes="auto, (max-width: 604px) 100vw, 604px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 53"/></a></p>
<p>And make yourself one <strong>node</strong>, <strong>2D</strong> or <strong>Black Node</strong> All is fine, can&#8217;t use User or 3D.  Oh and don&#8217;t save it</p>
<p>Open section <strong>tileset</strong> out and toss it in <strong>sense.</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg7.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17853" src="https://anonyviet.com/wp-content/uploads/2020/02/g7.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create a 50 . Map Game" width="275" height="321" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g7.jpg 275w, https://anonyviet.com/wp-content/uploads/2020/02/g7-257x300.jpg 257w" sizes="auto, (max-width: 275px) 100vw, 275px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 54"/></a> <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg8.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17854" src="https://anonyviet.com/wp-content/uploads/2020/02/g8.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 51" width="372" height="271" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g8.jpg 372w, https://anonyviet.com/wp-content/uploads/2020/02/g8-300x219.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/02/g8-120x86.jpg 120w" sizes="auto, (max-width: 372px) 100vw, 372px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 55"/></a></p>
<p>Zoom up if you see a blurry image, do the following:</p>
<p>Click <strong>import tab</strong> next to sense</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg9.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17855" src="https://anonyviet.com/wp-content/uploads/2020/02/g9.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 52" width="196" height="481" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g9.jpg 196w, https://anonyviet.com/wp-content/uploads/2020/02/g9-122x300.jpg 122w" sizes="auto, (max-width: 196px) 100vw, 196px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 56"/></a></p>
<p>Select <strong>2D pixels</strong> then press <strong>Reimport</strong> it&#8217;s done</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg10.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17856" src="https://anonyviet.com/wp-content/uploads/2020/02/g10.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 53" width="321" height="244" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g10.jpg 321w, https://anonyviet.com/wp-content/uploads/2020/02/g10-300x228.jpg 300w" sizes="auto, (max-width: 321px) 100vw, 321px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 57"/></a></p>
<p>Next, click on sence in the left corner of the screen, down to the section <strong>Convert to</strong> and choose <strong>tileset</strong>:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg11.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17857" src="https://anonyviet.com/wp-content/uploads/2020/02/g11.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 54" width="300" height="334" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g11.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/02/g11-269x300.jpg 269w" sizes="auto, (max-width: 300px) 100vw, 300px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 58"/></a></p>
<p>You can save it for yourself anywhere but remember to name it <code>.tres</code> behind you</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg12.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17858" src="https://anonyviet.com/wp-content/uploads/2020/02/g12.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 55" width="426" height="109" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g12.jpg 426w, https://anonyviet.com/wp-content/uploads/2020/02/g12-300x77.jpg 300w" sizes="auto, (max-width: 426px) 100vw, 426px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 59"/></a></p>
<p>Close the sense you just finished.</p>
<p>LIVE <strong>World</strong> create <strong>Node</strong> new name is <strong>Tilemap</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg13.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17859" src="https://anonyviet.com/wp-content/uploads/2020/02/g13.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 56" width="572" height="174" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g13.jpg 572w, https://anonyviet.com/wp-content/uploads/2020/02/g13-300x91.jpg 300w" sizes="auto, (max-width: 572px) 100vw, 572px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 60"/></a></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg14.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17860" src="https://anonyviet.com/wp-content/uploads/2020/02/g14.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 57" width="359" height="205" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g14.jpg 359w, https://anonyviet.com/wp-content/uploads/2020/02/g14-300x171.jpg 300w" sizes="auto, (max-width: 359px) 100vw, 359px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 61"/></a></p>
<p>Then drag the part <strong>Tile sets</strong> just finished go to the right place of <strong>Tilemap </strong>(as shown below)</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg15.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="size-full wp-image-17861 aligncenter" src="https://anonyviet.com/wp-content/uploads/2020/02/g15.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 58" width="271" height="66" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 62"/></a></p>
<p>And okay</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg16.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17862" src="https://anonyviet.com/wp-content/uploads/2020/02/g16.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 59" width="559" height="287" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g16.jpg 559w, https://anonyviet.com/wp-content/uploads/2020/02/g16-300x154.jpg 300w" sizes="auto, (max-width: 559px) 100vw, 559px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 63"/></a></p>
<p>Next, click on<strong> Tile sets</strong> <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg18.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17864" src="https://anonyviet.com/wp-content/uploads/2020/02/g18.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 60" width="290" height="39" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 64"/></a></p>
<p>Click on the red circle, the new place <strong>tileset</strong> in there.</p>
<p>Then select the one with the picture by clicking on it</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg19.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17865" src="https://anonyviet.com/wp-content/uploads/2020/02/g19.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 61" width="483" height="305" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g19.jpg 483w, https://anonyviet.com/wp-content/uploads/2020/02/g19-300x189.jpg 300w" sizes="auto, (max-width: 483px) 100vw, 483px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 65"/></a></p>
<p>And you will see 1 tileset right in front of you</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg20.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17866" src="https://anonyviet.com/wp-content/uploads/2020/02/g20.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 62" width="470" height="368" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g20.jpg 470w, https://anonyviet.com/wp-content/uploads/2020/02/g20-300x235.jpg 300w" sizes="auto, (max-width: 470px) 100vw, 470px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 66"/></a></p>
<p>And the pixel it is is 32 so it&#8217;s a bit big now I will adjust it down to 16×16 by the following way:</p>
<p>Click on the yellow box in general, inside the yellow box, click when it appears <strong>tileseteditor tab</strong> is to be.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg21.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17867" src="https://anonyviet.com/wp-content/uploads/2020/02/g21.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 63" width="359" height="340" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g21.jpg 359w, https://anonyviet.com/wp-content/uploads/2020/02/g21-300x284.jpg 300w" sizes="auto, (max-width: 359px) 100vw, 359px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 67"/></a></p>
<p>Look to the right, <strong>Adjust Step x 32, y 32 > x 16, y 16</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg22.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17868" src="https://anonyviet.com/wp-content/uploads/2020/02/g22.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 64" width="223" height="232" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 68"/></a></p>
<p>And you can see that the tileset fits the tile very well</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg23.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17869" src="https://anonyviet.com/wp-content/uploads/2020/02/g23.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 65" width="478" height="283" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g23.jpg 478w, https://anonyviet.com/wp-content/uploads/2020/02/g23-300x178.jpg 300w" sizes="auto, (max-width: 478px) 100vw, 478px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 69"/></a></p>
<p>You click <strong>New Atlas</strong> and zoning like the photo</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg24.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17870" src="https://anonyviet.com/wp-content/uploads/2020/02/g24.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 66" width="491" height="392" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g24.jpg 491w, https://anonyviet.com/wp-content/uploads/2020/02/g24-300x240.jpg 300w" sizes="auto, (max-width: 491px) 100vw, 491px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 70"/></a></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg25.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17871" src="https://anonyviet.com/wp-content/uploads/2020/02/g25.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 67" width="194" height="118" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 71"/></a></p>
<p>That is used to create a group of tileset</p>
<p>And we continue to create until we run out, after zoning, press <strong>New Altas</strong> to make a new one.</p>
<p>And I&#8217;m done:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg26.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17872" src="https://anonyviet.com/wp-content/uploads/2020/02/g26.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 68" width="551" height="346" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g26.jpg 551w, https://anonyviet.com/wp-content/uploads/2020/02/g26-300x188.jpg 300w" sizes="auto, (max-width: 551px) 100vw, 551px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 72"/></a></p>
<p>Click <strong>Tilemap</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg27.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17873" src="https://anonyviet.com/wp-content/uploads/2020/02/g27.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 69" width="228" height="171" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 73"/></a></p>
<p>Notice it shows up <strong>tile set</strong> that we just circled</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg28.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17874" src="https://anonyviet.com/wp-content/uploads/2020/02/g28.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 70" width="555" height="314" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g28.jpg 555w, https://anonyviet.com/wp-content/uploads/2020/02/g28-300x170.jpg 300w" sizes="auto, (max-width: 555px) 100vw, 555px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 74"/></a></p>
<p>But you can see some that don&#8217;t have pictures.</p>
<h2 id="ftoc-thiet-ke-tilemap-hoan-chinh" class="ftwp-heading">Complete Tilemap Design</h2>
<p><strong>To change the image, do the following:</strong></p>
<p>Go back to the old part choose 1 Atlas</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg29.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17875" src="https://anonyviet.com/wp-content/uploads/2020/02/g29.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 71" width="554" height="332" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g29.jpg 554w, https://anonyviet.com/wp-content/uploads/2020/02/g29-300x180.jpg 300w" sizes="auto, (max-width: 554px) 100vw, 554px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 75"/></a></p>
<p>Select item <strong>Icon</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg30.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17876" src="https://anonyviet.com/wp-content/uploads/2020/02/g30.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 72" width="431" height="330" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g30.jpg 431w, https://anonyviet.com/wp-content/uploads/2020/02/g30-300x230.jpg 300w" sizes="auto, (max-width: 431px) 100vw, 431px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 76"/></a></p>
<p>And click any in that frame, it can be used to classify tileset</p>
<p>However, when done, but your tileset is still not available <strong>Collsion</strong> So now you have to create it.</p>
<p>Select <strong>Collsion</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg31.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17877" src="https://anonyviet.com/wp-content/uploads/2020/02/g31.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 73" width="483" height="404" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g31.jpg 483w, https://anonyviet.com/wp-content/uploads/2020/02/g31-300x251.jpg 300w" sizes="auto, (max-width: 483px) 100vw, 483px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 77"/></a></p>
<p>Select a box and then press the blue square above, near the trash can and next to the arrow</p>
<p>Okay like this</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg32.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17878" src="https://anonyviet.com/wp-content/uploads/2020/02/g32.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 74" width="421" height="319" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g32.jpg 421w, https://anonyviet.com/wp-content/uploads/2020/02/g32-300x227.jpg 300w" sizes="auto, (max-width: 421px) 100vw, 421px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 78"/></a></p>
<p>Then click on another box</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg33.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17879" src="https://anonyviet.com/wp-content/uploads/2020/02/g33.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 75" width="385" height="306" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g33.jpg 385w, https://anonyviet.com/wp-content/uploads/2020/02/g33-300x238.jpg 300w" sizes="auto, (max-width: 385px) 100vw, 385px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 79"/></a></p>
<p>And keep doing it until it&#8217;s done</p>
<p>For the squares that have a cross-section, do the following:</p>
<p>Select the one next to the square</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg34.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17880" src="https://anonyviet.com/wp-content/uploads/2020/02/g34.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 76" width="406" height="314" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g34.jpg 406w, https://anonyviet.com/wp-content/uploads/2020/02/g34-300x232.jpg 300w" sizes="auto, (max-width: 406px) 100vw, 406px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 80"/></a></p>
<p>Click to select 2 corners as shown, if you try to click in another direction to round like the picture, it won&#8217;t work</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg35.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17881" src="https://anonyviet.com/wp-content/uploads/2020/02/g35.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 77" width="408" height="314" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g35.jpg 408w, https://anonyviet.com/wp-content/uploads/2020/02/g35-300x231.jpg 300w" sizes="auto, (max-width: 408px) 100vw, 408px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 81"/></a></p>
<p>To round, do the following:</p>
<p>Turn off the one like the picture</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg37.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17883" src="https://anonyviet.com/wp-content/uploads/2020/02/g37.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 78" width="339" height="84" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g37.jpg 339w, https://anonyviet.com/wp-content/uploads/2020/02/g37-300x74.jpg 300w" sizes="auto, (max-width: 339px) 100vw, 339px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 82"/></a></p>
<p>And do</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg38.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17884" src="https://anonyviet.com/wp-content/uploads/2020/02/g38.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 79" width="489" height="236" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g38.jpg 489w, https://anonyviet.com/wp-content/uploads/2020/02/g38-300x145.jpg 300w" sizes="auto, (max-width: 489px) 100vw, 489px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 83"/></a></p>
<p>Please click to connect the points</p>
<p>Let&#8217;s finish it now</p>
<p>I&#8217;m done:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg39.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17885" src="https://anonyviet.com/wp-content/uploads/2020/02/g39.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 80" width="434" height="347" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g39.jpg 434w, https://anonyviet.com/wp-content/uploads/2020/02/g39-300x240.jpg 300w" sizes="auto, (max-width: 434px) 100vw, 434px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 84"/></a></p>
<p>Now the next thing is level design</p>
<p>Press <strong>tile map</strong> to come back</p>
<p><strong>Remove Node wall</strong> Go</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg40.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17886" src="https://anonyviet.com/wp-content/uploads/2020/02/g40.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 81" width="732" height="367" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g40.jpg 732w, https://anonyviet.com/wp-content/uploads/2020/02/g40-300x150.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/02/g40-360x180.jpg 360w" sizes="auto, (max-width: 732px) 100vw, 732px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 85"/></a></p>
<p>Correction <strong>pixels</strong> become <strong>16</strong></p>
<p>When you try to place <strong>tilesets</strong> down will see it <strong>inverse ratio</strong> with <strong>sense</strong> right</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg41.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17887" src="https://anonyviet.com/wp-content/uploads/2020/02/g41.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 82" width="499" height="259" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g41.jpg 499w, https://anonyviet.com/wp-content/uploads/2020/02/g41-300x156.jpg 300w" sizes="auto, (max-width: 499px) 100vw, 499px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 86"/></a></p>
<p>So how to fix the solution just resize the <strong>tileset</strong> by clicking O <strong>Cell</strong> on the right tab</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg42.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17888" src="https://anonyviet.com/wp-content/uploads/2020/02/g42.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 83" width="213" height="222" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 87"/></a></p>
<p>Change <strong>64×64</strong> wall <strong>16×16</strong> = with the size we created.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg43.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17889" src="https://anonyviet.com/wp-content/uploads/2020/02/g43.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 84" width="211" height="357" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g43.jpg 211w, https://anonyviet.com/wp-content/uploads/2020/02/g43-177x300.jpg 177w" sizes="auto, (max-width: 211px) 100vw, 211px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 88"/></a></p>
<p>Your next task is to design it:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg44.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17890" src="https://anonyviet.com/wp-content/uploads/2020/02/g44.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 85" width="487" height="363" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g44.jpg 487w, https://anonyviet.com/wp-content/uploads/2020/02/g44-300x224.jpg 300w" sizes="auto, (max-width: 487px) 100vw, 487px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 89"/></a></p>
<p>Looks good not too bad</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fg45.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-17891" src="https://anonyviet.com/wp-content/uploads/2020/02/g45.jpg" alt="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 86" width="450" height="299" srcset="https://anonyviet.com/wp-content/uploads/2020/02/g45.jpg 450w, https://anonyviet.com/wp-content/uploads/2020/02/g45-300x199.jpg 300w" sizes="auto, (max-width: 450px) 100vw, 450px" title="[Lập trình Game]  Lesson 3: Tilemap and Tileset to create Map Game 90"/></a></p>
<p>That&#8217;s it, creating the map in the game with tilemap and tileset.  In the next episode, I will guide you to create characters ^^.  Bye</p>
<p style="text-align: right;"><strong>DeathGM!</strong></p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;17846&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-lesson-3-tilemap-and-tileset-to-create-map-game/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/02/g1.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập Trình Game] Lesson 4: Create a camera to track the character</title>
		<link>https://en.anonyviet.com/lap-trinh-game-lesson-4-create-a-camera-to-track-the-character/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-lesson-4-create-a-camera-to-track-the-character/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 15:47:40 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Camera]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Lesson]]></category>
		<category><![CDATA[track]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8415</guid>

					<description><![CDATA[Next in the series Game programming with Godot, today I will guide you to create a character tracking camera. When the character moves on the screen, we will easily follow our character. Join the channel Telegram of the AnonyViet 👉 Link 👈 Let&#8217;s get started: Camera In the previous post you did, you will see [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div>
<p><strong>Next in the series <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2F%3Fs%3Dl%25E1%25BA%25ADp%2Btr%25C3%25ACnh%2Bgame%2Bb%25E1%25BA%25B1ng%2BGodot" rel="noopener noreferrer" class="local-link">Game programming with Godot</a>, today I will guide you to create a character tracking camera.  When the character moves on the screen, we will easily follow our character.</strong></p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> of the <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Let&#8217;s get started:</p>
<p><strong>Camera</strong></p>
<p>In the previous post you did, you will see when running the game it will look like the picture</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage001.jpg" rel="noopener" class="local-link"><img decoding="async" class="aligncenter wp-image-18225 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/image001.jpg" alt="complete game design using godot" width="624" height="381" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image001.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/02/image001-300x183.jpg 300w" sizes="(max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 4: Create a camera to track the character 19"/></a></p>
<p>And this is after the camera</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage002.jpg" rel="noopener" class="local-link"><img alt="[Lập Trình Game] Lesson 4: Create a camera to track the character" title="[Lập Trình Game] Lesson 4: Create a camera to track the character" post-id="8415" fifu-featured="1" decoding="async" loading="lazy" class="aligncenter wp-image-18226 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/image002.jpg" alt="[Lập Trình Game] Lesson 4: Create a camera to track the character" title="[Lập Trình Game] Lesson 4: Create a camera to track the character" width="624" height="383" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image002.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/02/image002-300x184.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 4: Create a 20 . character tracking camera"/></a></p>
<h2>How to create a character tracking camera</h2>
<p>So today I will guide you to create a camera for your character.</p>
<p>First in Player you find and create for yourself <strong>Node Camera2D</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage003.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18227 size-full" src="https://anonyviet.com/wp-content/uploads/2020/02/image003.png" alt="camera godot" width="248" height="291" title="[Lập Trình Game]  Lesson 4: Create a camera to track the character 21"/></a></p>
<p>Then you zoom out to notice that you will see 2 squares:</p>
<ul>
<li>1 piece below is incomplete.</li>
<li>the one above is complete<strong> and</strong> The complete one is your camera frame.</li>
</ul>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage004.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18228" src="https://anonyviet.com/wp-content/uploads/2020/02/image004.png" alt="[Lập Trình Game]  Lesson 4: Create a camera to track the character 14" width="629" height="398" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image004.png 629w, https://anonyviet.com/wp-content/uploads/2020/02/image004-300x190.png 300w" sizes="auto, (max-width: 629px) 100vw, 629px" title="[Lập Trình Game]  Lesson 4: Create a 22 . character tracking camera"/></a></p>
<p>If you run the game it stays the same so we need to <strong>edit</strong> again <strong>settings</strong> of the <strong>camera</strong></p>
<p>Open your own section <strong>Limit</strong> beside <strong>setting camera2d</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage005.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18229" src="https://anonyviet.com/wp-content/uploads/2020/02/image005.png" alt="[Lập Trình Game]  Lesson 4: Create a 15 . character tracking camera" width="268" height="574" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image005.png 268w, https://anonyviet.com/wp-content/uploads/2020/02/image005-140x300.png 140w" sizes="auto, (max-width: 268px) 100vw, 268px" title="[Lập Trình Game]  Lesson 4: Create a camera to track the character 23"/></a></p>
<p><strong>What is Limit?</strong> Limit is the limit of the camera, for example left is the coordinate that it will go to the left</p>
<p>To make it easier to understand, please pay attention to the picture below</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage006.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18230" src="https://anonyviet.com/wp-content/uploads/2020/02/image006.jpg" alt="[Lập Trình Game]  Lesson 4: Create a 16 . character tracking camera" width="624" height="405" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image006.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/02/image006-300x195.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 4: Create a 24 . character tracking camera"/></a></p>
<p>The vertical green line is the number<strong> 0</strong> and that is <strong>coordinates x</strong> and the red line going to the left is <strong>y . coordinates</strong></p>
<p><strong>VD:</strong> You want the camera <strong>move to 0 x-axis</strong> is to stop and not move, you can edit it in the box <strong>Limit</strong> part<strong> left is 0</strong></p>
<p>Ah must turn on <strong>Current</strong> it just works</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage007.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18231" src="https://anonyviet.com/wp-content/uploads/2020/02/image007.png" alt="[Lập Trình Game]  Lesson 4: Create a camera to track the character 17" width="246" height="321" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image007.png 246w, https://anonyviet.com/wp-content/uploads/2020/02/image007-230x300.png 230w" sizes="auto, (max-width: 246px) 100vw, 246px" title="[Lập Trình Game]  Lesson 4: Create a 25 . character tracking camera"/></a></p>
<p>When you turn it on, you will see a change and if you turn it on, you won&#8217;t see anything so let&#8217;s continue</p>
<p>Part <strong>top</strong> I also let <strong>0</strong> so that it doesn&#8217;t go over the red line</p>
<p>Part <strong>Botton</strong> I let <strong>325</strong> and how to<strong> bottom setting</strong></p>
<p>Friend <strong>zoom</strong> up the part you want it to be limited to <strong>bottom</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage008.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18232" src="https://anonyviet.com/wp-content/uploads/2020/02/image008.jpg" alt="[Lập Trình Game]  Lesson 4: Create an 18 . character tracking camera" width="624" height="411" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image008.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/02/image008-300x198.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 4: Create a 26 . character tracking camera"/></a></p>
<p>You guys keep looking for landmarks and then <strong>zoom</strong> When you go up, you will see the number in the left column and then fill it in <strong>bottom</strong> like photo</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage009.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18233" src="https://anonyviet.com/wp-content/uploads/2020/02/image009.jpg" alt="[Lập Trình Game]  Lesson 4: Create a camera to track the character 19" width="624" height="425" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image009.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/02/image009-300x204.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 4: Create a character tracking camera 27"/></a></p>
<p>And then adjust the zoom<strong> X 1 – Y 1</strong> -><strong> X 0.5 – Y 0.5</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage010.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18234" src="https://anonyviet.com/wp-content/uploads/2020/02/image010.png" alt="[Lập Trình Game]  Lesson 4: Create a 20 . character tracking camera" width="246" height="497" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image010.png 246w, https://anonyviet.com/wp-content/uploads/2020/02/image010-148x300.png 148w" sizes="auto, (max-width: 246px) 100vw, 246px" title="[Lập Trình Game]  Lesson 4: Create a 28 . character tracking camera"/></a></p>
<p>Run the game and you&#8217;ll see the difference</p>
<p>And you can see our game screen has changed</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage011.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18235" src="https://anonyviet.com/wp-content/uploads/2020/02/image011.jpg" alt="[Lập Trình Game]  Lesson 4: Create a camera to track the character 21" width="624" height="378" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image011.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/02/image011-300x182.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 4: Create a camera to track the character 29"/></a></p>
<p>If you think it&#8217;s too big, adjust it<strong> 0.6- 0.8</strong> Please.  If you do not want to adjust but see it as large, just adjust the Player to be smaller.</p>
<p>And one more part is that if you pay attention, you will see when you move, the camera moves along and in godot also supports you to add a mode that when you move a segment, the camera will move.</p>
<p>That is the part:<strong> Drag Margin H – Drag Margin DRAW</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage012.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18236" src="https://anonyviet.com/wp-content/uploads/2020/02/image012.png" alt="[Lập Trình Game]  Lesson 4: Create a 22 . character tracking camera" width="258" height="348" srcset="https://anonyviet.com/wp-content/uploads/2020/02/image012.png 258w, https://anonyviet.com/wp-content/uploads/2020/02/image012-222x300.png 222w" sizes="auto, (max-width: 258px) 100vw, 258px" title="[Lập Trình Game]  Lesson 4: Create a 30 . character tracking camera"/></a></p>
<p>Click on those 2 you will see the difference.</p>
<p>And when you move, you will see that when you reach a position, the camera will move according to the character, so is there a way to adjust the position limit so that the camera will move the character?  And of course there are you guys looking for yourself<strong> Drag Margin</strong> live <strong>settings</strong> <strong>camera</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage013.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18237" src="https://anonyviet.com/wp-content/uploads/2020/02/image013.png" alt="[Lập Trình Game]  Lesson 4: Create a camera to track the character 23" width="244" height="220" title="[Lập Trình Game]  Lesson 4: Create a camera to track the character 31"/></a></p>
<p>And it will not show a frame telling you how limited it is, so you can turn it on for yourself as follows:</p>
<p>Find <strong>Editor > enable Draw Drag Margin</strong> okay and it will be displayed and you can edit it as you like</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F02%2Fimage014.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18238" src="https://anonyviet.com/wp-content/uploads/2020/02/image014.png" alt="[Lập Trình Game]  Lesson 4: Create a 24 . character tracking camera" width="248" height="208" title="[Lập Trình Game]  Lesson 4: Create a 32 . character tracking camera"/></a></p>
<p>So, I have finished the guide to monitoring the character screen by configuring the Camera.  You should see from <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fbai-0-gioi-thieu-ve-godot-va-cai-dat%2F" rel="noopener noreferrer" class="local-link">post 0</a> Go to this post for easy steps.</p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;18224&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
<p><!-- AI CONTENT END 2 --></p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-lesson-4-create-a-camera-to-track-the-character/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/02/image002.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập trình Game] Lesson 5: Programming character movements</title>
		<link>https://en.anonyviet.com/lap-trinh-game-lesson-5-programming-character-movements/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-lesson-5-programming-character-movements/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 13:54:54 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Lesson]]></category>
		<category><![CDATA[movements]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8391</guid>

					<description><![CDATA[As you know every game has a character and most 2D games have a main character who is generally a character you control for easy understanding. Today I will guide you to create Character Movement. This article consists of 2 parts as well as 2 types of character creation. Why are there 2 parts? Because [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div id="ftwp-postcontent">
<p><strong>As you know every game has a character and most 2D games have a main character who is generally a character you control for easy understanding.  Today I will guide you to create Character Movement.  This article consists of 2 parts as well as 2 types of character creation. Why are there 2 parts?  Because it depends on your assets because most of them have 2 types of assets, 1 is the movement in each image and the other is the movement that is all in 1 image.</strong></p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> of the <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>You need to study from lesson 0 to this lesson to understand all the instructions when <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2F%3Fs%3Dgodot" rel="noopener noreferrer" class="local-link">Game programming with Godot</a> Please.</p>
<p>And without further ado, let&#8217;s get started</p>
<h2 id="ftoc-charater-animation" class="ftwp-heading"><strong>Character Animation:</strong></h2>
<p>I will guide you to do type 1 first.</p>
<p><strong>Start:</strong></p>
<p>First: Delete <strong>Sprite</strong> old and created for myself <strong>AnimatedSprite</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage001.png" rel="noopener" class="local-link"><img decoding="async" class="aligncenter wp-image-18423 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image001.png" alt="programming game character movement godot" width="238" height="267" title="[Lập trình Game]  Lesson 5: Programming character movements 19"/></a></p>
<p>AnimatedSprite: A node that can use multiple textures to animate</p>
<p>Here I guide you to use my assets and if any of your assets are different from mine but it is of the same category as below, it can be applied.  It has many separate photos</p>
<p style="text-align: center;"><span style="text-decoration: underline;"><strong><a target="_blank" href="https://en.anonyviet.com/next-link/?url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F1WwEs_5mDaO6dagh0hCaBJpq8UMngKD-O%2Fview%3Fusp%3Dsharing" rel="noopener noreferrer external nofollow" class="ext-link" onclick="this.target='_blank';">Player download link</a></strong></span></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage002.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18424 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image002.jpg" alt="Link to download motion programming game characters" width="780" height="119" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image002.jpg 780w, https://anonyviet.com/wp-content/uploads/2020/03/image002-300x46.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image002-768x117.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image002-750x114.jpg 750w" sizes="auto, (max-width: 780px) 100vw, 780px" title="[Lập trình Game]  Lesson 5: Programming character movements 20"/></a></p>
<p>Please download it and put it in the game folder</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage003.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18425" src="https://anonyviet.com/wp-content/uploads/2020/03/image003.jpg" alt="[Lập trình Game]  Lesson 5: Programming character movements 13" width="780" height="196" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image003.jpg 780w, https://anonyviet.com/wp-content/uploads/2020/03/image003-300x75.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image003-768x193.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image003-750x188.jpg 750w" sizes="auto, (max-width: 780px) 100vw, 780px" title="[Lập trình Game]  Lesson 5: Programming character movements 21"/></a></p>
<p>Next we will create the character</p>
<p>You click on AnimatedSprite and change the name to Player then on the right of the Player there is a setting column in the Frames section to create a new Frame for you.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage004.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18426 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image004.jpg" alt="code for godot character movement" width="780" height="439" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image004.jpg 780w, https://anonyviet.com/wp-content/uploads/2020/03/image004-300x169.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image004-768x432.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image004-750x422.jpg 750w" sizes="auto, (max-width: 780px) 100vw, 780px" title="[Lập trình Game]  Lesson 5: Programming the character movement 22"/></a></p>
<p>Then click on the newly created SpriteFramse will display a table (click like a tilemap).</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage005.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18427 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image005.jpg" alt="write code for character movement" width="779" height="380" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image005.jpg 779w, https://anonyviet.com/wp-content/uploads/2020/03/image005-300x146.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image005-768x375.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image005-750x366.jpg 750w" sizes="auto, (max-width: 779px) 100vw, 779px" title="[Lập trình Game]  Lesson 5: Programming character movements 23"/></a></p>
<p>Here you can see the word default on the left, delete it and create a new animation</p>
<p>Click like photo to create new Animations</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage006.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18428" src="https://anonyviet.com/wp-content/uploads/2020/03/image006.png" alt="[Lập trình Game]  Lesson 5: Programming character movements 14" width="175" height="214" title="[Lập trình Game]  Lesson 5: Programming character movements 24"/></a></p>
<p>Make yourself 4 of them Idle – Run – Jump – Fall</p>
<p>In Idle, please drag them all in the folder</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage007.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18429" src="https://anonyviet.com/wp-content/uploads/2020/03/image007.jpg" alt="[Lập trình Game]  Lesson 5: Programming character movements 15" width="780" height="346" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image007.jpg 780w, https://anonyviet.com/wp-content/uploads/2020/03/image007-300x133.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image007-768x341.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image007-750x333.jpg 750w" sizes="auto, (max-width: 780px) 100vw, 780px" title="[Lập trình Game]  Lesson 5: Programming character movements 25"/></a></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage008.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18430" src="https://anonyviet.com/wp-content/uploads/2020/03/image008.jpg" alt="[Lập trình Game]  Lesson 5: Programming character movements 16" width="780" height="292" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image008.jpg 780w, https://anonyviet.com/wp-content/uploads/2020/03/image008-300x112.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image008-768x288.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image008-750x281.jpg 750w" sizes="auto, (max-width: 780px) 100vw, 780px" title="[Lập trình Game]  Lesson 5: Programming character movements 26"/></a></p>
<p>Do the same with the other parts</p>
<p>And in the Jump section</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage009.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18431" src="https://anonyviet.com/wp-content/uploads/2020/03/image009.png" alt="[Lập trình Game]  Lesson 5: Programming character movements 17" width="191" height="90" title="[Lập trình Game]  Lesson 5: Programming character movements 27"/></a></p>
<p>Watch out for anim8 and anim11</p>
<p>Anim8 is jump and anim11 is fall why?  Because 8 is when you jump up and 11 is when you land, you can do the same with other assets if you don&#8217;t understand, you can inbox me or go to Group Anonyviet Community to ask.</p>
<p>If your character is blurred like the image from Import back to 2D pixels</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage010.jpg" rel="noopener" class="local-link"><img alt="[Lập trình Game] Lesson 5: Programming character movements" title="[Lập trình Game] Lesson 5: Programming character movements" post-id="8391" fifu-featured="1" decoding="async" loading="lazy" class="aligncenter size-full wp-image-18432" src="https://anonyviet.com/wp-content/uploads/2020/03/image010.jpg" alt="[Lập trình Game]  Lesson 5: Programming character movements 18" width="780" height="439" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image010.jpg 780w, https://anonyviet.com/wp-content/uploads/2020/03/image010-300x169.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image010-768x432.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image010-750x422.jpg 750w" sizes="auto, (max-width: 780px) 100vw, 780px" title="[Lập trình Game]  Lesson 5: Programming character movements 28"/></a></p>
<p>Please change them one by one in the FIlesystem section</p>
<p>After editing, our character will be sharp again</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage011.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18433" src="https://anonyviet.com/wp-content/uploads/2020/03/image011.jpg" alt="[Lập trình Game]  Lesson 5: Programming character movements 19" width="780" height="229" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image011.jpg 780w, https://anonyviet.com/wp-content/uploads/2020/03/image011-300x88.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image011-768x225.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image011-750x220.jpg 750w" sizes="auto, (max-width: 780px) 100vw, 780px" title="[Lập trình Game]  Lesson 5: Programming character movements 29"/></a></p>
<p>And we&#8217;re done with Character Creation Next is Coding</p>
<p>And you adjust the collection for yourself</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage012.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18434" src="https://anonyviet.com/wp-content/uploads/2020/03/image012.png" alt="[Lập trình Game]  Lesson 5: Programming character movements 20" width="318" height="248" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image012.png 318w, https://anonyviet.com/wp-content/uploads/2020/03/image012-300x234.png 300w" sizes="auto, (max-width: 318px) 100vw, 318px" title="[Lập trình Game]  Lesson 5: Programming the character movement 30"/></a></p>
<h2 id="ftoc-code-chuyen-dong-nhan-vat-game" class="ftwp-heading"><strong>Game character movement code</strong></h2>
<p>And I will guide you to coding for Character Motion.  Your game character can move according to the keys you programmed.</p>
<p>No part<strong> script > character</strong></p>
<p>Code for me to add the following part</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage013.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18435" src="https://anonyviet.com/wp-content/uploads/2020/03/image013.png" alt="[Lập trình Game]  Lesson 5: Programming character movements 21" width="473" height="424" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image013.png 473w, https://anonyviet.com/wp-content/uploads/2020/03/image013-300x269.png 300w" sizes="auto, (max-width: 473px) 100vw, 473px" title="[Lập trình Game]  Lesson 5: Programming character movements 31"/></a></p>
<p>Line: 12 &#8211; 13 &#8211; 16 &#8211; 17 &#8211; 20 &#8211; 24 -25 -26- 27 &#8211; 28</p>
<p>And below I will explain to you</p>
<p><code>$Player</code>: is that you call Node in the script using $ to call any Node in a Node</p>
<p><code>$Player.play()</code>: you run the Animation you did just now</p>
<p><code>$Player.flip_h</code>: is it helps you turn left, right if you try to remove these 2 lines and then run the game, move left + right, you will see something different than when you don&#8217;t remove these 2 lines</p>
<p><strong>From line 24 > line 28</strong> is the code that helps you to jump and still apply animations.</p>
<p>After running the game we will have a complete character:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage014.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18436" src="https://anonyviet.com/wp-content/uploads/2020/03/image014.jpg" alt="[Lập trình Game]  Lesson 5: Programming the character movement 22" width="779" height="474" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image014.jpg 779w, https://anonyviet.com/wp-content/uploads/2020/03/image014-300x183.jpg 300w, https://anonyviet.com/wp-content/uploads/2020/03/image014-768x467.jpg 768w, https://anonyviet.com/wp-content/uploads/2020/03/image014-750x456.jpg 750w" sizes="auto, (max-width: 779px) 100vw, 779px" title="[Lập trình Game]  Lesson 5: Programming character movements 32"/></a></p>
<p>In the next episode, I will guide you to create friction to control your speed, when you move, you will see it running fast, so there will be 1 more friction.</p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;18422&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-lesson-5-programming-character-movements/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/03/image010.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập Trình Game] Lesson 6: Notes and Friction to control the character&#8217;s speed</title>
		<link>https://en.anonyviet.com/lap-trinh-game-lesson-6-notes-and-friction-to-control-the-characters-speed/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-lesson-6-notes-and-friction-to-control-the-characters-speed/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 12:54:38 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[characters]]></category>
		<category><![CDATA[control]]></category>
		<category><![CDATA[Friction]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Lesson]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Speed]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8382</guid>

					<description><![CDATA[Continuing with the game programming series in this article, I will guide you to create friction to control speed and after moving. After you have code for the character to move, you need to control the speed of the character. In which friction will slow down the character Join the channel Telegram of the AnonyViet [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div id="ftwp-postcontent">
<p>Continuing with the game programming series in this article, I will guide you to create friction to control speed and after moving.  After you have code for the character to move, you need to control the speed of the character.  In which friction will slow down the character</p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> of the <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Notes are used to comment on what line of code you will write about.  This helps later when you read the code, you can understand the effect of that code.</p>
<p>When your line of code is small, it may be okay, but code that is a few hundred lines, without notes, it is really a nightmare :<</p>
<p>To take notes, you just need to add the # sign and then write the text out for example: #dichuyen, #jump,..</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage001.png" rel="noopener" class="local-link"><img alt="[Lập Trình Game] Lesson 6: Notes and Friction to control the character&#8217;s speed" title="[Lập Trình Game] Lesson 6: Notes and Friction to control the character&#8217;s speed" post-id="8382" fifu-featured="1" decoding="async" class="aligncenter wp-image-18474 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage001.png" alt="[Lập Trình Game] Lesson 6: Notes and Friction to control the character&#8217;s speed" title="[Lập Trình Game] Lesson 6: Notes and Friction to control the character&#8217;s speed" width="222" height="275" title="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 15"/></a></p>
<h2 id="ftoc-code-luc-ma-sat-kiem-soat-toc-do-nhan-vat" class="ftwp-heading">Code Friction force control character speed</h2>
<p>In this part we will have to code quite a lot</p>
<p>You declare the entire variable for yourself</p>
<p style="text-align: center;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage002.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18475 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage002.png" alt="code Friction force control character speed" width="303" height="109" srcset="https://anonyviet.com/wp-content/uploads/2020/03/ximage002.png 303w, https://anonyviet.com/wp-content/uploads/2020/03/ximage002-300x108.png 300w" sizes="auto, (max-width: 303px) 100vw, 303px" title="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 16"/></a><span style="color: #ff0000;"><strong>–></strong></span></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage003.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18476" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage003.png" alt="[Lập Trình Game]  Lesson 6: Notes and Friction to control the character's speed 11" width="256" height="124" title="[Lập Trình Game]  Lesson 6: Notes and Friction to control character speed 17"/></a></p>
<p><strong>Const:</strong> full is a function that anyone who learns basic programming will know already. <strong>const</strong> is a function that fixes the value of your variable, for example: <code>const conga_trongchuong = 5</code> then you know<code>n conga_trongchuong</code> this is always equal to <strong>5</strong> cannot be changed, if you want to change the version, you must convert from const to var.  And in the photo above, it&#8217;s okay to let Var all out.</p>
<p>There are a few new variables, you can understand by looking at the name</p>
<p>Next we code the speed reducer</p>
<p><strong>Current:</strong></p>
<p><code>chuyendong.x += tocdo</code>  <span style="color: #ff0000;"> <strong>-></strong></span><strong> </strong> <code>chuyendong.x = min(chuyendong.x+giatoc, tocdo_toida)</code></p>
<p><code>chuyendong.y-= tocdo</code>     <strong><span style="color: #ff0000;">-></span></strong>  <code>chuyendong.x = max(chuyendong.x-giatoc, -tocdo_toida)</code></p>
<p style="text-align: center;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage004.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18477" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage004.png" alt="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 12" width="249" height="136" title="[Lập Trình Game]  Lesson 6: Notes and Friction to control the character's speed 18"/></a><span style="color: #ff0000;"><strong>–></strong></span></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage005.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18478" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage005.png" alt="[Lập Trình Game]  Lesson 6: Notes and Friction to control character speed 13" width="475" height="144" srcset="https://anonyviet.com/wp-content/uploads/2020/03/ximage005.png 475w, https://anonyviet.com/wp-content/uploads/2020/03/ximage005-300x91.png 300w" sizes="auto, (max-width: 475px) 100vw, 475px" title="[Lập Trình Game]  Lesson 6: Notes and Friction to control the character's speed 19"/></a></p>
<p><code>chuyendong.x = min(chuyendong.x+giatoc, tocdo_toida)</code>: ie: min and max always go together this you don&#8217;t need to care, just know min and max 2 this is when the right movement is min the left movement is max.</p>
<p><code>chuyendong.x</code>  is that you call the variable x-axis positive (positive is right, negative is left) + with giatoc being the beginning it will accelerate at 20 and tocdo_toida is the maximum speed when you move</p>
<p><code>chuyendong.x = max</code>  same as above but only reversed.</p>
<p>Declare yourself below process_physical 1 variable as masat assign it = false (type bool)</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage006.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18479" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage006.png" alt="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 14" width="352" height="169" srcset="https://anonyviet.com/wp-content/uploads/2020/03/ximage006.png 352w, https://anonyviet.com/wp-content/uploads/2020/03/ximage006-300x144.png 300w, https://anonyviet.com/wp-content/uploads/2020/03/ximage006-350x169.png 350w" sizes="auto, (max-width: 352px) 100vw, 352px" title="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 20"/></a></p>
<p>Next in the else: the movement you delete <code>chuyendong.x = 0</code>  replaced <code>masat = true</code></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage007.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18480" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage007.png" alt="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 15" width="212" height="68" title="[Lập Trình Game]  Lesson 6: Notes and Friction to control the character's speed 21"/></a></p>
<p style="text-align: center;"><span style="color: #ff0000;"><strong>–></strong></span></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage008.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18481" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage008.png" alt="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 16" width="251" height="80" title="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 22"/></a></p>
<p>Add your own code:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage009.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18482" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage009.png" alt="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 17" width="406" height="125" srcset="https://anonyviet.com/wp-content/uploads/2020/03/ximage009.png 406w, https://anonyviet.com/wp-content/uploads/2020/03/ximage009-300x92.png 300w" sizes="auto, (max-width: 406px) 100vw, 406px" title="[Lập Trình Game]  Lesson 6: Notes and Friction to control character speed 23"/></a><br /><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fximage010.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18483" src="https://anonyviet.com/wp-content/uploads/2020/03/ximage010.png" alt="[Lập Trình Game]  Lesson 6: Notes and Friction to control the character's speed 18" width="413" height="146" srcset="https://anonyviet.com/wp-content/uploads/2020/03/ximage010.png 413w, https://anonyviet.com/wp-content/uploads/2020/03/ximage010-300x106.png 300w" sizes="auto, (max-width: 413px) 100vw, 413px" title="[Lập Trình Game]  Lesson 6: Notes and Friction force control character speed 24"/></a></p>
<p><strong>View Full Code:</strong></p>
<pre class="lang:default decode:true ">extends KinematicBody2D&#13;
&#13;
var chuyendong = Vector2()&#13;
const UP = Vector2(0,-1)&#13;
const tocdo_toida = 100&#13;
const giatoc = 50&#13;
const trongluc = 20&#13;
const nhaycao = -500&#13;
func _physics_process(delta):&#13;
    chuyendong.y += trongluc&#13;
	var masat = false&#13;
	# di chuyen cua nhan vat&#13;
	if Input.is_action_pressed("ui_right"):&#13;
		chuyendong.x = min(chuyendong.x+giatoc, tocdo_toida)&#13;
		$Player.play("Run")&#13;
		$Player.flip_h = false&#13;
	elif Input.is_action_pressed("ui_left"):&#13;
		chuyendong.x = max(chuyendong.x-giatoc,-tocdo_toida)&#13;
		$Player.play("Run")&#13;
		$Player.flip_h = true&#13;
	else:&#13;
		$Player.play("Idle")&#13;
		masat = true&#13;
	#nhan vat nhay&#13;
	if is_on_floor():&#13;
		if Input.is_action_just_pressed("ui_up"):&#13;
			chuyendong.y += nhaycao&#13;
		if masat == true:&#13;
			chuyendong.x = lerp(chuyendong.x,0,0.2)&#13;
	else:&#13;
		if chuyendong.y &lt;0:&#13;
			$Player.play("Jump")&#13;
		else:&#13;
			$Player.play("Fall")&#13;
		if masat == true:&#13;
			chuyendong.x = lerp(chuyendong.x,0,0.4)&#13;
	chuyendong = move_and_slide(chuyendong,UP)&#13;
</pre>
<p><strong>Code explanation:</strong></p>
<p>if masat == true:</p>
<p>chuyendong.x = lerp(chuyendong.x,0,0.2) : if masat = true means if masat is true then it will execute the inner if masat = true.</p>
<p>In the previous post you have coded 3 parts to move if – elif – else where if = right, elif = left, else = stand still and we leave the function masat = true in else which means that when running masat will = false (maybe) understand true is 1 false is 2) if and elif so it won&#8217;t appear and when the character stops masat will = true because we declared in else:</p>
<p><code>lerp(chuyendong.x,0,0.2) :chuyendong.x</code>  call the x-axis transfer function (here there will be no right or left axis because right and left apply when you move left or right and this is stationary) at the end of the run action it will run the following line as 0.0.2 (0 is y axis assign it = 0)(0.2 is x axis you can assign it = whatever but the smaller the bigger the friction) it will push the player 0.2m more after moving.</p>
<p><strong>If you find the speed slow, you can change it and note that you can adjust any parameter because it&#8217;s your game project, not yours and the owner, just showing you how to make a basic game for you to do.</strong></p>
<p>And that&#8217;s it ^^ in the next lesson will be moving between one sence to another, which can be roughly understood as moving from one stage to another.</p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;18473&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-lesson-6-notes-and-friction-to-control-the-characters-speed/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/03/ximage001.png" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập Trình Game] Lesson 7: Move between levels when completing a mission</title>
		<link>https://en.anonyviet.com/lap-trinh-game-lesson-7-move-between-levels-when-completing-a-mission/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-lesson-7-move-between-levels-when-completing-a-mission/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 11:49:36 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[completing]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Lesson]]></category>
		<category><![CDATA[Levels]]></category>
		<category><![CDATA[mission]]></category>
		<category><![CDATA[Move]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8360</guid>

					<description><![CDATA[Continuing the series, today ad will continue part 7 which is moving between levels. Can be understood as moving back and forth to edit the senses. To learn about sence, please review from Lesson 0 of Game programming series with Godot. As for the level, do you guys play the game? mmorp then understand it [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div id="ftwp-postcontent">
<p><strong>Continuing the series, today ad will continue part 7 which is moving between levels.  Can be understood as moving back and forth to edit the senses.  To learn about sence, please review from Lesson 0 of <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2F%3Fs%3Dgodot" rel="noopener noreferrer" class="local-link">Game programming series with Godot</a>.  As for the level, do you guys play the game? <span style="color: #008000;">mmorp </span>then understand it is a level but in this it is a game screen.  For example, if you play argry bird after stage 1, you will see that stage 2 is the Level I mentioned here.  Without further ado, let&#8217;s get started.</strong></p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> of the <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<h2 id="ftoc-tao-sence-moi" class="ftwp-heading"><strong>Create New Sense</strong></h2>
<p>The first step is to create a new sense for yourself with the button &#8220;<strong>+</strong>” next to the sence tab <strong>World</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage001xx.png" rel="noopener" class="local-link"><img decoding="async" class="aligncenter wp-image-18609 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image001xx.png" alt="Move between levels" width="540" height="406" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image001xx.png 540w, https://anonyviet.com/wp-content/uploads/2020/03/image001xx-300x226.png 300w" sizes="(max-width: 540px) 100vw, 540px" title="[Lập Trình Game]  Lesson 7: Moving between levels when completing a mission 27"/></a></p>
<p>Okay like this:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage002xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18610 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image002xx.jpg" alt="programming godot game through level" width="625" height="343" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image002xx.jpg 625w, https://anonyviet.com/wp-content/uploads/2020/03/image002xx-300x165.jpg 300w" sizes="auto, (max-width: 625px) 100vw, 625px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 28"/></a></p>
<p>Choose for yourself <strong>Other Node</strong> then press enter.Note select other node then press <strong>enter</strong> don&#8217;t press anything else. It will give you the black button</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage003xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18611" src="https://anonyviet.com/wp-content/uploads/2020/03/image003xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 22" width="261" height="289" title="[Lập Trình Game]  Lesson 7: Move between levels when completing quests 29"/></a></p>
<p>And we&#8217;ll need to save <strong>Node Player</strong> and <strong>Node Tilemap</strong> about as <strong>.tscn </strong>to be able to put it into another sence without redoing it. And the like <strong>Node</strong> other like <strong>enemy</strong> nice <strong>trap</strong></p>
<p>By the following way:</p>
<p>You right click on <strong>Node Player And Node Tilemap </strong>Choose for yourself <strong>Save Branch As Sense</strong></p>
<p><strong><u>That means it will save the node you just selected as tscn and in this tscn you can put your node in any sence without doing another one.</u></strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage004xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18612 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image004xx.jpg" alt="Move between levels when completing missions" width="624" height="351" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image004xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image004xx-300x169.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 30"/></a></p>
<p>You can leave it anywhere.  But remember to create a folder containing files like this for compactness.</p>
<p>Here I will save it in the folder <strong>tscn</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage005xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18591" src="https://anonyviet.com/wp-content/uploads/2020/03/image005xx.jpg" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 23" width="624" height="342" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image005xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image005xx-300x164.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 31"/></a></p>
<p>In the folder you will see there <strong>2 tscn</strong> just saved as <strong>Tilemap</strong> and <strong>Player</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage006xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18592" src="https://anonyviet.com/wp-content/uploads/2020/03/image006xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing task 24" width="201" height="148" title="[Lập Trình Game]  Lesson 7: Move between levels when completing mission 32"/></a></p>
<p>And next is <strong>Import Tscn</strong> enter <strong>sense</strong></p>
<p>Choose the one in the picture:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage007xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18593" src="https://anonyviet.com/wp-content/uploads/2020/03/image007xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing the mission 25" width="266" height="372" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image007xx.png 266w, https://anonyviet.com/wp-content/uploads/2020/03/image007xx-215x300.png 215w" sizes="auto, (max-width: 266px) 100vw, 266px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 33"/></a></p>
<p style="text-align: center;"><strong>==></strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage008xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18594" src="https://anonyviet.com/wp-content/uploads/2020/03/image008xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing missions 26" width="262" height="371" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image008xx.png 262w, https://anonyviet.com/wp-content/uploads/2020/03/image008xx-212x300.png 212w" sizes="auto, (max-width: 262px) 100vw, 262px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 34"/></a></p>
<p>And here you will see there are 2-4 <strong>node</strong> It depends on your tscn. Mine has 3:</p>
<ul>
<li>1 is <strong>Player</strong>.</li>
<li>2 is <strong>TileMap</strong>.</li>
<li>3 Is Level 1 is <strong>World</strong></li>
</ul>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage009xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18595" src="https://anonyviet.com/wp-content/uploads/2020/03/image009xx.jpg" alt="[Lập Trình Game]  Lesson 7: Moving between levels when completing a mission 27" width="624" height="344" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image009xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image009xx-300x165.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 35"/></a></p>
<p>You guys Instance 2 is <strong>Player</strong> and <strong>TileMap</strong> come in</p>
<p>And you&#8217;ll see it&#8217;s like <strong>old sense</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage010xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18596" src="https://anonyviet.com/wp-content/uploads/2020/03/image010xx.jpg" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 28" width="624" height="306" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image010xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image010xx-300x147.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing mission 36"/></a></p>
<p><strong>Note: In tilemap you may not need to save it as tscn anymore, just create a tilemap node and then enter the tileset and design a new level, if you want this sence to be different</strong></p>
<p>Well, you guys like to save this sence 2 for yourself as level 2 and save it in a certain folder, mine is in the sence folder and Click <strong>Ctrl + WILL</strong> to save</p>
<p>And below is my level 2.  Next we will create an object that moves between levels</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage011xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18597" src="https://anonyviet.com/wp-content/uploads/2020/03/image011xx.jpg" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing quests 29" width="624" height="378" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image011xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image011xx-300x182.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing the mission 37"/></a></p>
<h2 id="ftoc-tao-object-di-chuyen-sence" class="ftwp-heading"><strong>Creating Sense Move Object</strong></h2>
<p>To move between levels you will need to create a Move Sense Object.  First, you create your own <strong>node area2D</strong> live <strong>sense 1</strong> Please</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage012xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18598" src="https://anonyviet.com/wp-content/uploads/2020/03/image012xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 30" width="480" height="309" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image012xx.png 480w, https://anonyviet.com/wp-content/uploads/2020/03/image012xx-300x193.png 300w" sizes="auto, (max-width: 480px) 100vw, 480px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing mission 38"/></a></p>
<p>Add me 2 in Area 2D</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage013xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18599" src="https://anonyviet.com/wp-content/uploads/2020/03/image013xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 31" width="248" height="172" title="[Lập Trình Game]  Lesson 7: Move between levels when completing mission 39"/></a></p>
<p>In the Sprite section, you put your photos in and you can find them online</p>
<p>And here is my picture:</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage014xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18600" src="https://anonyviet.com/wp-content/uploads/2020/03/image014xx.jpg" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing mission 32" width="624" height="329" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image014xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image014xx-300x158.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 40"/></a></p>
<p>After running the game</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage015xx.jpg" rel="noopener" class="local-link"><img alt="[Lập Trình Game] Lesson 7: Move between levels when completing a mission" title="[Lập Trình Game] Lesson 7: Move between levels when completing a mission" post-id="8360" fifu-featured="1" decoding="async" loading="lazy" class="aligncenter size-full wp-image-18601" src="https://anonyviet.com/wp-content/uploads/2020/03/image015xx.jpg" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 33" width="624" height="388" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image015xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image015xx-300x187.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 41"/></a></p>
<p>Next, you create yourself a new script in Area2D</p>
<p>Then the code is as follows</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage016xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18602" src="https://anonyviet.com/wp-content/uploads/2020/03/image016xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 34" width="501" height="223" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image016xx.png 501w, https://anonyviet.com/wp-content/uploads/2020/03/image016xx-300x134.png 300w" sizes="auto, (max-width: 501px) 100vw, 501px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 42"/></a></p>
<p>Here below:</p>
<p>Part<code> export(String,FILE,"*.tscn") var next_world</code> this is the part it will take this out of the node&#8217;s settings and you can put tscn in there for it to point to</p>
<p><code>get_overlapping_boides</code>  is a function that helps you check the bodies inside <strong>collection bodies</strong> enter <strong>collsion</strong> it will do something.</p>
<p><code>for body in boides</code>: for body in boides (just declared above) means that if a body is inside the boides it will execute the if statement below. this body is a command of this node, the body here is <strong>kinematicbody</strong> and <strong>staticbody</strong></p>
<p><code>if body.name == player: body.name</code>  ie body and then get its name if by Player it will execute the command below.  Well, the “Player” is the name of your Player node. If your Node player has any name, you must replace it with “Player” to be effective.</p>
<p><code>get_tree.change_sence</code>  this is an order of <strong>Godot</strong> help you move from <strong>sense</strong> this is <strong>sense</strong> other <strong>(next_world)</strong> is the function we declared above <strong>export</strong>.speak for easy understanding in <strong>Export</strong> it will allow you to give <strong>1 sense</strong> Go in and then below if <strong>player</strong> touch the <strong>Object Move Sense</strong> then it will move <strong>Player</strong> arrive <strong>sense</strong> in the section <strong>Export</strong></p>
<p>Next, you save it and return to the sence, you will see there<strong> Next World</strong> live <strong>Node Area2D</strong> Right side of the Place <strong>Script Variables.</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage017xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18603" src="https://anonyviet.com/wp-content/uploads/2020/03/image017xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 35" width="209" height="316" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image017xx.png 209w, https://anonyviet.com/wp-content/uploads/2020/03/image017xx-198x300.png 198w" sizes="auto, (max-width: 209px) 100vw, 209px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing quest 43"/></a></p>
<p>Next, you click on the folder next to next world and choose the second sence</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage018xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18604" src="https://anonyviet.com/wp-content/uploads/2020/03/image018xx.jpg" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing mission 36" width="624" height="331" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image018xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image018xx-300x159.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Moving between levels when completing missions 44"/></a></p>
<p>And it will be</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage019xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18605" src="https://anonyviet.com/wp-content/uploads/2020/03/image019xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing the mission 37" width="195" height="97" title="[Lập Trình Game]  Lesson 7: Move between levels when completing tasks 45"/></a></p>
<p>Ah and we have to set collection for <strong>area2D</strong> Then the Player can move to another level</p>
<p>I have set it up and it can move to another level</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage020xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18606" src="https://anonyviet.com/wp-content/uploads/2020/03/image020xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing mission 38" width="246" height="207" title="[Lập Trình Game]  Lesson 7: Moving between levels when completing a mission 46"/></a></p>
<p>And if you want better, you can do the following:</p>
<p><strong>Set limit camera</strong> How much is it on the right, then adjust <strong>collsion</strong> of the <strong>sprite area2d</strong> behind the camera limit.  When the camera reaches the number you set it will no longer move and after you move behind the limit camera player will be moved.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage021xx.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18607" src="https://anonyviet.com/wp-content/uploads/2020/03/image021xx.png" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing mission 39" width="457" height="564" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image021xx.png 457w, https://anonyviet.com/wp-content/uploads/2020/03/image021xx-243x300.png 243w" sizes="auto, (max-width: 457px) 100vw, 457px" title="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 47"/></a></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage022xx.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18608" src="https://anonyviet.com/wp-content/uploads/2020/03/image022xx.jpg" alt="[Lập Trình Game]  Lesson 7: Move between levels when completing a mission 40" width="624" height="381" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image022xx.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image022xx-300x183.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Lesson 7: Moving between levels when completing a task 48"/></a></p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;18590&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-lesson-7-move-between-levels-when-completing-a-mission/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/03/image015xx.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập Trình Game]Lesson 8: Creating a Background for Sense</title>
		<link>https://en.anonyviet.com/lap-trinh-gamelesson-8-creating-a-background-for-sense/</link>
					<comments>https://en.anonyviet.com/lap-trinh-gamelesson-8-creating-a-background-for-sense/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 10:40:28 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[creating]]></category>
		<category><![CDATA[GameLesson]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[Sense]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8341</guid>

					<description><![CDATA[Continuing the series, I will guide you to create the background for the sence of the Game. Background (background) is very important in decorating the game to avoid boredom. Normally, you will see the background inside any game, right, if you don&#8217;t understand, you can see the picture below, which I&#8217;m sure most of you [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div id="ftwp-postcontent">
<p><strong>Continuing the series, I will guide you to create the background for the sence of the Game.  Background (background) is very important in decorating the game to avoid boredom.  Normally, you will see the background inside any game, right, if you don&#8217;t understand, you can see the picture below, which I&#8217;m sure most of you already know.</strong></p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> belong to <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage001.jpg" rel="noopener" class="local-link"><img decoding="async" class="aligncenter size-full wp-image-18679" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage001.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 18" width="732" height="392" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage001.jpg 732w, https://anonyviet.com/wp-content/uploads/2020/03/aimage001-300x161.jpg 300w" sizes="(max-width: 732px) 100vw, 732px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 20"/></a></p>
<p>In the picture on the Background is the picture behind those planes, if you don&#8217;t understand it, you can understand it as the background image for the game, at this point, everyone will understand.</p>
<p>So now let&#8217;s get started.</p>
<h2 id="ftoc-tao-background-cho-sence" class="ftwp-heading">Create Background For Sense</h2>
<p>To understand this article, you should read from <strong>Lesson 0</strong> of the series <a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2F%3Fs%3Dgodot" rel="noopener" class="local-link">Game programming with Godot</a> for basic knowledge.</p>
<p>To make this background is not very difficult, just need a few nodes.</p>
<p><strong>Prepare:</strong></p>
<p>+ 1 background is larger than your Window Game size or if not equal to your background, you can use 2 backgrounds or clone into 2 or reduce the map.</p>
<p>Here I have a background, you can go online to record the game2d background and then click on the image to come out and save it to your computer, but remember to see which image is larger than the game to see the size of the game window you make. as follows.</p>
<p>Click <strong>Project > project settings</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage002.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18680" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage002.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 19" width="624" height="351" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage002.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage002-300x169.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 21"/></a></p>
<p>Scroll down to find and select Window</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage003.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18681" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage003.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 20" width="624" height="379" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage003.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage003-300x182.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background For Sense 22"/></a></p>
<p>Part:</p>
<ul>
<li>Width: width</li>
<li>Height: width</li>
</ul>
<p>So we will have 1024×600 so what do you find equal or more than 1 bit smaller is ok.</p>
<p>So now we&#8217;re going to start</p>
<p>The first step into a scene you need to add a background</p>
<p>Find and choose for yourself <strong>ParallaxBackground</strong> and <strong>ParallaxLayer</strong> is a child node belonging to <strong>ParallaxBackground</strong></p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage004.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18682" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage004.png" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 21" width="430" height="191" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage004.png 430w, https://anonyviet.com/wp-content/uploads/2020/03/aimage004-300x133.png 300w" sizes="auto, (max-width: 430px) 100vw, 430px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 23"/></a></p>
<p>And add one for me <strong>Sprite</strong> is a child node of <strong>ParallaxLayer</strong> or drag the background in quickly.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage005.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18683" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage005.png" alt="[Lập Trình Game]Lesson 8: Creating a Background For Sense 22" width="222" height="259" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 24"/></a></p>
<p>And Remember To Create Background we need 2 nodes ParallaxBackground and ParallaxLayer These 2 nodes always go together in creating background.</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage006.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18684" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage006.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 23" width="624" height="351" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage006.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage006-300x169.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 25"/></a></p>
<p>And drag the image onto the sprite&#8217;s texture</p>
<p>And here&#8217;s when we dropped in</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage007.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18670" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage007.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 24" width="624" height="408" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage007.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage007-300x196.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 26"/></a></p>
<p>Next let&#8217;s adjust it to fit the window game</p>
<p>Like this or whatever as long as you feel ok</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage008.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18671" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage008.png" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 25" width="479" height="334" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage008.png 479w, https://anonyviet.com/wp-content/uploads/2020/03/aimage008-300x209.png 300w" sizes="auto, (max-width: 479px) 100vw, 479px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 27"/></a></p>
<p>Now run the game</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage009.jpg" rel="noopener" class="local-link"><img alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense" post-id="8341" fifu-featured="1" decoding="async" loading="lazy" class="aligncenter size-full wp-image-18672" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage009.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 26" width="624" height="376" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage009.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage009-300x181.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 28"/></a></p>
<p>It looks blurry so we&#8217;ll import 2D again.</p>
<p>Note: If you are blurry, please re-import, if not, you don&#8217;t need to re-import</p>
<p>Import 2D pixels or 2D</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage010.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18673" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage010.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 27" width="624" height="351" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage010.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage010-300x169.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 29"/></a></p>
<h2 id="ftoc-save-background" class="ftwp-heading">Save background</h2>
<p>Next we will save it under tscn so that we can put it in another sence without creating a new one.</p>
<p>Well, remember to lock the scene, lock it by pressing the padlock icon and the button next to the one with 4 white dots and a cross in it.</p>
<p>Save<a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage011.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18674" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage011.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 28" width="624" height="351" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage011.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage011-300x169.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 30"/></a></p>
<p>Name to save</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage012.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18675" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage012.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 29" width="624" height="335" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage012.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage012-300x161.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background For Sense 31"/></a></p>
<p>And instance it with the instance button as shown below (blue button)</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage013.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18676" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage013.png" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 30" width="255" height="340" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage013.png 255w, https://anonyviet.com/wp-content/uploads/2020/03/aimage013-225x300.png 225w" sizes="auto, (max-width: 255px) 100vw, 255px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 32"/></a></p>
<p>Select the background just Saved</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage014.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18677" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage014.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background For Sense 31" width="624" height="359" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage014.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage014-300x173.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 33"/></a></p>
<p>And so we have the background for another sence easily</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Faimage015.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter size-full wp-image-18678" src="https://anonyviet.com/wp-content/uploads/2020/03/aimage015.jpg" alt="[Lập Trình Game]Lesson 8: Creating a Background for Sense 32" width="624" height="281" srcset="https://anonyviet.com/wp-content/uploads/2020/03/aimage015.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/aimage015-300x135.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]Lesson 8: Creating a Background for Sense 34"/></a></p>
<p>In the next lesson 9 will be how to create the menu ^^</p>
<p style="text-align: right;"><strong>Deathgm!</strong></p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;18669&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-gamelesson-8-creating-a-background-for-sense/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/03/aimage009.jpg" medium="image"></media:content>
            	</item>
		<item>
		<title>[Lập Trình Game] Display FPS for games using Godot Engine</title>
		<link>https://en.anonyviet.com/lap-trinh-game-display-fps-for-games-using-godot-engine/</link>
					<comments>https://en.anonyviet.com/lap-trinh-game-display-fps-for-games-using-godot-engine/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 02 Feb 2023 08:12:24 +0000</pubDate>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[Engine]]></category>
		<category><![CDATA[FPS]]></category>
		<category><![CDATA[Game]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[Godot]]></category>
		<category><![CDATA[lập]]></category>
		<category><![CDATA[trình]]></category>
		<guid isPermaLink="false">https://en.anonyviet.com/?p=8293</guid>

					<description><![CDATA[FPS (frames per second) aka frames per second. The more frames your computer displays in a second, the smoother the game will be. FPS depends on network speed and computer hardware. To display the FPS of the Game programmed by you with Godot Engine, please follow the instructions below. Join the channel Telegram belong to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p></p>
<div>
<p><strong>FPS (frames per second) aka frames per second.  The more frames your computer displays in a second, the smoother the game will be.  FPS depends on network speed and computer hardware.  To display the FPS of the Game programmed by you with Godot Engine, please follow the instructions below.</strong></p>
<div class="code-block code-block-16" style="margin: 8px 0; clear: both;">
<div align="center">
<table class=" aligncenter" style="background-color: #c0c0c0; border-collapse: collapse; width: 59.9985%;">
<tbody>
<tr>
<td style="width: 100%; text-align: center;"><span style="font-size: 12pt;"><strong>Join the channel <span style="color: #0000ff;">Telegram</span> belong to <span style="color: #008080;">AnonyViet </span> 👉 <span style="text-decoration: underline;"><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Ft.me%2Fanonyvietchat" class="local-link" rel="noopener">Link</a></span>  👈</strong></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Display FPS for games using Godot Engine</h2>
<p><strong>FPS</strong></p>
<p>First of all, you have to create 2 Nodes for yourself <strong>CanvasLayer</strong>  and  <strong>label</strong>. <strong>Label</strong> is a child node of <strong>canvaslayer</strong></p>
<p>And I renamed the label -> fps label</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage001-1.png" rel="noopener" class="local-link"><img decoding="async" class="aligncenter wp-image-18799 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image001-1.png" alt="Display FPS for games using Godot Engine" width="260" height="264" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image001-1.png 260w, https://anonyviet.com/wp-content/uploads/2020/03/image001-1-75x75.png 75w" sizes="(max-width: 260px) 100vw, 260px" title="[Lập Trình Game]  Display FPS for games using Godot Engine 9"/></a></p>
<p>You create yourself a script in Node <strong>World</strong></p>
<p>In the declaration section, you declare yourself as follows:</p>
<p><code>onready var fps_label = get_node("CanvasLayer/fps_label")</code></p>
<p><code>get_node()</code>  is to get your node address</p>
<p><code>onready var</code>  is to declare a variable that is always available eg like this:</p>
<ul>
<li>The normal var is a gun without ammo</li>
<li>Onready var is a gun that is ready to be loaded</li>
<li>Declare var in <code>_physical_process</code> then only when <code>physical_process</code> works then var it works</li>
</ul>
<p>Add yourself a function <code>func _process(delta)</code>:</p>
<p><code>_process(delta</code><strong><code>)</code>: is the function called on every idle frame</strong></p>
<p><code>_ physical _process</code>: <strong>is 1 function call on every physical frame </strong></p>
<p>You can look it up in godot&#8217;s documentation: <a target="_blank" href="https://en.anonyviet.com/next-link/?url=https%3A%2F%2Fdocs.godotengine.org%2Fen%2F3.0%2Fclasses%2Fclass_node.html%23class-node-process" rel="noopener external nofollow" class="ext-link" onclick="this.target='_blank';">https://docs.godotengine.org/en/3.0/classes/class_node.html#class-node-process</a></p>
<p>And if you use the function <code>_process(delta)</code>: you need to enable it in func _ready function with command <code>set_process(true)</code></p>
<p>And back to the main part.</p>
<p>LIVE<code> _process</code> you guys type yourself</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage002-1.png" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18800 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image002-1.png" alt="programming code to display FPS Godot Engine" width="646" height="276" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image002-1.png 646w, https://anonyviet.com/wp-content/uploads/2020/03/image002-1-300x128.png 300w" sizes="auto, (max-width: 646px) 100vw, 646px" title="[Lập Trình Game]  Display FPS for games using Godot Engine 10"/></a></p>
<p><code>func _process(delta):</code></p>
<p><code>fps_label.set_text("FPS: " + str(Engine.get_frames_per_second()))</code></p>
<p>After typing and running the game, the fps will be displayed</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2FFPS-godot-engine.jpg" rel="noopener" class="local-link"><img alt="[Lập Trình Game] Display FPS for games using Godot Engine" title="[Lập Trình Game] Display FPS for games using Godot Engine" post-id="8293" fifu-featured="1" decoding="async" loading="lazy" class="aligncenter wp-image-18798 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/FPS-godot-engine.jpg" alt="[Lập Trình Game] Display FPS for games using Godot Engine" title="[Lập Trình Game] Display FPS for games using Godot Engine" width="495" height="309" srcset="https://anonyviet.com/wp-content/uploads/2020/03/FPS-godot-engine.jpg 495w, https://anonyviet.com/wp-content/uploads/2020/03/FPS-godot-engine-300x187.jpg 300w" sizes="auto, (max-width: 495px) 100vw, 495px" title="[Lập Trình Game]  Display FPS for games using Godot Engine 11"/></a></p>
<p><strong>Note: You have to change the position of the label if you want to see the fps</strong></p>
<p>And you can also print FPS to debug by the following way</p>
<p>Project > Project Setting > Find FPS > click Debug Settings > Click Print FPS On > run the game and notice the debug will see the fps displayed</p>
<p><a target="_blank" href="https://en.anonyviet.com/next-link?url=https%3A%2F%2Fanonyviet.com%2Fwp-content%2Fuploads%2F2020%2F03%2Fimage004-2.jpg" rel="noopener" class="local-link"><img decoding="async" loading="lazy" class="aligncenter wp-image-18797 size-full" src="https://anonyviet.com/wp-content/uploads/2020/03/image004-2.jpg" alt="debug game godot engine" width="624" height="380" srcset="https://anonyviet.com/wp-content/uploads/2020/03/image004-2.jpg 624w, https://anonyviet.com/wp-content/uploads/2020/03/image004-2-300x183.jpg 300w" sizes="auto, (max-width: 624px) 100vw, 624px" title="[Lập Trình Game]  Display FPS for games using Godot Engine 12"/></a></p>
<div class="kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom" data-payload="{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;18796&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;100&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;5&quot;,&quot;greet&quot;:&quot;\u0110\u00e1nh gi\u00e1 b\u00e0i vi\u1ebft post&quot;,&quot;legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: 5\/5 - (100 b\u00ecnh ch\u1ecdn)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;width&quot;:&quot;142.5&quot;,&quot;_legend&quot;:&quot;B\u00e0i vi\u1ebft \u0111\u1ea1t: {score}\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}">
<p>            The article achieved: 5/5 &#8211; (100 votes)    </p>
</p></div>
<p><!-- AI CONTENT END 2 --></p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://en.anonyviet.com/lap-trinh-game-display-fps-for-games-using-godot-engine/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<media:content url="https://anonyviet.com/wp-content/uploads/2020/03/FPS-godot-engine.jpg" medium="image"></media:content>
            	</item>
	</channel>
</rss>
