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

<channel>
	<title>scripting 2d Archives - Oxmond Technology</title>
	<atom:link href="https://oxmond.com/tag/scripting-2d/feed/" rel="self" type="application/rss+xml" />
	<link>https://oxmond.com</link>
	<description>IT Development</description>
	<lastBuildDate>Wed, 18 Nov 2020 05:12:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.0</generator>
	<item>
		<title>Start, Stop and Reset a Timer with C# scripting</title>
		<link>https://oxmond.com/start-stop-and-reset-a-timer-with-c-scripting-unity-2018-intermediate-tutorial/</link>
					<comments>https://oxmond.com/start-stop-and-reset-a-timer-with-c-scripting-unity-2018-intermediate-tutorial/#comments</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Tue, 20 Nov 2018 10:16:42 +0000</pubDate>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[2018]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game making]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[scripting 2d]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[sprites]]></category>
		<category><![CDATA[stopwatch]]></category>
		<category><![CDATA[timer]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[watch]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=291</guid>

					<description><![CDATA[<p>How to create a Timer with scripting (C#) in Unity 2018. Learn to start, stop and reset the timer using UI buttons in this Intermediate tutorial. Direct links to the free font and background below. ❤️ Subscribe to Oxmond Tutorials:https://bit.ly/SubscribeOxmondTutorials ✅ Download the Digital 7...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/start-stop-and-reset-a-timer-with-c-scripting-unity-2018-intermediate-tutorial/">Start, Stop and Reset a Timer with C# scripting</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><span style="font-weight: 400;">How to create a Timer with scripting (C#) in Unity 2018. Learn to start, stop and reset the timer using UI buttons in this Intermediate tutorial. Direct links to the free font and background below.<br /></span></p>
<hr />
<p><span style="font-weight: 400;">❤️ <strong>Subscribe to Oxmond Tutorials:</strong><br /><a href="https://bit.ly/SubscribeOxmondTutorials">https://bit.ly/SubscribeOxmondTutorials</a><br /></span></p>
<p>✅ <strong>Download the Digital 7 font here:</strong><br /><a href="https://www.dafont.com/digital-7.font"><span style="font-weight: 400;">https://www.dafont.com/digital-7.font</span></a></p>
<!-- /wp:paragraph -->
<p><span style="font-weight: 400;">✅ <strong>Timer background asset based on this file by Fabio Basile:</strong><br /></span><a href="https://all-free-download.com/free-psd/download/timer-widget-interface-with-blue-digital-numbers_175188.html">https://all-free-download.com/free-psd/download/timer-widget-interface-with-blue-digital-numbers_175188.html</a></p>
<p><span style="font-weight: 400;">✅ <strong>Other Free Asset Packages at the Unity Assets Store:</strong><br /></span><a href="https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k&amp;utm_source=aff">https://assetstore.unity.com/lists/top-free-packages-13201</a></p>
<p>😷👕 Need a face mask / developer T-shirt? Drop by our shop and get a 20% DISCOUNT on your first purchase by using the discount code OXMONDSALE. Click here: <br /><a href="https://shop.oxmond.com/discount/OXMONDSALE">https://shop.oxmond.com/discount/OXMONDSALE</a><br /><br /></p>
<hr />

<!-- wp:paragraph -->
<p><strong>Timer script:</strong></p>
<!-- /wp:paragraph -->

<!-- wp:preformatted -->
<pre class="wp-block-preformatted">/* .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © OXMOND / www.oxmond.com */

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class Timer : MonoBehaviour {

    public Text timerMinutes;
    public Text timerSeconds;
    public Text timerSeconds100;

    private float startTime;
    private float stopTime;
    private float timerTime;
    private bool isRunning = false;

	// Use this for initialization
	void Start () {
        TimerReset();
    }

    public void TimerStart() {
        if (!isRunning) {
            print("START");
            isRunning = true;
            startTime = Time.time;       
        }
    }

    public void TimerStop()
    {
        if (isRunning)
        {
            print("STOP");
            isRunning = false;
            stopTime = timerTime;
        }
    }

    public void TimerReset()
    {
        print("RESET");
        stopTime = 0;
        isRunning = false;
        timerMinutes.text = timerSeconds.text = timerSeconds100.text = "00";
    }

    // Update is called once per frame
    void Update () {
        timerTime = stopTime + (Time.time - startTime);
        int minutesInt = (int)timerTime / 60;
        int secondsInt = (int)timerTime % 60;
        int seconds100Int = (int)(Mathf.Floor((timerTime - (secondsInt + minutesInt * 60)) * 100));

        if (isRunning)
        {
            timerMinutes.text = (minutesInt &lt; 10) ? "0" + minutesInt : minutesInt.ToString();
            timerSeconds.text = (secondsInt &lt; 10) ? "0" + secondsInt : secondsInt.ToString();
            timerSeconds100.text = (seconds100Int &lt; 10) ? "0" + seconds100Int : seconds100Int.ToString();
        }
    }
}

</pre>
<!-- /wp:preformatted --><p>The post <a rel="nofollow" href="https://oxmond.com/start-stop-and-reset-a-timer-with-c-scripting-unity-2018-intermediate-tutorial/">Start, Stop and Reset a Timer with C# scripting</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/start-stop-and-reset-a-timer-with-c-scripting-unity-2018-intermediate-tutorial/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>How to move and FLIP a 2D sprite with the arrow keys</title>
		<link>https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/</link>
					<comments>https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/#comments</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Tue, 20 Nov 2018 08:34:17 +0000</pubDate>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[2018]]></category>
		<category><![CDATA[arrow keys]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[coding pirates]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[flip]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game making]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[move]]></category>
		<category><![CDATA[scripting 2d]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[sprites]]></category>
		<category><![CDATA[tutorials]]></category>
		<guid isPermaLink="false">https://oxmond.com/?p=271</guid>

					<description><![CDATA[<p>How to move and flip a 2D character with scripting (C#) in Unity 2018, using the left and right arrows keys to move the player. Unity beginner tutorial. ❤️ Subscribe to Oxmond Tutorials:https://bit.ly/SubscribeOxmondTutorials✅ Download the free Sunny Land 2D assets here:https://assetstore.unity.com/packages/2d/characters/sunny-land-103349✅ Other free packages at...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/">How to move and FLIP a 2D sprite with the arrow keys</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>How to move and flip a 2D character with scripting (C#) in Unity 2018, using the left and right arrows keys to move the player. Unity beginner tutorial.</p>
<hr />


<p><span style="font-weight: 400;">❤️ <strong>Subscribe to Oxmond Tutorials:</strong></span><span style="font-weight: 400;"><br /></span><a href="https://bit.ly/SubscribeOxmondTutorials"><span style="font-weight: 400;">https://bit.ly/SubscribeOxmondTutorials</span></a><br /><br />✅ <strong>Download the free Sunny Land 2D assets here:</strong><br /><a href="https://assetstore.unity.com/packages/2d/characters/sunny-land-103349?aid=1100l4p9k">https://assetstore.unity.com/packages/2d/characters/sunny-land-103349</a><br /><br /><strong>✅ Other free packages at the Unity Assets Store:</strong><br /><a href="https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k">https://assetstore.unity.com/lists/top-free-packages-13201</a></p>
<p>😷👕 Need a face mask / developer T-shirt? Drop by our shop and get a 20% DISCOUNT on your first purchase by using the discount code OXMONDSALE. Click here: <br /><a href="https://shop.oxmond.com/discount/OXMONDSALE">https://shop.oxmond.com/discount/OXMONDSALE</a></p>




<hr />
<p>● Character script (from video):</p>



<pre>/* .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © OXMOND / www.oxmond.com */

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour {

	void Update () {

        // Move the Character:
        transform.Translate(Input.GetAxis("Horizontal")* 15f * Time.deltaTime, 0f, 0f);

        // Flip the Character:
        Vector3 characterScale = transform.localScale;
        if (Input.GetAxis("Horizontal") &lt; 0) {
            characterScale.x = -10;
        }
        if (Input.GetAxis("Horizontal") &gt; 0)
        {
            characterScale.x = 10;
        }
        transform.localScale = characterScale;
    }
}
</pre>

<p>● Character script (updated):</p>
<!-- /wp:paragraph -->

<!-- wp:html -->
<pre>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Player : MonoBehaviour {

    Vector3 characterScale;
    float characterScaleX;

    void Start()
    {
        characterScale = transform.localScale;
        characterScaleX = characterScale.x;
    }

    void Update () {

        // Move the Character:
        transform.Translate(Input.GetAxis("Horizontal") * 15f * Time.deltaTime, 0f, 0f);

        // Flip the Character:
        if (Input.GetAxis("Horizontal") &lt; 0) {
            characterScale.x = -characterScaleX;
        }
        if (Input.GetAxis("Horizontal") &gt; 0)
        {
            characterScale.x = characterScaleX;
        }
        transform.localScale = characterScale;

    }
}

</pre>
<!-- /wp:html -->
<p>&nbsp;</p><p>The post <a rel="nofollow" href="https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/">How to move and FLIP a 2D sprite with the arrow keys</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/how-to-move-and-flip-a-2d-sprite-with-the-arrow-keys-unity-2018-tutorial-for-beginners/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
		<item>
		<title>How to change a sprite image with script</title>
		<link>https://oxmond.com/how-to-change-a-sprite-image-with-script-unity-2018-tutorial-for-beginners/</link>
					<comments>https://oxmond.com/how-to-change-a-sprite-image-with-script-unity-2018-tutorial-for-beginners/#respond</comments>
		
		<dc:creator><![CDATA[Oxmond Technology]]></dc:creator>
		<pubDate>Tue, 20 Nov 2018 01:43:28 +0000</pubDate>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Unity]]></category>
		<category><![CDATA[2018]]></category>
		<category><![CDATA[beginners]]></category>
		<category><![CDATA[bird]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[change]]></category>
		<category><![CDATA[change image]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[coding pirates]]></category>
		<category><![CDATA[dead]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[game making]]></category>
		<category><![CDATA[lesson]]></category>
		<category><![CDATA[scripting 2d]]></category>
		<category><![CDATA[sprite]]></category>
		<category><![CDATA[sprites]]></category>
		<category><![CDATA[tutorials]]></category>
		<guid isPermaLink="false">https://demo.oxmond.com/?p=247</guid>

					<description><![CDATA[<p>Learn to change a 2D sprite image from script (C#) in Unity 2018. Unity beginner tutorial. ❤️ Subscribe to Oxmond Tutorials: https://bit.ly/SubscribeOxmondTutorials ✅ Download 2D Assets Here: https://assetstore.unity.com/packages/essentials/asset-packs/ ✅ Free Packages at the Unity Assets Store: https://assetstore.unity.com/lists/top-free-packages-13201 😷👕 Need a face mask / developer T-shirt?...</p>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-change-a-sprite-image-with-script-unity-2018-tutorial-for-beginners/">How to change a sprite image with script</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Learn to change a 2D sprite image from script (C#) in Unity 2018. Unity beginner tutorial.</p>
<hr />
<p><span style="font-weight: 400;">❤️ <strong>Subscribe to Oxmond Tutorials:</strong></span><span style="font-weight: 400;"><br />
</span><a href="https://bit.ly/SubscribeOxmondTutorials"><span style="font-weight: 400;">https://bit.ly/SubscribeOxmondTutorials</span></a></p>
<p>✅ <strong>Download 2D Assets Here:</strong><br />
<a href="https://assetstore.unity.com/packages/essentials/asset-packs/2d-sprites-pack-73728?aid=1100l4p9k">https://assetstore.unity.com/packages/essentials/asset-packs/</a></p>
<p>✅ <strong>Free Packages at the Unity Assets Store:</strong><br />
<a href="https://assetstore.unity.com/lists/top-free-packages-13201?aid=1100l4p9k">https://assetstore.unity.com/lists/top-free-packages-13201</a></p>
<p>😷👕 <strong>Need a face mask / developer T-shirt? Drop by our shop and get a 20% DISCOUNT on your first purchase by using the discount code OXMONDSALE. Click here:</strong><br />
<a href="https://shop.oxmond.com/discount/OXMONDSALE">https://shop.oxmond.com/discount/OXMONDSALE</a></p>
<hr />
<p><strong>Bird script:</strong></p>
<pre class="EnlighterJSRAW" data-enlighter-language="null">/* .-------.                             .--.    .-------.     .--.            .--.     .--.        
   |       |--.--.--------.-----.-----.--|  |    |_     _|--.--|  |_.-----.----|__|---.-|  |-----.
   |   -   |_   _|        |  _  |     |  _  |      |   | |  |  |   _|  _  |   _|  |  _  |  |__ --|
   |_______|__.__|__|__|__|_____|__|__|_____|      |___| |_____|____|_____|__| |__|___._|__|_____|
   © OXMOND / www.oxmond.com */

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bird : MonoBehaviour
{

    public Sprite DeadBird;

    void Update()
    {

        if (transform.position.y &gt;= -4.53)
        {
            transform.Translate(0f, -0.25f, 0f);
        }
        else
        {
            this.gameObject.GetComponent&lt;SpriteRenderer&gt;().sprite = DeadBird;
        }
    }
}

</pre>
<p>The post <a rel="nofollow" href="https://oxmond.com/how-to-change-a-sprite-image-with-script-unity-2018-tutorial-for-beginners/">How to change a sprite image with script</a> appeared first on <a rel="nofollow" href="https://oxmond.com">Oxmond Technology</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://oxmond.com/how-to-change-a-sprite-image-with-script-unity-2018-tutorial-for-beginners/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
