<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://www.spyroforum.com/extern.php?action=feed&amp;tid=14622&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Spyro the Dragon Forums / Spyro game 2D in Unity. University project.]]></title>
		<link>https://www.spyroforum.com/viewtopic.php?id=14622</link>
		<description><![CDATA[The most recent posts in Spyro game 2D in Unity. University project..]]></description>
		<lastBuildDate>Wed, 30 Mar 2016 04:40:28 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=436469#p436469</link>
			<description><![CDATA[<p>Any updates for this game?</p>]]></description>
			<author><![CDATA[dummy@example.com (CrystalFissure)]]></author>
			<pubDate>Wed, 30 Mar 2016 04:40:28 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=436469#p436469</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=434741#p434741</link>
			<description><![CDATA[<p>I didn&#039;t know Unity could do this. Is that the Legend of Spyro spyro sprite? and this looks like a classic spyro adventure, so this is pretty neat.</p>]]></description>
			<author><![CDATA[dummy@example.com (Bryman04)]]></author>
			<pubDate>Tue, 22 Dec 2015 17:40:35 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=434741#p434741</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=430916#p430916</link>
			<description><![CDATA[<p>Looking solid so far.</p>]]></description>
			<author><![CDATA[dummy@example.com (CrystalFissure)]]></author>
			<pubDate>Sat, 13 Jun 2015 11:20:40 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=430916#p430916</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=430413#p430413</link>
			<description><![CDATA[<p>Oh wow, you can add gifs here too.</p>]]></description>
			<author><![CDATA[dummy@example.com (s-h-a-d-0-w)]]></author>
			<pubDate>Sat, 16 May 2015 17:36:28 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=430413#p430413</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=430178#p430178</link>
			<description><![CDATA[<div class="quotebox"><cite>Slvr99 wrote:</cite><blockquote><div><div class="quotebox"><cite>s-h-a-d-0-w wrote:</cite><blockquote><div><div class="codebox"><pre><code>			target =  GameObject.Find(&quot;Gem_colleted_1_anim&quot;);</code></pre></div></div></blockquote></div><p>About this bit of code, it&#039;s apparently not good practice to use GameObject.Find in Unity. It&#039;s slow and creates a lot of garbage data from what I hear. I still use it when it&#039;s easier than a reference, but it&#039;s recommended to use a reference when possible. A reference means setting a global variable at the top of your script like</p><div class="codebox"><pre><code>public GameObject target;</code></pre></div><p>and then setting that GameObject prefab(if you have one) within the editor.(Edit: after reading that you now use prefabs, you may have already done this then.) As a side note about this:</p><div class="codebox"><pre><code>Instantiate(target, new Vector3(transform.position.x,transform.position.y, 0f), Quaternion.identity);</code></pre></div><p>you should reference Instantiate as an object itself, meaning it should look like this:</p><div class="codebox"><pre><code>GameObject Gem_collected_1 = Instantiate(target, new Vector3(transform.position.x,transform.position.y, 0f), Quaternion.identity) as GameObject;</code></pre></div><p>then you can reference &quot;Gem_collected_1&quot; afterwards to reference that specific object.</p><p>Also, I&#039;m not sure what you plan to use the &quot;ToDestroy&quot; bool, but if you are using it as a timed destroy, you can use this:</p><div class="codebox"><pre><code>Destroy(GameObject, x);</code></pre></div><p>where &quot;GameObject&quot; is the object you&#039;re destroying(in this case Gem_collected_1 or whatever you call the object) and &quot;x&quot; is the amount of time you want to wait before destroying the object. So setting 5 for x would wait 5 seconds before destroying.</p></div></blockquote></div><p>I actually remade that part of code completely. Now it looks like this.</p><div class="codebox"><pre class="vscroll"><code>using UnityEngine;
using System.Collections;

public class gemHandler : MonoBehaviour {
	private Player player;
	//public Transform[] gemsColleted = new Transform[5];
	public Transform gemAnimation;
	GameObject target;
	public int gemType = 0;
	int[] gemAmount = { 1, 2, 5, 10, 25, 100 }; 

	
	// Use this for initialization
	void Start () {
		player = GameObject.FindGameObjectWithTag (&quot;Player&quot;).GetComponent&lt;Player&gt; ();
	}
	
	// Update is called once per frame
	void Update () {
	

	}


	void OnTriggerEnter2D(Collider2D col){
		if(col.CompareTag(&quot;Player&quot;)){

			if(gemType != 5){
			var gemNumber = Instantiate(gemAnimation) as Transform;
			gemNumber.position = transform.position;
			Destroy(gemNumber.gameObject, 1F);
			//gemsCollected+= gemAmount[gemType];
			}

			Destroy(gameObject, .02F);
			//Destroy (col.gameObject);

			player.gemCollected(gemAmount[gemType]);
		}
		
	}
}</code></pre></div><p>As you can see I completely redid my GemHandler.cs, making it a lot shorter and a lot more efficient. First version of it, was made in rush and didn&#039;t work correctly.</p>]]></description>
			<author><![CDATA[dummy@example.com (s-h-a-d-0-w)]]></author>
			<pubDate>Sun, 10 May 2015 20:33:49 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=430178#p430178</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=430177#p430177</link>
			<description><![CDATA[<div class="quotebox"><cite>s-h-a-d-0-w wrote:</cite><blockquote><div><div class="codebox"><pre><code>			target =  GameObject.Find(&quot;Gem_colleted_1_anim&quot;);</code></pre></div></div></blockquote></div><p>About this bit of code, it&#039;s apparently not good practice to use GameObject.Find in Unity. It&#039;s slow and creates a lot of garbage data from what I hear. I still use it when it&#039;s easier than a reference, but it&#039;s recommended to use a reference when possible. A reference means setting a global variable at the top of your script like</p><div class="codebox"><pre><code>public GameObject target;</code></pre></div><p>and then setting that GameObject prefab(if you have one) within the editor.(Edit: after reading that you now use prefabs, you may have already done this then.) As a side note about this:</p><div class="codebox"><pre><code>Instantiate(target, new Vector3(transform.position.x,transform.position.y, 0f), Quaternion.identity);</code></pre></div><p>you should reference Instantiate as an object itself, meaning it should look like this:</p><div class="codebox"><pre><code>GameObject Gem_collected_1 = Instantiate(target, new Vector3(transform.position.x,transform.position.y, 0f), Quaternion.identity) as GameObject;</code></pre></div><p>then you can reference &quot;Gem_collected_1&quot; afterwards to reference that specific object.</p><p>Also, I&#039;m not sure what you plan to use the &quot;ToDestroy&quot; bool, but if you are using it as a timed destroy, you can use this:</p><div class="codebox"><pre><code>Destroy(GameObject, x);</code></pre></div><p>where &quot;GameObject&quot; is the object you&#039;re destroying(in this case Gem_collected_1 or whatever you call the object) and &quot;x&quot; is the amount of time you want to wait before destroying the object. So setting 5 for x would wait 5 seconds before destroying.</p>]]></description>
			<author><![CDATA[dummy@example.com (Slvr99)]]></author>
			<pubDate>Sun, 10 May 2015 18:44:57 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=430177#p430177</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=430157#p430157</link>
			<description><![CDATA[<div class="quotebox"><cite>Paranoia wrote:</cite><blockquote><div><p>In the future, please just edit your post instead of double, triple, or quadruple posting. Thanks</p></div></blockquote></div><p>Sorry about that. Will not do it again, but since I am replying to this. Is it okay if I post a link to a beta version of my game?</p><br /><p><a href="https://www.dropbox.com/s/n8d67fhtn3qc6fo/v1.6.zip?dl=0" rel="nofollow">https://www.dropbox.com/s/n8d67fhtn3qc6fo/v1.6.zip?dl=0</a> <img src="https://www.spyroforum.com/img/smilies/cool.png" width="15" height="auto" alt="cool" /></p>]]></description>
			<author><![CDATA[dummy@example.com (s-h-a-d-0-w)]]></author>
			<pubDate>Sat, 09 May 2015 20:06:44 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=430157#p430157</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=430099#p430099</link>
			<description><![CDATA[<p>In the future, please just edit your post instead of double, triple, or quadruple posting. Thanks</p>]]></description>
			<author><![CDATA[dummy@example.com (Paranoia)]]></author>
			<pubDate>Thu, 07 May 2015 16:53:44 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=430099#p430099</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=430081#p430081</link>
			<description><![CDATA[<p><span class="postimg"><img src="http://cs622427.vk.me/v622427396/314dc/yYDcO1RKSpA.jpg" alt="yYDcO1RKSpA.jpg" /></span><br /><span class="postimg"><img src="http://cs622427.vk.me/v622427396/314e6/AEN5qrGlwPE.jpg" alt="AEN5qrGlwPE.jpg" /></span></p>]]></description>
			<author><![CDATA[dummy@example.com (s-h-a-d-0-w)]]></author>
			<pubDate>Thu, 07 May 2015 07:54:48 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=430081#p430081</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=430080#p430080</link>
			<description><![CDATA[<p>So far didn&#039;t do as much. So far I did add a huge robot that punches spyro if he comes close, also that robot walks from one place to another, then randomly stops and walks again. Next things I will do is a turret enemy, then/before that a death animation, then fully functional charge and after that I can start making a basic level with all these features.</p>]]></description>
			<author><![CDATA[dummy@example.com (s-h-a-d-0-w)]]></author>
			<pubDate>Thu, 07 May 2015 07:53:29 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=430080#p430080</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=429969#p429969</link>
			<description><![CDATA[<p>Alright so, I&#039;ve:<br />- Redone the Bomb<br />- Fixed the snake glitch<br />- Fixed the flying glitch<br />- Redoing the gem system<br /><span class="postimg"><img src="http://cs622030.vk.me/v622030396/2d16a/sHWa12OTDkI.jpg" alt="sHWa12OTDkI.jpg" /></span><br /><span class="postimg"><img src="http://cs622030.vk.me/v622030396/2d171/3IuFTLGv0Xo.jpg" alt="3IuFTLGv0Xo.jpg" /></span></p>]]></description>
			<author><![CDATA[dummy@example.com (s-h-a-d-0-w)]]></author>
			<pubDate>Sun, 03 May 2015 16:24:02 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=429969#p429969</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=429918#p429918</link>
			<description><![CDATA[<p>Alright so I finally fixed this weird glitch.</p><p><a href="https://www.youtube.com/watch?v=Od7q_kTla0Q" rel="nofollow">https://www.youtube.com/watch?v=Od7q_kTla0Q</a></p><p>Apperantly fixing it was easier than I thought. Reworking on the gem system right now. I really dont like the way I did it in first place. It was something like</p><div class="codebox"><pre><code>void OnTriggerEnter2D(Collider2D col){
		//Debug.Log(&quot;OnTriggerEnter2D collision name = &quot; + col.gameObject.name);
		/*for (int i = 0; i &lt; gems.Length; i++) {
			if (col.gameObject.name == gems[i]) {*/

		switch (col.gameObject.name) {


		case &quot;Gem_1&quot;:

			//Instantiate (gameObject.GetComponent(&quot;Gem_collected_1_anim&quot;), new Vector3 (transform.position.x, transform.position.y, 0f), Quaternion.identity);
			//Rigidbody gem_1a = (Rigidbody) Instantiate(Gem_colleted_1_anim, transform.position, transform.rotation);


			target =  GameObject.Find(&quot;Gem_colleted_1_anim&quot;);
     		Instantiate(target, new Vector3(transform.position.x,transform.position.y, 0f), Quaternion.identity);
			ToDestroy = true;</code></pre></div><p> That for each gem. and I basicly HAD to put each gem number on the map somewhere, so it would create a clone of it. Now I&#039;m using a proper way of doing, using Prefabs.</p>]]></description>
			<author><![CDATA[dummy@example.com (s-h-a-d-0-w)]]></author>
			<pubDate>Fri, 01 May 2015 21:55:02 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=429918#p429918</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=429889#p429889</link>
			<description><![CDATA[<p>Looks amazing. Keep it up!</p>]]></description>
			<author><![CDATA[dummy@example.com (thetruefan)]]></author>
			<pubDate>Thu, 30 Apr 2015 20:06:54 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=429889#p429889</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=429869#p429869</link>
			<description><![CDATA[<p>Thanks guys.<br />Alright so what I&#039;ve done so far is:<br />- Completely remade the way that Bomb works. Now bomb does not explode instantly if Spyro&#039;s collider collides with it. Now spyro has to set it on fire with his fire breath, then it takes 1.5 second to detonate and then comes the explosion. Explosion also damages enemies. When I add charge, Spyro will be able to trigger bomb&#039;s explosion timer and then toss it forward with his charge attack. It will be useful for big enemies or creates that cannot be opened with charge nor fire breath.</p>]]></description>
			<author><![CDATA[dummy@example.com (s-h-a-d-0-w)]]></author>
			<pubDate>Thu, 30 Apr 2015 06:21:02 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=429869#p429869</guid>
		</item>
		<item>
			<title><![CDATA[Re: Spyro game 2D in Unity. University project.]]></title>
			<link>https://www.spyroforum.com/viewtopic.php?pid=429835#p429835</link>
			<description><![CDATA[<p>Looks good <img src="https://www.spyroforum.com/img/smilies/smile.png" width="15" height="auto" alt="smile" /> I&#039;m sorry I can&#039;t help much now, uni is getting me with a lot of work. I don&#039;t even have time to work on the forum fan game D:</p>]]></description>
			<author><![CDATA[dummy@example.com (Gekoncze)]]></author>
			<pubDate>Wed, 29 Apr 2015 20:36:04 +0000</pubDate>
			<guid>https://www.spyroforum.com/viewtopic.php?pid=429835#p429835</guid>
		</item>
	</channel>
</rss>
