<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.gideros.rocks/index.php?action=history&amp;feed=atom&amp;title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2</id>
	<title>Tuto tiny-ecs beatemup Part 10 Systems 2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gideros.rocks/index.php?action=history&amp;feed=atom&amp;title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2"/>
	<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;action=history"/>
	<updated>2026-11-17T17:16:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24723&amp;oldid=prev</id>
		<title>MoKaLux at 02:51, 6 November 2025</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24723&amp;oldid=prev"/>
		<updated>2025-11-06T02:51:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:51, 6 November 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The Systems 2 ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== The Systems 2 ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We continue adding systems to our game.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;We continue adding systems to our game.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; A System is a wrapper around function callbacks for manipulating Entities. Systems are implemented as tables that contain at least one method; an update function that takes parameters like so:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &#039;&#039;&#039;function system:update(dt)&#039;&#039;&#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; There are also a few other optional callbacks:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&#039;&#039;&#039;function system:filter(entity)&#039;&#039;&#039; Returns true if this System should include this Entity, otherwise should return false. If this isn&#039;t specified, no Entities are included in the System.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&#039;&#039;&#039;function system:onAdd(entity)&#039;&#039;&#039; Called when an Entity is added to the System.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&#039;&#039;&#039;function system:onRemove(entity)&#039;&#039;&#039; Called when an Entity is removed from the System.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&#039;&#039;&#039;function system:onModify(dt)&#039;&#039;&#039; Called when the System is modified by adding or removing Entities from the System.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&#039;&#039;&#039;function system:onAddToWorld(world)&#039;&#039;&#039; Called when the System is added to the World, before any entities are added to the system.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&#039;&#039;&#039;function system:onRemoveFromWorld(world)&#039;&#039;&#039; Called when the System is removed from the world, after all Entities are removed from the System.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&#039;&#039;&#039;function system:preWrap(dt)&#039;&#039;&#039; Called on each system before update is called on any system.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; *&#039;&#039;&#039;function system:postWrap(dt)&#039;&#039;&#039; Called on each system in reverse order after update is called on each system.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &#039;&#039;&#039;Please see [[Tiny-ecs#System_functions]] for more information&#039;&#039;&#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== sAnimation.lua ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== sAnimation.lua ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24086&amp;oldid=prev</id>
		<title>MoKaLux at 19:33, 23 November 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24086&amp;oldid=prev"/>
		<updated>2024-11-23T19:33:10Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:33, 23 November 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l604&quot;&gt;Line 604:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 604:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* finally we set the actor position and flip its bitmap in the direction it is going&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* finally we set the actor position and flip its bitmap in the direction it is going&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* I experimented with &amp;#039;&amp;#039;&amp;#039;asyncCall&amp;#039;&amp;#039;&amp;#039; to test if we could gain some frames per second ;-)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* I experimented with &amp;#039;&amp;#039;&amp;#039;asyncCall&amp;#039;&amp;#039;&amp;#039; to test if we could gain some frames per second ;-)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== XXX.lua ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Let&#039;s quickly add the Shadow System. &quot;&#039;&#039;&#039;sShadow.lua&#039;&#039;&#039;&quot; in the &#039;&#039;&#039;&quot;_S&quot;&#039;&#039;&#039; folder. The code:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;syntaxhighlight lang=&quot;lua&quot;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;This System adds a shadow below an Entity. If the Entity is in a jump state, we update the shadow only on the x axis.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Next? ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Next? ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Systems are fairly straight forward &lt;/del&gt;and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;fairly short for what they can achieve.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Next we add the systems for the breakable objects &lt;/ins&gt;and the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;collectibles and &lt;/ins&gt;we &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;are almost done with the game!&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;We have covered &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;first set of systems, &lt;/del&gt;we &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;have a couple more to add.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Prev.: [[Tuto tiny-ecs beatemup Part 9 Systems]]&amp;lt;/br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Prev.: [[Tuto tiny-ecs beatemup Part 9 Systems]]&amp;lt;/br&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Next: [[Tuto tiny-ecs beatemup Part 11 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;XXX&lt;/del&gt;]]&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&#039;&#039;&#039;Next: [[Tuto tiny-ecs beatemup Part 11 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Systems 3&lt;/ins&gt;]]&#039;&#039;&#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;[[Tutorial - tiny-ecs beatemup]]&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;[[Tutorial - tiny-ecs beatemup]]&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{GIDEROS IMPORTANT LINKS}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{GIDEROS IMPORTANT LINKS}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24084&amp;oldid=prev</id>
		<title>MoKaLux: wip</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24084&amp;oldid=prev"/>
		<updated>2024-11-23T19:21:40Z</updated>

		<summary type="html">&lt;p&gt;wip&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:21, 23 November 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l544&quot;&gt;Line 544:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 544:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* we also separate the ground attacks from the jump attacks&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* we also separate the ground attacks from the jump attacks&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;XXX&lt;/del&gt;.lua ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sCollision&lt;/ins&gt;.lua ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&quot;&#039;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sAI&lt;/del&gt;.lua&#039;&#039;&#039;&quot; in the &#039;&#039;&#039;&quot;_S&quot;&#039;&#039;&#039; folder. The code:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&quot;&#039;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sCollision&lt;/ins&gt;.lua&#039;&#039;&#039;&quot; in the &#039;&#039;&#039;&quot;_S&quot;&#039;&#039;&#039; folder. The code:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;SCollision = Core.class()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;function SCollision:init(xtiny, xbworld) -- tiny function&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	xtiny.processingSystem(self) -- called once on init and every update&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	self.bworld = xbworld&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;function SCollision:filter(ent) -- tiny function&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	return ent.collbox and ent.body&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;function SCollision:onAdd(ent) -- tiny function&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;function SCollision:onRemove(ent) -- tiny function&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;local col -- cbump perfs?&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;function SCollision:process(ent, dt) -- tiny function&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	local function fun()&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		-- collision filter&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local function collisionfilter(item, other) -- &quot;touch&quot;, &quot;cross&quot;, &quot;slide&quot;, &quot;bounce&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			if item.isactionjump1 or other.isactionjump1 or&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;				item.isactionjumppunch1 or other.isactionjumppunch1 or&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;				item.isactionjumpkick1 or other.isactionjumpkick1 or&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;				item.isdead or other.isdead then return nil&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			elseif item.iscollectible or other.iscollectible then return &quot;cross&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			end return &quot;slide&quot;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		-- cbump&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local goalx = ent.pos.x + ent.body.vx * dt&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local goaly = ent.pos.y + ent.body.vy&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		local nextx, nexty, collisions, len = self.bworld:move(ent, goalx, goaly, collisionfilter)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		-- collisions&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		for i = 1, len do&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			col = collisions[i]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			if col.item.iscollectible and col.other.isplayer1 then col.item.isdirty = true&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			elseif col.item.isplayer1 and col.other.iscollectible then col.other.isdirty = true&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;			end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		-- move &amp;amp; flip&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		ent.pos = vector(nextx, nexty)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		ent.sprite:setPosition(ent.pos + vector(ent.collbox.w/2, -ent.h/2+ent.collbox.h/2))&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		ent.animation.bmp:setScale(ent.sx * ent.flip, ent.sy)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;		Core.yield(0.1)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;	Core.asyncCall(fun)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;end&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This System &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;controls all &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;entities with an artificial intelligence (&lt;/del&gt;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ai&lt;/del&gt;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;) id. In this System an entity can be in an &lt;/del&gt;&#039;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;idle&lt;/del&gt;&#039;&#039;&#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;state, a &lt;/del&gt;&#039;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;move&lt;/del&gt;&#039;&#039;&#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;state or an &lt;/del&gt;&#039;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;attack&lt;/del&gt;&#039;&#039;&#039; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;state. Each states are applied relative to &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;distance between &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Entity &lt;/del&gt;and the &#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;player1&lt;/del&gt;&#039;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This System &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uses &lt;/ins&gt;the &#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;Bump&#039;&#039;&#039; plugin to check for collisions between the actors collision boxes:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* runs once on init and &lt;/ins&gt;&#039;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;every game loop&lt;/ins&gt;&#039;&#039;&#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(&lt;/ins&gt;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;process&lt;/ins&gt;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* in &lt;/ins&gt;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;init&lt;/ins&gt;&#039;&#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;we pass the Bump &lt;/ins&gt;&#039;&#039;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;world&lt;/ins&gt;&#039;&#039;&#039; the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;actors live in&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* we define Bump collision filter&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* we check if player1 collides with a collectible actor and tag the collectible as dirty&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* finally we set &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;actor position &lt;/ins&gt;and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;flip its bitmap in &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;direction it is going&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* I experimented with &#039;&#039;&lt;/ins&gt;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;asyncCall&lt;/ins&gt;&#039;&#039;&#039; &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to test if we could gain some frames per second ;-)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sShadow&lt;/del&gt;.lua ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;XXX&lt;/ins&gt;.lua ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let&amp;#039;s quickly add the Shadow System. &amp;quot;&amp;#039;&amp;#039;&amp;#039;sShadow.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Let&amp;#039;s quickly add the Shadow System. &amp;quot;&amp;#039;&amp;#039;&amp;#039;sShadow.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24083&amp;oldid=prev</id>
		<title>MoKaLux: wip</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24083&amp;oldid=prev"/>
		<updated>2024-11-23T19:05:39Z</updated>

		<summary type="html">&lt;p&gt;wip&lt;/p&gt;
&lt;a href=&quot;https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;amp;diff=24083&amp;amp;oldid=24082&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24082&amp;oldid=prev</id>
		<title>MoKaLux: wip</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24082&amp;oldid=prev"/>
		<updated>2024-11-23T18:51:30Z</updated>

		<summary type="html">&lt;p&gt;wip&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:51, 23 November 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l348&quot;&gt;Line 348:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 348:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This System &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;deals with &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;player1 being hit or killed&lt;/del&gt;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;This System &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;is reponsible for moving &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;actors&lt;/ins&gt;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* runs once on init and &amp;#039;&amp;#039;&amp;#039;every game loop&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;process&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* runs once on init and &amp;#039;&amp;#039;&amp;#039;every game loop&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;process&amp;#039;&amp;#039;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* in &#039;&#039;init&#039;&#039; we add the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;camera and a sound to add some juice &lt;/del&gt;to the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;game&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* in &#039;&#039;init&#039;&#039; we add the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;map definition &lt;/ins&gt;to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;constraint &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;actors movement&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;there are 2 kind of &lt;/del&gt;hurt &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;animations depending on &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;player1 health &lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;washurt&#039;&#039; and &#039;&#039;wasbadlyhurt&#039;&#039;&lt;/del&gt;)&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;if an actor is &lt;/ins&gt;hurt &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;we stop its movement&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;when &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;player1 is hit, we add a camera shake &lt;/del&gt;and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;play some sound&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* if an actor is within &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;map definition we move it &lt;/ins&gt;(&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;player with keyboard, enemies with AI&lt;/ins&gt;)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;we update the &lt;/del&gt;&#039;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;HUD&#039;&#039;&#039;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;then there are &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;attacks: ground attacks &lt;/ins&gt;and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jump attacks&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* when the player1 is dead &lt;/del&gt;we &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;play a death sequence and restart the current level&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;finally sometimes an actor doesn&lt;/ins&gt;&#039;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;t land after a jump attack so &lt;/ins&gt;we &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;force it to do so&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sNmes&lt;/del&gt;.lua ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;XXX&lt;/ins&gt;.lua ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;quot;&amp;#039;&amp;#039;&amp;#039;sNmes.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;quot;&amp;#039;&amp;#039;&amp;#039;sNmes.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24081&amp;oldid=prev</id>
		<title>MoKaLux: wip</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24081&amp;oldid=prev"/>
		<updated>2024-11-22T22:22:21Z</updated>

		<summary type="html">&lt;p&gt;wip&lt;/p&gt;
&lt;a href=&quot;https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;amp;diff=24081&amp;amp;oldid=24078&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24078&amp;oldid=prev</id>
		<title>MoKaLux: wip</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_tiny-ecs_beatemup_Part_10_Systems_2&amp;diff=24078&amp;oldid=prev"/>
		<updated>2024-11-22T19:02:46Z</updated>

		<summary type="html">&lt;p&gt;wip&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== The Systems ==&lt;br /&gt;
We have our entities, we have our components, now the systems. What is an ECS &amp;#039;&amp;#039;&amp;#039;System&amp;#039;&amp;#039;&amp;#039;?&lt;br /&gt;
&lt;br /&gt;
 A System is a wrapper around function callbacks for manipulating Entities. Systems are implemented as tables that contain at least one method; an update function that takes parameters like so:&lt;br /&gt;
 &lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;function system:update(dt)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
 There are also a few other optional callbacks:&lt;br /&gt;
 *&amp;#039;&amp;#039;&amp;#039;function system:filter(entity)&amp;#039;&amp;#039;&amp;#039; Returns true if this System should include this Entity, otherwise should return false. If this isn&amp;#039;t specified, no Entities are included in the System.&lt;br /&gt;
 *&amp;#039;&amp;#039;&amp;#039;function system:onAdd(entity)&amp;#039;&amp;#039;&amp;#039; Called when an Entity is added to the System.&lt;br /&gt;
 *&amp;#039;&amp;#039;&amp;#039;function system:onRemove(entity)&amp;#039;&amp;#039;&amp;#039; Called when an Entity is removed from the System.&lt;br /&gt;
 *&amp;#039;&amp;#039;&amp;#039;function system:onModify(dt)&amp;#039;&amp;#039;&amp;#039; Called when the System is modified by adding or removing Entities from the System.&lt;br /&gt;
 *&amp;#039;&amp;#039;&amp;#039;function system:onAddToWorld(world)&amp;#039;&amp;#039;&amp;#039; Called when the System is added to the World, before any entities are added to the system.&lt;br /&gt;
 *&amp;#039;&amp;#039;&amp;#039;function system:onRemoveFromWorld(world)&amp;#039;&amp;#039;&amp;#039; Called when the System is removed from the world, after all Entities are removed from the System.&lt;br /&gt;
 *&amp;#039;&amp;#039;&amp;#039;function system:preWrap(dt)&amp;#039;&amp;#039;&amp;#039; Called on each system before update is called on any system.&lt;br /&gt;
 *&amp;#039;&amp;#039;&amp;#039;function system:postWrap(dt)&amp;#039;&amp;#039;&amp;#039; Called on each system in reverse order after update is called on each system.&lt;br /&gt;
 &lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;Please see [[Tiny-ecs#System_functions]] for more information&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
That looks scary but worry not we won&amp;#039;t use all the callback functions :-)&lt;br /&gt;
&lt;br /&gt;
To put it simple a &amp;#039;&amp;#039;&amp;#039;System&amp;#039;&amp;#039;&amp;#039; manipulates entities. Let&amp;#039;s see our first &amp;#039;&amp;#039;&amp;#039;System&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== sDrawable.lua ==&lt;br /&gt;
Please create a file &amp;quot;&amp;#039;&amp;#039;&amp;#039;sDrawable.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder and the code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
SDrawable = Core.class()&lt;br /&gt;
&lt;br /&gt;
function SDrawable:init(xtiny) -- tiny function&lt;br /&gt;
	xtiny.system(self) -- called only once on init (no update)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SDrawable:filter(ent) -- tiny function&lt;br /&gt;
	return ent.spritelayer and ent.sprite&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SDrawable:onAdd(ent) -- tiny function&lt;br /&gt;
--	print(&amp;quot;SDrawable:onAdd(ent)&amp;quot;)&lt;br /&gt;
	ent.spritelayer:addChild(ent.sprite)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SDrawable:onRemove(ent) -- tiny function&lt;br /&gt;
--	print(&amp;quot;SDrawable:onRemove(ent)&amp;quot;)&lt;br /&gt;
	ent.spritelayer:removeChild(ent.sprite)&lt;br /&gt;
	-- cleaning?&lt;br /&gt;
	ent.sprite = nil&lt;br /&gt;
	ent = nil&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What it does:&lt;br /&gt;
* runs only once when it is called&lt;br /&gt;
* affects only entities which have a spritelayer variable (id) &amp;#039;&amp;#039;&amp;#039;and&amp;#039;&amp;#039;&amp;#039; a sprite variable (id)&lt;br /&gt;
* when an Entity is added to tiny-ecs &amp;#039;&amp;#039;&amp;#039;World&amp;#039;&amp;#039;&amp;#039;, the &amp;#039;&amp;#039;&amp;#039;System&amp;#039;&amp;#039;&amp;#039; adds the Entity to its Sprite layer&lt;br /&gt;
* when an Entity is removed from tiny-ecs &amp;#039;&amp;#039;&amp;#039;World&amp;#039;&amp;#039;&amp;#039;, the &amp;#039;&amp;#039;&amp;#039;System&amp;#039;&amp;#039;&amp;#039; removes the Entity from its Sprite layer&lt;br /&gt;
&lt;br /&gt;
In other words, the &amp;#039;&amp;#039;&amp;#039;System&amp;#039;&amp;#039;&amp;#039; adds an Entity to a Sprite layer when the Entity is added to tiny-ecs World, and removes it from that Sprite layer when the Entity is destroyed.&lt;br /&gt;
&lt;br /&gt;
== sPlayer1Control.lua ==&lt;br /&gt;
I am adding systems in an order that seems logical and helps in understanding the making of the game. The next &amp;#039;&amp;#039;&amp;#039;System&amp;#039;&amp;#039;&amp;#039; we add is the player1 controller.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;#039;&amp;#039;&amp;#039;sPlayer1Control.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
SPlayer1Control = Core.class()&lt;br /&gt;
&lt;br /&gt;
function SPlayer1Control:init(xtiny, xplayer1inputlayer) -- tiny function&lt;br /&gt;
	xtiny.system(self) -- called only once on init (no update)&lt;br /&gt;
	self.player1inputlayer = xplayer1inputlayer&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SPlayer1Control:filter(ent) -- tiny function&lt;br /&gt;
	return ent.isplayer1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SPlayer1Control:onAdd(ent) -- tiny function&lt;br /&gt;
	self.player1inputlayer:addEventListener(Event.KEY_DOWN, function(e)&lt;br /&gt;
		if ent.currlives &amp;gt; 0 then&lt;br /&gt;
			if e.keyCode == KeyCode.LEFT or e.keyCode == g_keyleft then ent.isleft = true end&lt;br /&gt;
			if e.keyCode == KeyCode.RIGHT or e.keyCode == g_keyright then ent.isright = true end&lt;br /&gt;
			if e.keyCode == KeyCode.UP or e.keyCode == g_keyup then ent.isup = true end&lt;br /&gt;
			if e.keyCode == KeyCode.DOWN or e.keyCode == g_keydown then ent.isdown = true end&lt;br /&gt;
			-- ACTIONS:&lt;br /&gt;
			-- isactionpunch1, isactionpunch2, isactionjumppunch1,&lt;br /&gt;
			-- isactionkick1, isactionkick2, isactionjumpkick1,&lt;br /&gt;
			-- isactionjump1&lt;br /&gt;
			if e.keyCode == g_keyaction1 then&lt;br /&gt;
				ent.animation.frame = 0&lt;br /&gt;
				ent.isactionpunch1 = true&lt;br /&gt;
			elseif e.keyCode == g_keyaction2 then&lt;br /&gt;
				ent.animation.frame = 0&lt;br /&gt;
				ent.isactionkick1 = true&lt;br /&gt;
			end&lt;br /&gt;
			if e.keyCode == g_keyaction3 then&lt;br /&gt;
				if ent.body.isonfloor then&lt;br /&gt;
					ent.animation.frame = 0&lt;br /&gt;
					ent.positionystart = ent.pos.y&lt;br /&gt;
					ent.body.isonfloor = false&lt;br /&gt;
					ent.body.isgoingup = true&lt;br /&gt;
					ent.isactionjump1 = true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
	self.player1inputlayer:addEventListener(Event.KEY_UP, function(e)&lt;br /&gt;
		if ent.currlives &amp;gt; 0 then&lt;br /&gt;
			if e.keyCode == KeyCode.LEFT or e.keyCode == g_keyleft then ent.isleft = false end&lt;br /&gt;
			if e.keyCode == KeyCode.RIGHT or e.keyCode == g_keyright then ent.isright = false end&lt;br /&gt;
			if e.keyCode == KeyCode.UP or e.keyCode == g_keyup then ent.isup = false end&lt;br /&gt;
			if e.keyCode == KeyCode.DOWN or e.keyCode == g_keydown then ent.isdown = false end&lt;br /&gt;
--			if e.keyCode == g_keyaction1 then ent.isactionpunch1 = false end&lt;br /&gt;
--			if e.keyCode == g_keyaction2 then ent.isactionkick1 = false end&lt;br /&gt;
--			if e.keyCode == g_keyaction3 then end&lt;br /&gt;
		end&lt;br /&gt;
	end)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What it does:&lt;br /&gt;
* runs only once when it is called&lt;br /&gt;
* affects only entities with the &amp;#039;&amp;#039;isplayer1&amp;#039;&amp;#039; id&lt;br /&gt;
* when the player1 Entity is added to tiny-ecs &amp;#039;&amp;#039;&amp;#039;World&amp;#039;&amp;#039;&amp;#039;, the System registers KEY_DOWN and KEY_UP events&lt;br /&gt;
&lt;br /&gt;
The System processes the user keys input and sets various flags to be processed in a future &amp;#039;&amp;#039;sDynamicBodies&amp;#039;&amp;#039; System we will add.&lt;br /&gt;
&lt;br /&gt;
== sPlayer1.lua ==&lt;br /&gt;
&amp;quot;&amp;#039;&amp;#039;&amp;#039;sPlayer1.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
SPlayer1 = Core.class()&lt;br /&gt;
&lt;br /&gt;
function SPlayer1:init(xtiny, xcamera) -- tiny function&lt;br /&gt;
	self.tiny = xtiny -- ref so we can remove entities from tiny system&lt;br /&gt;
	self.tiny.processingSystem(self) -- called once on init and every update&lt;br /&gt;
	-- fx&lt;br /&gt;
	self.camera = xcamera -- camera shake&lt;br /&gt;
	-- sfx&lt;br /&gt;
	self.snd = Sound.new(&amp;quot;audio/sfx/sfx_deathscream_human14.wav&amp;quot;)&lt;br /&gt;
	self.channel = self.snd:play(0, false, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SPlayer1:filter(ent) -- tiny function&lt;br /&gt;
	return ent.isplayer1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SPlayer1:onAdd(ent) -- tiny function&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SPlayer1:onRemove(ent) -- tiny function&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local resetanim = true&lt;br /&gt;
function SPlayer1:process(ent, dt) -- tiny function&lt;br /&gt;
	-- hurt fx&lt;br /&gt;
	if ent.washurt and ent.washurt &amp;gt; 0 and not (ent.wasbadlyhurt and ent.wasbadlyhurt &amp;gt; 0) then&lt;br /&gt;
		ent.washurt -= 1&lt;br /&gt;
		ent.animation.curranim = g_ANIM_HURT_R&lt;br /&gt;
		if ent.washurt &amp;lt; ent.recovertimer*0.5 then ent.hitfx:setVisible(false) end&lt;br /&gt;
		if ent.washurt &amp;lt;= 0 then&lt;br /&gt;
			ent.sprite:setColorTransform(1, 1, 1, 1)&lt;br /&gt;
			self.camera:setZoom(1) -- zoom&lt;br /&gt;
		end&lt;br /&gt;
	elseif ent.wasbadlyhurt and ent.wasbadlyhurt &amp;gt; 0 then&lt;br /&gt;
		ent.hitfx:setVisible(false)&lt;br /&gt;
		ent.wasbadlyhurt -= 1&lt;br /&gt;
		ent.animation.curranim = g_ANIM_LOSE1_R&lt;br /&gt;
		if ent.wasbadlyhurt &amp;lt; ent.recoverbadtimer/2 then&lt;br /&gt;
			if resetanim then&lt;br /&gt;
				resetanim = false&lt;br /&gt;
				ent.animation.frame = 0&lt;br /&gt;
			end&lt;br /&gt;
			ent.animation.curranim = g_ANIM_STANDUP_R&lt;br /&gt;
		end&lt;br /&gt;
		if ent.wasbadlyhurt &amp;lt;= 0 then&lt;br /&gt;
			ent.sprite:setColorTransform(1, 1, 1, 1)&lt;br /&gt;
			self.camera:setZoom(1) -- zoom&lt;br /&gt;
			resetanim = true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if ent.isdirty then -- hit&lt;br /&gt;
		local function map(v, minSrc, maxSrc, minDst, maxDst, clampValue)&lt;br /&gt;
			local newV = (v - minSrc) / (maxSrc - minSrc) * (maxDst - minDst) + minDst&lt;br /&gt;
			return not clampValue and newV or clamp(newV, minDst&amp;gt;&amp;lt;maxDst, minDst&amp;lt;&amp;gt;maxDst)&lt;br /&gt;
		end&lt;br /&gt;
		self.channel = self.snd:play()&lt;br /&gt;
		if self.channel then self.channel:setVolume(g_sfxvolume*0.01) end&lt;br /&gt;
		ent.hitfx:setVisible(true)&lt;br /&gt;
		ent.hitfx:setPosition(ent.pos.x+ent.collbox.w/2+(ent.headhurtbox.x*ent.flip), ent.pos.y+ent.headhurtbox.y-ent.headhurtbox.h/2)&lt;br /&gt;
		ent.spritelayer:addChild(ent.hitfx)&lt;br /&gt;
		ent.currhealth -= ent.damage&lt;br /&gt;
		local hudhealthwidth = map(ent.currhealth, 0, ent.totalhealth, 0, 100)&lt;br /&gt;
		self.tiny.hudhealth:setWidth(hudhealthwidth)&lt;br /&gt;
		if ent.currhealth &amp;lt; ent.totalhealth/3 then self.tiny.hudhealth:setColor(0xff0000)&lt;br /&gt;
		elseif ent.currhealth &amp;lt; ent.totalhealth/2 then self.tiny.hudhealth:setColor(0xff5500)&lt;br /&gt;
		else self.tiny.hudhealth:setColor(0x00ff00)&lt;br /&gt;
		end&lt;br /&gt;
		ent.washurt = ent.recovertimer -- timer for a flash effect&lt;br /&gt;
		ent.sprite:setColorTransform(2, 0, 0, 2) -- the flash effect (a bright red color)&lt;br /&gt;
		ent.isdirty = false&lt;br /&gt;
		self.camera:shake(0.6, 16) -- (duration, distance), you choose&lt;br /&gt;
		self.camera:setZoom(1.2) -- zoom&lt;br /&gt;
		if ent.currhealth &amp;lt;= 0 then&lt;br /&gt;
			ent.wasbadlyhurt = ent.recoverbadtimer -- timer for player1 to stand back up&lt;br /&gt;
			self.camera:shake(0.8, 64) -- (duration, distance), you choose&lt;br /&gt;
			ent.currlives -= 1&lt;br /&gt;
			for i = 1, ent.totallives do self.tiny.hudlives[i]:setVisible(false) end -- dirty but easy XXX&lt;br /&gt;
			for i = 1, ent.currlives do self.tiny.hudlives[i]:setVisible(true) end -- dirty but easy XXX&lt;br /&gt;
			if ent.currlives &amp;gt; 0 then&lt;br /&gt;
				ent.currhealth = ent.totalhealth&lt;br /&gt;
				hudhealthwidth = map(ent.currhealth, 0, ent.totalhealth, 0, 100)&lt;br /&gt;
				self.tiny.hudhealth:setWidth(hudhealthwidth)&lt;br /&gt;
				self.tiny.hudhealth:setColor(0x00ff00)&lt;br /&gt;
				if ent.currlives == 1 then self.tiny.hudlives[1]:setColor(0xff0000) end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if ent.currlives &amp;lt;= 0 then -- deaded&lt;br /&gt;
		-- stop all movements&lt;br /&gt;
		ent.isleft = false&lt;br /&gt;
		ent.isright = false&lt;br /&gt;
		ent.isup = false&lt;br /&gt;
		ent.isdown = false&lt;br /&gt;
		-- play dead sequence&lt;br /&gt;
		ent.isdirty = false&lt;br /&gt;
		resetanim = false&lt;br /&gt;
		ent.washurt = ent.recovertimer&lt;br /&gt;
		ent.wasbadlyhurt = ent.recoverbadtimer&lt;br /&gt;
		ent.animation.curranim = g_ANIM_LOSE1_R&lt;br /&gt;
		ent.sprite:setColorTransform(255*0.5/255, 255*0.5/255, 255*0.5/255, 1)&lt;br /&gt;
		self.camera:setZoom(1) -- zoom&lt;br /&gt;
		ent.animation.bmp:setY(ent.animation.bmp:getY()-1)&lt;br /&gt;
		if ent.animation.bmp:getY() &amp;lt; -200 then -- you choose&lt;br /&gt;
			switchToScene(LevelX.new())&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This System deals with the player1 being hit or killed:&lt;br /&gt;
* runs once on init and &amp;#039;&amp;#039;&amp;#039;every game loop&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;process&amp;#039;&amp;#039;)&lt;br /&gt;
* in &amp;#039;&amp;#039;init&amp;#039;&amp;#039; we add the camera and a sound to add some juice to the game&lt;br /&gt;
* there are 2 kind of hurt animations depending on the player1 health (&amp;#039;&amp;#039;washurt&amp;#039;&amp;#039; and &amp;#039;&amp;#039;wasbadlyhurt&amp;#039;&amp;#039;)&lt;br /&gt;
* when the player1 is hit, we add a camera shake and play some sound&lt;br /&gt;
* we update the &amp;#039;&amp;#039;&amp;#039;HUD&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* when the player1 is dead we play a death sequence and restart the current level&lt;br /&gt;
&lt;br /&gt;
== sNmes.lua ==&lt;br /&gt;
&amp;quot;&amp;#039;&amp;#039;&amp;#039;sNmes.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
SNmes = Core.class()&lt;br /&gt;
&lt;br /&gt;
local random = math.random&lt;br /&gt;
&lt;br /&gt;
function SNmes:init(xtiny, xbump) -- tiny function&lt;br /&gt;
	self.tiny = xtiny -- class ref so we can remove entities from tiny world&lt;br /&gt;
	self.tiny.processingSystem(self) -- called once on init and every update&lt;br /&gt;
	self.bworld = xbump&lt;br /&gt;
	-- sfx&lt;br /&gt;
	self.snd = Sound.new(&amp;quot;audio/sfx/sfx_deathscream_human14.wav&amp;quot;)&lt;br /&gt;
	self.channel = self.snd:play(0, false, true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SNmes:filter(ent) -- tiny function&lt;br /&gt;
	return ent.isnme&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SNmes:onAdd(ent) -- tiny function&lt;br /&gt;
	ent.flip = math.random(100)&lt;br /&gt;
	if ent.flip &amp;gt; 50 then ent.flip = 1 else ent.flip = -1 end&lt;br /&gt;
	ent.currlives = ent.totallives&lt;br /&gt;
	ent.currhealth = ent.totalhealth&lt;br /&gt;
	ent.washurt = 0&lt;br /&gt;
	ent.wasbadlyhurt = 0&lt;br /&gt;
	ent.isdead = false&lt;br /&gt;
	ent.curractiontimer = ent.actiontimer&lt;br /&gt;
	ent.positionystart = 0&lt;br /&gt;
	-- abilities&lt;br /&gt;
	ent.abilities = {}&lt;br /&gt;
	if ent.headhitboxattack1 then ent.abilities[#ent.abilities+1] = 1 end -- punch1&lt;br /&gt;
	if ent.headhitboxattack2 then ent.abilities[#ent.abilities+1] = 2 end -- punch2&lt;br /&gt;
	if ent.spinehitboxattack1 then ent.abilities[#ent.abilities+1] = 3 end -- kick1&lt;br /&gt;
	if ent.spinehitboxattack2 then ent.abilities[#ent.abilities+1] = 4 end -- kick2&lt;br /&gt;
	if ent.headhitboxjattack1 then ent.abilities[#ent.abilities+1] = 5 end -- jumppunch1&lt;br /&gt;
	if ent.spinehitboxjattack1 then ent.abilities[#ent.abilities+1] = 6 end -- jumpkick1&lt;br /&gt;
--	for k, v in pairs(ent.abilities) do print(k, v) end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SNmes:onRemove(ent) -- tiny function&lt;br /&gt;
	self.bworld:remove(ent) -- remove collision box from cbump world here!&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local resetanim = true&lt;br /&gt;
function SNmes:process(ent, dt) -- tiny function&lt;br /&gt;
	-- hurt fx&lt;br /&gt;
	if ent.washurt and ent.washurt &amp;gt; 0 and not (ent.wasbadlyhurt and ent.wasbadlyhurt &amp;gt; 0) and not ent.isdead then&lt;br /&gt;
		ent.washurt -= 1&lt;br /&gt;
		ent.animation.curranim = g_ANIM_HURT_R&lt;br /&gt;
		if ent.washurt &amp;lt; ent.recovertimer*0.5 then ent.hitfx:setVisible(false) end&lt;br /&gt;
		if ent.washurt &amp;lt;= 0 then ent.sprite:setColorTransform(1, 1, 1, 1) end&lt;br /&gt;
	elseif ent.wasbadlyhurt and ent.wasbadlyhurt &amp;gt; 0 and not ent.isdead then&lt;br /&gt;
		ent.wasbadlyhurt -= 1&lt;br /&gt;
		ent.animation.curranim = g_ANIM_LOSE1_R&lt;br /&gt;
		if ent.wasbadlyhurt &amp;lt; ent.recoverbadtimer*0.5 then&lt;br /&gt;
			ent.hitfx:setVisible(false)&lt;br /&gt;
			if resetanim then&lt;br /&gt;
				resetanim = false&lt;br /&gt;
				ent.animation.frame = 0&lt;br /&gt;
			end&lt;br /&gt;
			ent.animation.curranim = g_ANIM_STANDUP_R&lt;br /&gt;
		end&lt;br /&gt;
		if ent.wasbadlyhurt &amp;lt;= 0 then&lt;br /&gt;
			ent.sprite:setColorTransform(1, 1, 1, 1)&lt;br /&gt;
			resetanim = true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if ent.isdirty then -- hit&lt;br /&gt;
		self.channel = self.snd:play()&lt;br /&gt;
		if self.channel then self.channel:setVolume(g_sfxvolume*0.01) end&lt;br /&gt;
		ent.hitfx:setVisible(true)&lt;br /&gt;
		ent.hitfx:setPosition(ent.pos.x+ent.collbox.w/2+(ent.headhurtbox.x*ent.flip), ent.pos.y+ent.headhurtbox.y-ent.headhurtbox.h/2)&lt;br /&gt;
		ent.spritelayer:addChild(ent.hitfx)&lt;br /&gt;
		ent.currhealth -= ent.damage&lt;br /&gt;
		ent.washurt = ent.recovertimer -- timer for a flash effect&lt;br /&gt;
--		ent.sprite:setColorTransform(0, 0, 2, 3) -- the flash effect (a bright red color)&lt;br /&gt;
		ent.isdirty = false&lt;br /&gt;
		if ent.currhealth &amp;lt;= 0 then&lt;br /&gt;
			ent.wasbadlyhurt = ent.recoverbadtimer -- timer for actor to stand back up&lt;br /&gt;
			ent.currlives -= 1&lt;br /&gt;
			if ent.currlives &amp;gt; 0 then ent.currhealth = ent.totalhealth end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if ent.currlives &amp;lt;= 0 then -- deaded&lt;br /&gt;
		-- stop all movements&lt;br /&gt;
		ent.isleft = false&lt;br /&gt;
		ent.isright = false&lt;br /&gt;
		ent.isup = false&lt;br /&gt;
		ent.isdown = false&lt;br /&gt;
		-- play dead sequence&lt;br /&gt;
		ent.isdirty = false&lt;br /&gt;
		ent.washurt = ent.recovertimer&lt;br /&gt;
		ent.wasbadlyhurt = ent.recoverbadtimer&lt;br /&gt;
		-- blood&lt;br /&gt;
		if not ent.isdead then&lt;br /&gt;
			ent.hitfx:setVisible(true)&lt;br /&gt;
			ent.hitfx:setColorTransform(3, 0, 0, random(1, 3)/10) -- blood stain&lt;br /&gt;
			ent.hitfx:setPosition(ent.pos.x+ent.collbox.w/2, ent.pos.y)&lt;br /&gt;
			ent.hitfx:setRotation(random(360))&lt;br /&gt;
			ent.hitfx:setScale(random(5, 8)/10)&lt;br /&gt;
			ent.bgfxlayer:addChild(ent.hitfx)&lt;br /&gt;
			ent.isdead = true&lt;br /&gt;
		end&lt;br /&gt;
		ent.animation.curranim = g_ANIM_LOSE1_R&lt;br /&gt;
		resetanim = false -- ??? XXX&lt;br /&gt;
		ent.sprite:setColorTransform((-ent.pos.y&amp;lt;&amp;gt;ent.pos.y)/255, (-ent.pos.y&amp;lt;&amp;gt;ent.pos.y)/255, 0, 1)&lt;br /&gt;
		ent.shadow.sprite:setVisible(false)&lt;br /&gt;
		ent.pos -= vector(8*ent.flip, 8)&lt;br /&gt;
		ent.sprite:setPosition(ent.pos)&lt;br /&gt;
		ent.sprite:setScale(ent.sprite:getScale()+0.07)&lt;br /&gt;
		if ent.pos.y &amp;lt; -256 then&lt;br /&gt;
			self.tiny.tworld:removeEntity(ent) -- sprite is removed in SDrawable&lt;br /&gt;
			self.tiny.numberofnmes -= 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This System deals with the enemies being hit or killed:&lt;br /&gt;
* runs once on init and &amp;#039;&amp;#039;&amp;#039;every game loop&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;process&amp;#039;&amp;#039;)&lt;br /&gt;
* in &amp;#039;&amp;#039;init&amp;#039;&amp;#039; we add a sound to add some juice to the game&lt;br /&gt;
* &amp;#039;&amp;#039;onAdd&amp;#039;&amp;#039; some explanation below&lt;br /&gt;
* when an enemy is hit, we play some sound&lt;br /&gt;
&lt;br /&gt;
In the &amp;#039;&amp;#039;onAdd&amp;#039;&amp;#039; function it is worth noting that instead of creating all the variables for the enemies in their Entity code, I found it &amp;#039;clever&amp;#039; to put them in the enemy System as they all share the same variables.&lt;br /&gt;
&lt;br /&gt;
The other thing worth noting is an enemy ability. Depending on the attacks an Entity has, they are stored in an &amp;#039;&amp;#039;abilities&amp;#039;&amp;#039; table. In a artificial intelligence System we will add shortly, the code will iterate the &amp;#039;&amp;#039;abilities&amp;#039;&amp;#039; table and pick a random attack an Entity can perform.&lt;br /&gt;
&lt;br /&gt;
== sAI.lua ==&lt;br /&gt;
&amp;quot;&amp;#039;&amp;#039;&amp;#039;sAI.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
SAI = Core.class()&lt;br /&gt;
&lt;br /&gt;
local random = math.random&lt;br /&gt;
&lt;br /&gt;
function SAI:init(xtiny, xplayer1) -- tiny function&lt;br /&gt;
	xtiny.processingSystem(self) -- called once on init and every update&lt;br /&gt;
	self.player1 = xplayer1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SAI:filter(ent) -- tiny function&lt;br /&gt;
	return ent.ai&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SAI:onAdd(ent) -- tiny function&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SAI:onRemove(ent) -- tiny function&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local p1rangex = 192 -- 192 -- magik XXX&lt;br /&gt;
local p1hitrangex = 64 -- magik XXX&lt;br /&gt;
local p1rangey = 96 -- 96 -- magik XXX&lt;br /&gt;
local p1hitrangey = 16 -- magik XXX&lt;br /&gt;
local rndaction = 0 -- random punch/kick action&lt;br /&gt;
local p1rangetoofar = myappwidth -- disable system to save some CPU, magik XXX&lt;br /&gt;
function SAI:process(ent, dt) -- tiny function&lt;br /&gt;
	if ent.isdead then return end&lt;br /&gt;
	local function fun()&lt;br /&gt;
		-- some flags&lt;br /&gt;
		ent.doanimate = true -- to save some cpu&lt;br /&gt;
		ent.readytohit = false&lt;br /&gt;
		if (ent.pos.x &amp;gt; self.player1.pos.x + p1rangetoofar or ent.pos.x &amp;lt; self.player1.pos.x - p1rangetoofar) then&lt;br /&gt;
			ent.doanimate = false&lt;br /&gt;
			return&lt;br /&gt;
		end&lt;br /&gt;
		if (ent.pos.x &amp;gt; self.player1.pos.x + p1rangex or ent.pos.x &amp;lt; self.player1.pos.x - p1rangex) or&lt;br /&gt;
			(ent.pos.y &amp;gt; self.player1.pos.y + p1rangey or ent.pos.y &amp;lt; self.player1.pos.y - p1rangey) then -- OUTSIDE ATTACK RANGE&lt;br /&gt;
			-- idle&lt;br /&gt;
			ent.isleft, ent.isright = false, false&lt;br /&gt;
			ent.isup, ent.isdown = false, false&lt;br /&gt;
			ent.body.currspeed = ent.body.speed&lt;br /&gt;
			ent.body.currjumpspeed = ent.body.jumpspeed&lt;br /&gt;
		else -- INSIDE ATTACK RANGE&lt;br /&gt;
			-- x&lt;br /&gt;
			if ent.pos.x &amp;gt; random(self.player1.pos.x+p1hitrangex, self.player1.pos.x+p1rangex) then&lt;br /&gt;
				ent.isleft, ent.isright = true, false&lt;br /&gt;
				ent.body.currspeed = ent.body.speed * random(10, 15)*0.1 -- magik XXX&lt;br /&gt;
			elseif ent.pos.x &amp;lt; random(self.player1.pos.x-p1rangex, self.player1.pos.x-p1hitrangex) then&lt;br /&gt;
				ent.isleft, ent.isright = false, true&lt;br /&gt;
				ent.body.currspeed = ent.body.speed * random(10, 15)*0.1 -- magik XXX&lt;br /&gt;
			end&lt;br /&gt;
			-- y&lt;br /&gt;
			if ent.pos.y &amp;gt; random(self.player1.pos.y, self.player1.pos.y+p1hitrangey) then&lt;br /&gt;
				ent.isup, ent.isdown = true, false&lt;br /&gt;
				ent.body.currjumpspeed = ent.body.jumpspeed * random(10, 64) -- magik XXX&lt;br /&gt;
				ent.readytohit = true&lt;br /&gt;
			elseif ent.pos.y &amp;lt; random(self.player1.pos.y-p1hitrangey, self.player1.pos.y) then&lt;br /&gt;
				ent.isup, ent.isdown = false, true&lt;br /&gt;
				ent.body.currjumpspeed = ent.body.jumpspeed * random(10, 64) -- magik XXX&lt;br /&gt;
				ent.readytohit = true&lt;br /&gt;
			end&lt;br /&gt;
			-- nmes always face player1&lt;br /&gt;
			if not (ent.isactionjumppunch1 or ent.isactionjumpkick1) then&lt;br /&gt;
				if ent.pos.x &amp;gt; self.player1.pos.x then ent.flip = -1&lt;br /&gt;
				else ent.flip = 1&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		-- ATTACK&lt;br /&gt;
		if ent.readytohit then&lt;br /&gt;
			ent.curractiontimer -= 1&lt;br /&gt;
			if ent.curractiontimer &amp;lt; 0 then&lt;br /&gt;
				ent.animation.frame = 0&lt;br /&gt;
				rndaction = ent.abilities[random(#ent.abilities)] -- pick a random attack&lt;br /&gt;
				if rndaction == 1 and not (ent.isactionjumppunch1 or ent.isactionjumpkick1) then &lt;br /&gt;
					ent.isactionpunch1 = true&lt;br /&gt;
				elseif rndaction == 2 and not (ent.isactionjumppunch1 or ent.isactionjumpkick1) then&lt;br /&gt;
					ent.isactionpunch2 = true&lt;br /&gt;
				elseif rndaction == 3 and not (ent.isactionjumppunch1 or ent.isactionjumpkick1) then&lt;br /&gt;
					ent.isactionkick1 = true&lt;br /&gt;
				elseif rndaction == 4 and not (ent.isactionjumppunch1 or ent.isactionjumpkick1) then&lt;br /&gt;
					ent.isactionkick2 = true&lt;br /&gt;
				elseif rndaction == 5 and not (ent.isactionjumppunch1 or ent.isactionjumpkick1) then&lt;br /&gt;
					ent.positionystart = ent.pos.y&lt;br /&gt;
					ent.body.isonfloor = false&lt;br /&gt;
					ent.body.isgoingup = true&lt;br /&gt;
					ent.isactionjumppunch1 = true&lt;br /&gt;
					ent.body.currspeed *= 1+random(4)*0.1 -- randomize speed, you choose to add it and the params&lt;br /&gt;
					-- jump in the direction of the flip&lt;br /&gt;
					if ent.flip == 1 then ent.isleft = false ent.isright = true&lt;br /&gt;
					else ent.isleft = true ent.isright = false&lt;br /&gt;
					end&lt;br /&gt;
				elseif rndaction == 6 and not (ent.isactionjumppunch1 or ent.isactionjumpkick1) then&lt;br /&gt;
					ent.positionystart = ent.pos.y&lt;br /&gt;
					ent.body.isonfloor = false&lt;br /&gt;
					ent.body.isgoingup = true&lt;br /&gt;
					ent.isactionjumpkick1 = true&lt;br /&gt;
					ent.body.currspeed *= 1+random(3)*0.1 -- randomize speed, you choose to add it and the params&lt;br /&gt;
					-- jump in the direction of the flip&lt;br /&gt;
					if ent.flip == 1 then ent.isleft = false ent.isright = true&lt;br /&gt;
					else ent.isleft = true ent.isright = false&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
				ent.curractiontimer = ent.actiontimer&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		Core.yield(1)&lt;br /&gt;
	end&lt;br /&gt;
	Core.asyncCall(fun) -- profiler seems to be faster without asyncCall (because of pairs traversing?)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This System controls all the entities with an artificial intelligence (&amp;#039;&amp;#039;ai&amp;#039;&amp;#039;) id. In this System an entity can be in an &amp;#039;&amp;#039;&amp;#039;idle&amp;#039;&amp;#039;&amp;#039; state, a &amp;#039;&amp;#039;&amp;#039;move&amp;#039;&amp;#039;&amp;#039; state or an &amp;#039;&amp;#039;&amp;#039;attack&amp;#039;&amp;#039;&amp;#039; state. Each states are applied relative to the distance between the Entity and the &amp;#039;&amp;#039;player1&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
== sShadow.lua ==&lt;br /&gt;
Let&amp;#039;s quickly add the Shadow System. &amp;quot;&amp;#039;&amp;#039;&amp;#039;sShadow.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; in the &amp;#039;&amp;#039;&amp;#039;&amp;quot;_S&amp;quot;&amp;#039;&amp;#039;&amp;#039; folder. The code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
SShadow = Core.class()&lt;br /&gt;
&lt;br /&gt;
function SShadow:init(xtiny) -- tiny function&lt;br /&gt;
	xtiny.processingSystem(self) -- called once on init and every update&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SShadow:filter(ent) -- tiny function&lt;br /&gt;
	return ent.shadow&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SShadow:onAdd(ent) -- tiny function&lt;br /&gt;
	ent.spritelayer:addChildAt(ent.shadow.sprite, 1) -- add shadow behind ent&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SShadow:onRemove(ent) -- tiny function&lt;br /&gt;
	ent.spritelayer:removeChild(ent.shadow.sprite)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function SShadow:process(ent, dt) -- tiny function&lt;br /&gt;
	local function fun()&lt;br /&gt;
		ent.shadow.sprite:setPosition(ent.pos+vector(ent.collbox.w/2, ent.collbox.h/2))&lt;br /&gt;
		if ent.body and not ent.body.isonfloor then&lt;br /&gt;
			ent.shadow.sprite:setPosition(ent.pos.x+ent.collbox.w/2, ent.positionystart+ent.collbox.h/2)&lt;br /&gt;
		end&lt;br /&gt;
		Core.yield(1)&lt;br /&gt;
	end&lt;br /&gt;
	Core.asyncCall(fun)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This System adds a shadow below an Entity. If the Entity is in a jump state, we update the shadow only on the x axis.&lt;br /&gt;
&lt;br /&gt;
== Next? ==&lt;br /&gt;
Systems are fairly straight forward and fairly short for what they can achieve.&lt;br /&gt;
&lt;br /&gt;
We have covered the first set of systems, we have a couple more to add.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Prev.: [[Tuto tiny-ecs beatemup Part 9 Systems]]&amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Next: [[Tuto tiny-ecs beatemup Part 11 XXX]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Tutorial - tiny-ecs beatemup]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{GIDEROS IMPORTANT LINKS}}&lt;/div&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
</feed>