<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Aaron Lowe on Medium]]></title>
        <description><![CDATA[Stories by Aaron Lowe on Medium]]></description>
        <link>https://medium.com/@aaronlowe911?source=rss-28ee3512d7e5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*S4FARd4x28yHNaGp</url>
            <title>Stories by Aaron Lowe on Medium</title>
            <link>https://medium.com/@aaronlowe911?source=rss-28ee3512d7e5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 24 May 2026 02:29:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aaronlowe911/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Setting an Explode Animation for my Enemy]]></title>
            <link>https://medium.com/@aaronlowe911/setting-an-explode-animation-for-my-enemy-ec3f27964310?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec3f27964310</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[unity2d]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[settrigger]]></category>
            <category><![CDATA[animation]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Thu, 18 Apr 2024 18:25:53 GMT</pubDate>
            <atom:updated>2024-04-18T18:25:53.615Z</atom:updated>
            <content:encoded><![CDATA[<h3>Setting an Explode Animation for my Enemy.</h3><p>Running through this game&#39;s setup for the second time I have been able to locate several things that baffled me before. The SetTrigger for an animation is one of them. I’m going to cover it again and go into more detail on the troubleshooting of the issues that I ran into prior.</p><p>I drug my enemy into the inspector, and this led to my first hangup. When adjusting a prefab from the inspector, always check that you have selected to over-ride, otherwise, only the single game object drug into the hierarchy will have the adjustments. I received warnings from null checks I set on my animator. After running my game, I also received error messages that my Enemy clone didn&#39;t have the animator that I had added. Fortunately, I hadn’t deleted the enemy in question from the hierarchy, so it was a simple override, but if that hadn’t been the case, it’d be time to start over. For me, starting from scratch is preferable so I don&#39;t have loose ends in my game or code.</p><p>Dragging my Enemy prefab into the hierarchy I need to create an animation. I name and save it. I press record, select the images that I wish to use and drag and drop them into my animation window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G4mFeTurt465Otojy9GR5g.png" /></figure><p>I hit play for the animation to run all the way through several times, and once I am completely satisfied with it, I hit record again to end the recording and it saves my animation, creating an animator. Check the animator as I have noticed it tends to not save using the same name. In this case, mine came out enemy. Just because this is easy for us to remember is no excuse for a bad naming convention. If networking with others, clean code and good naming can save a lot of time, and that’s what we strive for. Rename it so there is no doubt what this is.</p><p>I had my enemy selected when I created the animation, so the animator was added already. If you did not, add the animator now.</p><p>Opening that animator will create a window next to our scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*EMBpZNJyA5UVK8CB-49LQg.png" /></figure><p>In mine I have added an empty state. The reason for this is without it, my animation will just play on start. This is an explosion sequence, so I need to trigger it. I set the empty state as my default state, go to the transition line from it to my animation, and make sure it has no exit time or transition time. I want my animation to play as soon as my enemy is hit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/273/1*BB65E_ZagckOcnW_q97hLg.png" /></figure><p>Now in the animator window I need to create a parameter. I have options in the window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*Tjdsx6jRBRACMNMWnScfwA.png" /></figure><p>Clicking add and selecting trigger, it creates the parameter. I’ll name it OnEnemyDeath. I’ll be calling this from script, so the name and spelling are important. Hopping back over to my transition line I will add it to the conditions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/263/1*YW_dntmRFkIEwRuSJ_wTGw.png" /></figure><p>This animator’s condition is automatically set to on, and I need it to wait for my trigger. I will turn it off for now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8PdizCMP6YkqHN9X9i8NrA.png" /></figure><p>Now I just need to check that I have selected to over-ride the prefabs to avoid that problem later, save, and hop into my enemy script. The enemy script will be the only once I need to change since I already have the enemy death functionality in place. For now I have two instances where the enemy is destroyed, and since I want this animation to play on both, I am just going to create a method to handle the enemy death functionality.</p><p>First, I need to store a handle to my animator. I’ll call it private Animator _anim;. I’m working from the enemy script, and the animator is attached to it in Unity. This makes it easy to get my component. In void start I will do this by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*Ynlt0tV_PG94A8bKuLEsUw.png" /></figure><p>That null check saved me a lot of headaches. If you aren’t doing null checks, be prepared to start over frequently.</p><p>Here’s where the coding gets fun. Where should this explosion go? If you place this animation after the game object is destroyed, the animator is destroyed with it. If you play the animator before it is destroyed, the animation will end as soon as the game object is destroyed. And if I pause the game object while it is in the process of running the animation, that collider2D that I added is still a threat to my player. So, the method I created for EnemyDeath had to cover all of these. And here is what I came up with:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/305/1*N3dR0EHSGP8xFERwh0myPA.png" /></figure><p>_anim.SetTrigger(“The name of my perameter, not my animator or game object”) to start up my animation. Then I brought my enemy to a full stop. Then, since I already created a handle and grabbed the component of my collider, I turned it to false. Now it can not hurt my player after the death sequence has started. Finally, I added a one second float to stall my game objects death and allow the animation to play. This method can now be called from the appropriate places. I did not place the add to score function here because I only want the player to receive points when the laser hits the target and not when the player flies into the target. No rewards for bad driving I’m afraid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*-dR9cwWvSJ52FBO2xz9CMA.png" /></figure><p>I am fairly confident in the code as well as the editor up to this point. I am now going to, again, check my over-ride on my enemy in the inspector, delete the enemy that I have been working on from the hierarchy, and test it out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*uwWcRsoxoPUhNkGu7HvWZw.gif" /></figure><p>Not only does my explosion work, my score updates properly, no errors and my code is clean and readable. I’m satisfied with the result. Thanks for reading my article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec3f27964310" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Downloading Unity and Setting Up Your Game]]></title>
            <link>https://medium.com/@aaronlowe911/downloading-unity-and-setting-up-your-game-e2e68b7475b7?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2e68b7475b7</guid>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[unity3d]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Sat, 17 Feb 2024 20:25:28 GMT</pubDate>
            <atom:updated>2024-02-17T20:25:28.499Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s get started with downloading and installing Unity Hub. To do so, visit <a href="https://unity.com/download">Start Your Creative Projects and Download the Unity Hub | Unity</a>.</p><p>While that is installing, now you need to be preparing for what game you are about to set up. Most importantly, is it a 2D or 3D game. For 3D, I use version 19.4.40f1. For 3D I currently use the latest version, but I encourage you to put some effort into researching the individual releases which are most suitable for your game idea. For Space Shooter Pro I will be making it 2.5D, so using 3D Core and version 19.4.4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0fBMn2rZVtyM6FFNz6jNg.png" /></figure><p>Here I will change the version on the top, Naming my project, and making sure the organization is set to my Unity Account. You will need to set one up before you can ever begin creating a game, so if you haven’t created one, create one now. Once everything is set up, hit create new project in the lower right. The initial load time varies between computer performances, but within minutes you should see the Unity sample screen shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zp8ahIln1W3Uf8ON4Y9OHg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2e68b7475b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Aggressive Enemy Type]]></title>
            <link>https://medium.com/@aaronlowe911/aggressive-enemy-type-b0cd3982b2d7?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0cd3982b2d7</guid>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[enemy-ai]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Mon, 01 Jan 2024 20:14:58 GMT</pubDate>
            <atom:updated>2024-01-01T20:14:58.474Z</atom:updated>
            <content:encoded><![CDATA[<p>Rather than create a new enemy for this, I’ll revisit enemy prefab two. Its movement is a random drift to the left or right. It does make it not as predictable on spawning in, but its basically boring. Rather than changing its movement completely I’ll give it aggressive enemy behavior calculated into its movement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*ohcrBndg1EJ2cHQAZVuknw.png" /></figure><p>Beginning with variables I am going to give it a high chase speed for testing and a distance float. I already have a player variable, so first I need to assign distance as the length between the player and the enemy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/581/1*WBwTPAmMZBZ63RtewIJYVg.png" /></figure><p>Mathf.Atan2 is a method of measuring angles by two radians. The Rad2Deg is converting those radians to degrees. In short, this calculates a angle based on the direction provided in degrees. The location of the player is now actively updated with calculate movement. So, when will I trigger it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*UnxC-qWYlyimTx5ZluICRw.png" /></figure><p>By distance. And again I have set it high for testing. The vector2 move towards switches my enemy to ram the player if closer than a distance of less than 6. If distance is 7 or greater it will continue moving normally. I realize I am missing the what if the distance is 6. I am hoping that the enemy will stop and appear more aggressive at that range and if the player moves away, continue on normal movement. If the player moves closer, it should charge quickly.</p><p>And testing it out I achieved the result I was hoping for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*ABDWrO1ZKos0m-uSl2vyRw.gif" /></figure><p>Later I could add an animation for charging left or right.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0cd3982b2d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding Enemy Shields Into My 2D Shooter]]></title>
            <link>https://medium.com/@aaronlowe911/adding-enemy-shields-into-my-2d-shooter-5d60c6317186?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d60c6317186</guid>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Mon, 01 Jan 2024 06:47:44 GMT</pubDate>
            <atom:updated>2024-01-01T06:47:44.147Z</atom:updated>
            <content:encoded><![CDATA[<p>I had to rethink my enemy build. It began as a single-shot-dies enemy, but now I need to implement a shield system. First was the animation creation as it is the fastest thing to get through. But once I had the animation created I also had to make a new animator to keep it separate from my enemy2 prefab, and to also control the logic in script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2O1M82oZQvPzwyiCsL7rEg.png" /></figure><p>I created an empty default state, drug both of my animations(one for shields and one for destroy) into the animator. The transition for the destroy animation is the same trigger perameter. The transition to and from the shield however, is a bool. True and false. If the shield state is true, then shields will run in a loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*Un5h1sata2atknyq0Hif8A.png" /></figure><p>The false will have zero transition time, so it will snap right back to default mode once the bool is set to false. The trigger is set to destroy straight from default since it cannot destroy from the shield state. Now the code logic. I only need two new variables. One for lives and the other an int so I can call my parameter through better practice later on in the script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*uPvhkaxJp5CbaRzCMO2hZg.png" /></figure><p>Next, I need an IEnumerator to check if shields will activate or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*LwE1hqHrScyHJ15HqL65fg.png" /></figure><p>This is called from Start to only run once rather than on and off. Next comes the life updater, which is called from update. Here is where I will use my bool for shields, but not the trigger. The trigger on destroy makes more sense to place with enemy end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*2Hj6ZNkDsi890it-zW4fXQ.png" /></figure><p>This will constantly check if the shields are active and allow me to set the bool to negative and kill the enemy shields on impact. Enemy damage is simple. When hit by the player or a laser, _lives — ;. It is Named takedamage() and is called from on trigger. Finally the enemy end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*tJFscHs3GrapDF0BzJFb7Q.png" /></figure><p>There is the trigger for the destroy animation, as well as some other touches to keep the enemies from firing through an animation or after it vanishes, as you might catch my advanced enemy doing in the final video. This is what I was able to come up with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*AWRjXe8fY9xp0NDpGyMuCA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d60c6317186" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Balanced Spawn]]></title>
            <link>https://medium.com/@aaronlowe911/a-balanced-spawn-6cd2e4c2cbe5?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/6cd2e4c2cbe5</guid>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[csharp]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Sat, 30 Dec 2023 01:08:45 GMT</pubDate>
            <atom:updated>2023-12-30T01:08:45.264Z</atom:updated>
            <content:encoded><![CDATA[<p>Fortunately creating arrays led to some simple logic on how to call each case by percentage. Going through, I sorted the percentages with a bit more balance, ensuring that ammo replenishment was a bit more frequent and that essentials came more regularly than the rarer ones. I also did the same for my enemies. The same spawn manager controls them both, so its very convenient to adjust the spawn rates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*Ct8dh1AtIf_ZNXT2j6Y9Pw.png" /></figure><p>You see that I have traded out the wait for seconds number with a new variable. This is the variable, as well as a few more that are connected to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/485/1*T2YLPO-v9NK81LePtNYiZQ.png" /></figure><p>This is for my spawn system, based on the player’s points. once the player reaches a new point threshold level, both the enemies and the powerups rain down a bit faster. I had to use a for loop to implement this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*J2OAi27ZFVW2u55dkOt1BQ.png" /></figure><p>This look checks for the players score in the ui manager. Once the player goes over the next threshold number, the length of spawn delays decreases by one, moving the current spawn delay quicker and quicker until it runs through the loop. At that point, there will be a boss. For now, I have a pretty challenging and balanced spawn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/528/1*qVCy_OrZ3AVZGpI8osJi2Q.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6cd2e4c2cbe5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of a New Enemy Type]]></title>
            <link>https://medium.com/@aaronlowe911/implementation-of-a-new-enemy-type-69bcb8378131?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/69bcb8378131</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Sat, 30 Dec 2023 00:19:43 GMT</pubDate>
            <atom:updated>2023-12-30T00:19:43.138Z</atom:updated>
            <content:encoded><![CDATA[<p>I thought out a new enemy. I wanted it to be larger and scarier, with a weapon that not only did damage, but also called out to the players negative effect method and did some random bad thing as well. First, creating my sprite for the ship.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*-K_AyFlozwqVb7hZKj3OKQ.png" /></figure><p>That’s it up in the left. The weapon is just an ugly sphere, but it is now a disruptor. Next came the movement, which i decided would either spawn to the top left or top right and scroll oposite the direction of its spawn. This seems pretty simply, but first i need to get into my spawn manager and reset my enemies to an array just as I did my powerups.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*PIedI64cjO2TMWVC8Zx8IQ.png" /></figure><p>Next, the switch statement that will decide a random range, choose a case in the array, and instantiate my next enemy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*5Kt5noDZhju3MF3c9AKmIg.png" /></figure><p>Assigning those to the spawn manager in the inspector, I decided to use two separate scripts, one for right, and one for left. Most was similar to my enemy, but I did need to change the Control Movement()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*XDyjo6nDyemFr6WAOiRzaA.png" /></figure><p>and my Enemy Fire() to make it shoot more often.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*7K_H7elsdJlz2A7jWkp1kQ.png" /></figure><p>Now time and time again I thought there was an issue with my code since the new enemy kept blowing up. I gave it its own explosion animation, made sure that I was calling it properly, but the reason it kept exploding on instantiation was because I had forgotten this line in the animator, and to assign the condition to set the trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZG9jnd4QFURFMCeUPrkfg.png" /></figure><p>Finaly, still with a few glitches I can celebrate a new enemy that is moving the way it is supposed to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/1*8mw3HeNN4OZbammHMeUUew.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69bcb8378131" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding a Negative Collectible]]></title>
            <link>https://medium.com/@aaronlowe911/adding-a-negative-collectible-beb55f72ae07?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/beb55f72ae07</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Fri, 22 Dec 2023 05:05:14 GMT</pubDate>
            <atom:updated>2023-12-22T05:05:14.718Z</atom:updated>
            <content:encoded><![CDATA[<p>I needed an angry face image for this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/1*NwelfPvN2vK9rr7XmGj-yA.png" /></figure><p>I quickly came up with an image for my sprite and assigned the needed components, drug the powerups script into the prefab and got started with my spawn manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*zuQ42mw-nEJWFNIzmuQQTQ.png" /></figure><p>This is ten percent higher than my rare drop, but I don’t want to wait for ten minutes for rare drops when testing this one, because I wanted to have fun with the code a bit. One negative collectible is fair, but the same negative effect each time may get boring. Plus, I want to make the player actively terrified of this. So, I added it to my powerups and headed to my player script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/1*uKOzG_3FWGJAzEz6mZE4Ow.png" /></figure><p>That’s right, another switch statement. This one is randomly assigning one of three negative effects on the player if they pick up the collectible to trigger this, then calling said bad thing to happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*w-X9grFuYkMT4-zF4sTnIA.png" /></figure><p>I need this variable for one of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*dFgJmDqiD26YOAmRBn6MCw.png" /></figure><p>Lost control I had fun with. Five seconds of bouncing around in a tight circle, but not as bad as camera shake. Just enough to be unpredictable in the bounce. Next,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*aTxp9AYJRL8CZ8SlVJjMZg.png" /></figure><p>Sensor damage and power drain. Sensor damage is a five second camera shake, and power drain cuts ammunition in half instantly, as well as terminates shields if they are active. This gave me the opportunity to utilize my camera shake singleton again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*3QF8IrAKv0gczz_V22cq7g.png" /></figure><p>And that let to pretty unpleasant surprises grabbing the negative effects collectible as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*7zWnSx2qT7lwqjzETJEu4g.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*LrQpXO053nRJXaJKi7gSVw.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=beb55f72ae07" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enemy Wave Implementation]]></title>
            <link>https://medium.com/@aaronlowe911/enemy-wave-implementation-dddc17d69034?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/dddc17d69034</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 03:57:13 GMT</pubDate>
            <atom:updated>2023-12-21T03:57:13.490Z</atom:updated>
            <content:encoded><![CDATA[<p>I decided with my enemy wave, the spawn enemy method in my spawn manager would be triggered by player score. This sounds easier than it was, and here is what my first attempt looked like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*0rFuUMlZoXKCEGVuTR6_gg.gif" /></figure><p>This was from a typo in a for statement. Getting started I opened my spawn manager script. I added these variables, which may be too easy and need to be adjusted later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*pzrEDuxtSNRPu8UNT8swdw.png" /></figure><p>The method I chose for implementing my spawn manager:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*V4406Y7QkYFgBNJCCRs3JA.png" /></figure><p>I used a loop that goes through each element in the score thresholds and for each element it checks for the player’s score. Then, it stops the loop using break. After the loop, if the player score meets or exceeds the threshold, the spawn delay is reduced. Next was calling this from the UI Manager, which I did when the player score updated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/1*rA5d3iv-0IjzZnhQg-CBHQ.png" /></figure><p>And the final result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/530/1*D-zjHYYHYPpKs-u-S2SxJQ.gif" /></figure><p>At 400, the spawnmanager will be set to end the enemy spawn and spawn whatever is next to come.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dddc17d69034" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding a New Enemy into the Game]]></title>
            <link>https://medium.com/@aaronlowe911/adding-a-new-enemy-into-the-game-d44f4c0b633b?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d44f4c0b633b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 01:26:05 GMT</pubDate>
            <atom:updated>2023-12-21T01:26:05.601Z</atom:updated>
            <content:encoded><![CDATA[<p>After a thorough code cleanup, it is now on to creating a second enemy. This enemy I want to travel down a bit slower than the normal enemy, but at a random left or right downward angle making it a little more difficult to hit and predict. It should be worth twice as much in points. First, I need to make a new prefab, which I will just copy from the one I already have.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*gFRcYjuFa_XlUT3jnap8Aw.png" /></figure><p>Next I will delete the script from it in the inspector and drag it down into my prefabs. I then create a new C# script and drag it into my prefab. The only things I need to change in this is the movement and the point value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/314/1*bY3XGGiXdz5OIUNlOFTnog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*QsvYmjKxTQyHoLQf3A4VTg.png" /></figure><p>Just like the player, if it travels off the screen on the x axis, it will wrap around to the other side of the screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/348/1*rRp5WD-uWxw10PwCFu5o6Q.png" /></figure><p>These are the variables I added, which automatically changed my score from enemy as well as slowed its downward speed and gave it side to side movement with the new movement method. next, the spawn manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/298/1*dOQYgDJcK5zwxqP5dJQgKA.png" /></figure><p>I needed a variable I could assign the new enemy to in the inspector.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*mvH9LthPrIBoaFF-ze7A0Q.png" /></figure><p>In the spawn enemy field, I had to create a random range and make enemy two a bit rarer than enemy 1, so I went with a 20% chance. Saving here, I moved over to the inspector and assigned it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/1*vS4Ojqn0eFTHbPuNTzlawQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*ZyX9lkbivJTKp_sLfrVd4A.gif" /></figure><p>I’ll need to adjust the wraparound, but it works. And a side victory. By slowing this one down, I was pretty surprised when the normal enemy was the one to show up and get the kill.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d44f4c0b633b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementation of the Camera Shake]]></title>
            <link>https://medium.com/@aaronlowe911/implementation-of-the-samera-shake-16ede112f10a?source=rss-28ee3512d7e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/16ede112f10a</guid>
            <category><![CDATA[unity]]></category>
            <category><![CDATA[gamedevhq]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Aaron Lowe]]></dc:creator>
            <pubDate>Wed, 20 Dec 2023 06:25:17 GMT</pubDate>
            <atom:updated>2023-12-20T06:25:37.105Z</atom:updated>
            <content:encoded><![CDATA[<p>For an effect like a camera shake, there are several ways to go about it. I went with script. Creating a new script named camera shake, I drug it into my main camera to get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*HyHNNpWUbk6Ki4pyjLKwkg.png" /></figure><p>This entire script has one purpose and is called only when the player takes damage, so I made it a singleton and added in the needed variables. Obviosly, a bool to set shake to false as well as a start and returnable position of the camera.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*JemgHeQ2PodhAQGx5oEbmg.png" /></figure><p>Then the methods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*PZgE5CSTjp2KvcgzliMRYQ.png" /></figure><p>These start the shake, define the shake, give it a timer of only one second, and define the stop, which returns it to its original position.</p><p>Returning to my start, I made sure the camera began in its original position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/1*O37qGn5l8WrUjf_Wxu5Atg.png" /></figure><p>In my update I added the if statement so it was constantly checked for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*99Jdr9U8yot7T-_jM14d8Q.png" /></figure><p>Then to trigger it when the player is hit, I called it from my damage method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*CFZX0bAyxLvbAHT4k1jf7A.png" /></figure><p>I toyed with the threshold on it in the Unity inspector before deciding that one was perfect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*UspXkuMzIhyT5KSWL54qVg.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16ede112f10a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>