Tag Archives: Unity3D

Rocket 5’s Unity3D “Flash in a Flash” Contest Entry: Jet-Skate Jo-Jo

Jet-Skate Jo-Jo logoHi everyone, this is just a quick update to tell you about our new circus themed web game called “Jet-Skate Jo-Jo” which you can play right here on our website.

The game came about because over the holidays, Unity3D hosted a game creation contest titled “Flash in a Flash” where developers could submit a Flash game using the new Flash exporter in the Unity3D 3.5 Developer Preview. With a $20k first prize and a bunch of really good 2nd and 3rd place prizes, Cathy and I decided to dive head first into the competition.

For our submission we wanted to make a new game from scratch that would take advantage of as many of the great features that Unity3D brings to Flash web game publishing as possible like physics, real time lighting and of course a 3D character and environment. Since the schedule was super tight, we knew we had to make a game that was small enough to finish in a short amount of time while still being visually impressive and fun. The contest time ran from December 22nd and ended on January 5th which of course conflicted with all kinds of holiday plans. In the end were able to spend about 9 days working on the game. We submitted the game at 2:30 AM Eastern time on January 5th which gave us about 30 minutes of padding before the contest submission deadline! We ended up having to cut a few things from the game like sound, high scores and there are a few little bugs that I wish we could have fixed, but overall we made a really great little game in a super short amount of time that we’re all really happy with.

A quick shout out to our team: Cathy Feraday Miller did all of the character animations, designed the logo and contributed to much of the game design. Paul Capon did all of the level and prop modeling and texturing, monkey textures and the skate model. David Huynh rigged and weighted the monkey character which was originally modeled and rigged by Shaun Budhram and Roger Liu. Tim Miller did the programming, game and level design and the UI design and art.

Jet-Skate Jo-Jo Screenshot

Jet-Skate Jo-Jo Screenshot

Jet-Skate Jo-Jo Screenshot

Play Jet-Skate Jo-Jo here and be sure to let us know what you think of the game in the comments. And as always be sure to follow us on Facebook and Twitter to keep up to date on all the latest news from Rocket 5.

Christmas Carnage, Game Jam Style!

This past weekend we took part in the 10th installment of the Game Prototype Challenge, a monthly game jam billed as “a spur of the moment motivator for making games”. Not that we need any motivation since we’re always working on games here. But what we like about jams is that they get us to think about games differently since they usually involve including some kind of theme (“dreams” and “collectibles” for this jam) and they always have a very short deadline which gets us to try new things quickly without worrying about making the code necessarily clean or efficient.

Rocket 5 participated in GPC v.2 earlier this year with our game Snowball Jones And The Last Crusade, which I co-developed with Kevin Feraday.

This time around our Art Director (AKA my wife Cathy) and I took a stab at the challenge with a holiday themed, tongue-in-cheek spoof of the wildly popular game Angry Birds.  In our game, titled A Very Angry Christmas, you control the hero from our upcoming game XS Force as he steps up to defend our hungry friends the pigs from those incessant birds.  For us the game actually serves two purposes:  for the Prototype Challenge, and as an interactive holiday card that we’ll send around to all our friends and business partners.

A Very Angry Christmas

This was Cathy’s first time participating in a game jam and this was my third time.  We used Unity3D to make the game and we used pre-existing gameplay code from XS Force for the player controls.  We revised the input from touch screen to keyboard and mouse so that the game could be played in a web browser (and it works great on the iPhone too, using our existing touch controls).  I also relied on several excellent Unity plugins including:  iTween for various text and effect animations, 2D Toolkit for the animated sprites and RageSpline for the level background, which, next to iTween, is easily the best Unity plugin I’ve ever used.  Cathy did all of the character art and animations in Flash which were exported as .png’s and then added as sprites to Unity using 2D Toolkit.

If you happen to live in the Toronto area, you can play our games at the #GPC Arcade: Year-One Roundup presented by the Toronto Skillswap community at George Brown College on Friday December 16th. And if you’re not going to be there, you can play A Very Angry Christmas right here on our website!

Thanks for stopping by and please let us know in the comments if you have any thoughts on the game, and especially if you find any bugs :). This blog post is part of iDevBlogADay, a collection of indie developers writing about their development experiences.

Make A 2D Game With Unity3D Using Only Free Tools Part 4

Make A 2D Game In Unity3d Part 4This is part 4 of our tutorial series on making a 2D game in Unity3D with freely available tools and plugins. Part 1 introduced you to the tools we’re using, in Part 2 we built our first level and in Part 3 we hooked up the control scripts and setup the ladders and ropes so that the player can navigate levels. In this article we’re going to create a pickup item, hook up the scoring system and add the interface text which reports score, lives and level.

Hopefully you already went through part 2 and part 3 of the series, if you haven’t already you might want to go back and do them now so everything in this part will make sense.

If you’d rather skip ahead, you can download the project up to this point. You can also click here to play the game as it will be at the end of Part 4.

Adding The Scoring and Pickup Scripts

The game is working great so far – the player can move, climb ladders and shimmy across ropes. Now we’re going to add a “gold chest” pickup item and an interface to track scoring, player lives and the current level.

  • Download scoring and pickup scripts and unzip the file somewhere on your hard drive.
  • Copy Scoring.cs and Pickup.cs from the extracted .zip file and paste them into your project’s Assets/Scripts folder.

Modifications To Existing Scripts:

You’re going to need to make a few changes to the scripts from part 3 so that these new scripts will work.

  • Open xa.cs script and then uncomment the first line in the Class:
public static Scoring sc;
  • In the Start function, uncomment this line:
sc = (Scoring)(this.gameObject.GetComponent("Scoring"));
  • Open Player.cs, find the OnTriggerEnter function (line 256) and then uncomment the following code block:
if (other.gameObject.CompareTag("Pickup"))
{
	if (other.GetComponent<Pickup>())
	{
		other.GetComponent<Pickup>().PickMeUp();
		xa.sc.Pickup();
	}
}

Making The Pickup Sprite

You might remember from part 2, that you already added the pickup.png to the level sprite atlas and then created a level container object that points to the sprite atlas so we don’t need to do any additional Container setup to create the pickup.

  • Drag & drop the Sprite object from Orthello –> Objects –> Sprites into the Hierarchy or Scene which will create a new object named something like “Sprite (id=-3700)“. Rename that object to “pickup“.
  • Drag the level object that we created in part 2 from OT –> Containers and drop it on to the Sprite Container slot in the Inspector.

Your sprite will appear but it looks like the brick sprite that we made before, that’s because the brick is the first texture on the Sprite Atlases index.

  • Click and hold your mouse over the word “Frame Index” in the inspector (with the pickup object selected) and then drag the mouse to the right to scroll through the textures on the sprite atlas. The pickup texture is at index 16 so set it to that. The sprite should now look like a a white rectangle with a red box in the center and a black background.

Adjusting The Collision:

The sprite is a square, but we only want the object to be picked up only when the player touches the white part of the pickup.

  • Check the Collidable checkbox to add collision to the object.
  • Open up the drop down list next to Physics and then select Custom.
  • Under Box Collider, set the Center Y to -0.15, Size X to 0.8 and Size Y to 0.5. Leave Size Z set to 0.4.

Setting The Tag:

We need to tag the pickup so that the player will trigger it when touched.

  • Create a new tag by going to Edit –> Project Settings –> Tags
  • Add a new Tag in the Tags list (probably in Element 3 if you’ve been following the series) named “Pickup” (without the quotes). It’s important that the name is correct since Player.cs looks for this exact name.
  • Select the pickup object in the Hierarchy, then click on the drop down list next to Tags at the top of the Inspector and then select Pickup.

Add The Script and Make It A Prefab

Now we just need to add the Pickup.cs script to the sprite so that it will get “picked up” when the player touches it and we also need to turn it into a prefab so that it’s easy to place in all your levels.

  • Drag the Pickup.cs script from the Project Scripts folder and drop it on to the pickup sprite in the Hierarchy.
  • Drag the pickup object from the Hierarchy into the Prefabs folder in the Project tab to create prefab from the object.

The pickup is designed so that you can snap the bottom edge (the black part) of the sprite to the top edge of a brick sprite the white part of the powerup will be the correct height from the top of the brick. Duplicate your new pickup prefab a few times and place it around you level.

If you followed all of the steps so far, your pickup should look like this:
2dGamePt4 pickup

Add The Interface Text

At this point if you place the pickup in your level so that the player can pick it up, the sprite will disappear correctly as if he picked it up, but you’ll get some errors in the console because the Scoring script isn’t in the scene yet and we don’t have any UI to report the score. So let’s fix that.

  • First add the Scoring.cs script to the scene: Drag Scoring.cs from your Project’s Scripts folder and drop it on to the Scripts object in the Hierarchy. If you select the Scripts object, you’ll see that the Scoring script has a bunch of slots for text objects that we need to add – but first we need to create the text objects.
  • Download the G7 Silkworm font and unzip the file somewhere on your computer. This font isn’t exactly the same as the one used in the original Lode Runner game, but it’s pretty close. If there’s another font you’d rather use, go for it. And if you find a font that’s closer to the Lode Runner font, please let me know in the comments.
  • Create a new folder in your Assets folder named Fonts, locate the silkworm.TTF font on your hard drive and then copy it into the Assets/Fonts folder.
  • In Unity, select the silkworm font in your Project’s Fonts folder and then in the Inspector set the Font Size to 26.

Adding The Score Text:

  • Drag the silkworm font from the Fonts folder in the Project panel and drop it into the Hierarchy. This will automatically create a new GUI Text object in the Hierarchy using the silkworm font.
  • Rename the object to “Score Label
  • In the Text field under GUIText in the Inspector, type “SCORE” in all caps without the quotes. The Silkworm font only has uppercase letters so don’t try to use lowercase letters.
  • When you add a font to the scene, the X and Y position are automatically set to X 0.5 and Y 0.5, but we’re going to set the position of our fonts using the Pixel Offset so reset the X and Y Position to 0.
  • Change Pixel Offset X to 16 and Pixel Offset Y to 592. This should position the SCORE text to the upper left hand corner of the Game view (note you won’t see the text in the Scene view so look at the Game view to help position the text).

We also want to keep the scene nicely organized and make it a little easier to hook up the interface objects to the Scoring script later on. You’re going to make the Score Label object a child of the Scripts object and then you’ll duplicate each of the other text objects from this one in order to save a few of the setup steps.

  • Select the Score Label object in the Hierarchy and then drag and drop it onto the Scripts object in the Hierarchy so that it becomes a child of the Scripts object.
  • Expand the little arrow next to the Scripts object, select Score Label object and then duplicate it.
  • Rename the new text object to “Score Value“.
  • Change the Text to 0000000 (7 zeroes).
  • Change the Pixel Offset X to 150 and leave the Y set to 592.

Adding The Lives Text:

  • Select either the Score Label or the Score Value text object and duplicate it.
  • Rename the new text object to “Lives Label
  • Change the Text to LIVES.
  • Change the Pixel Offset X to 348 and leave Y set to 592.
  • Duplicate Lives Label object and rename it to “Lives Value“.
  • Change the Text to 000 (3 zeroes).
  • Change the Pixel Offset X to 480 and leave Y set to 592.

Adding The Level Text:

  • Select one of the other text objects you already created and duplicate it.
  • Rename the new text object to “Level Label
  • Change the Text to LEVEL.
  • Change the Pixel Offset X to 576 and leave Y set to 592.
  • Duplicate Level Label and rename the new object to “Level Value
  • Change the Text to 000 (3 zeroes).
  • Change the Pixel Offset X to 710 and leave Y set to 592.

Hooking Up The Scripts:

Now we need to connect the interface text objects to the Scoring script.

  • Select the Scripts object in the Hierarchy. Under the Scoring script in the Inspector, you’ll see slots for each of the GUIText objects we just created.
  • Select each of the text objects from the Hierarchy and drag and drop them into the corresponding slot on the Scoring script. For example, drag Level Label and drop it on to the Level Label Text field.

Once all of the text objects are connected to the Scoring script, press Play in Unity. You should see the SCORE, LIVES and LEVEL text turn to a red color that matches the border color and the number of lives should change to 005 and the level number should change to 001.

Now if you run the character over a pickup object in the game, the Score should increase by 250.

Make The Top Border

To help keep the interface text separate from the gameplay area, we’re going to add a thin border just under the interface text.

  • Create a new cube by going to Game Object –> Create Other –> Cube
  • Rename the object to “border top“.
  • Set the Transform Position X to 0, Y to 8.7 and Z to 1.
  • Set the Scale X to 26, Y to 0.2 and Z to 1.
  • Find the border material in the Materials folder and then drag and drop it on to the border top object. We created the border material in a previous article.

If you followed all of the steps above, then your Hierarchy and Inspector (with the Scripts object selected) should look the following:

2dGamePt4 Scoring Text

Creating The GLOBAL Prefab

Next we want to do some things to keep the scene nicely organized and also to make it easy to add the key components to any new levels that you create. We’re going to create a GLOBAL prefab that contains the Main Camera, the Scripts (which includes the interface text objects) and the top and bottom borders.

  • Create an empty game object by boing to Object –> Create Empty, zero out the transforms so that it’s at 0,0,0 on the X,Y,Z and then rename the object to “GLOBAL“.
  • Select the Main Camera in the Hierarchy and then drag and drop it onto the GLOBAL object so that the Main Camera becomes a child of GLOBAL.
  • Select the Scripts object in the Hierarchy and drag and drop it onto the GLOBAL object.
  • Select the border bottom and border top objects (make sure they’re not already a child of some other game object first) and drag and drop them onto the GLOBAL object.

That’s everything we need for the GLOBAL object, so now let’s turn it into a prefab that can be easily added to other levels and updated later if we need to make changes.

Make A 2D Game With Unity3D Using Only Free Tools Part 3

Welcome to Part 3 in this series on making a 2D sprite-based game with Unity 3D. In Part 1 I introduced you to the tools we’ll be using to make a Lode Runner style action game and in Part 2 we created the level sprites and built our first level. In this tutorial we’re going to be adding in the player, hooking up the scripts and adding collision to the ladders and ropes so that you’ll finally be able to run the character around in your levels.

This tutorial assumes that you have already followed along with Part 2 of this series so your project should be ready to continue on with the steps below. If you haven’t already done Part 2, you should go back and do that first so you can get a full understanding of how everything fits together. If you’d rather skip ahead, you can download the project up to this point. You can also click here to see how the game will look at the end of Part 3.

Making the Player Sprite Atlas

If you’ve been following the series, I know you’re excited to get the player character running around in the game, so the first thing we need to do is create a sprite atlas in TexturePacker.

  • Download the source sprite .png’s and unzip the file somewhere on your hard drive. If you already downloaded the sprites and added them to your project in Part 2, then you can skip this step.
  • Launch TexturePacker and then drag & drop all of the .png files from the sprites/player folder into the Sprites panel.

Texture Settings / Layout:

  • Set Algorithm to Basic
  • Set Border Padding to 1
  • Set Shape Padding to 1
  • Uncheck Trim

Texture Settings / Output:

  • Leave the Data format set to cocos2d.
  • Under Data File, click the little “…” button and browse to the location in your project’s Asset folder where you want to store your sprites (I put mine in Assets/SpriteAtlases), name the file “player” and then click Save.
  • TexturePacker automatically adds the .plist extension to the Data File, but Unity wants the file to be .xml. So in the text field, replace .plist with .xml.
  • The Texture File path should already be set to the same location as the .xml file except that it will have a .png extension so there’s nothing to do there.

If you followed the steps above, then your settings in TexturePacker should look like this (click the image to see a larger version):

Now if you click the Publish icon in TexturePacker and then switch back to Unity, you should see a player.png file and a player.xml file in the SpriteAtlases folder in the Project view.

If you don’t already have the project open in Unity, open it now and then load the scene that you created in Part 2 (eg. level1.scene).

We need to make a couple of changes to the sprite atlas in Unity so that it looks correct.

  • Select the player.png file in the Project tab. In the Inspector change the Filter Mode to Point.
  • Click the Override for Web box, set the Format to Truecolor and then click Apply.

Making the Player Sprite

Now we’re ready to turn the player’s sprite atlas into animated sprites using the Orthello 2D plugin.

The Sprite Container:

  • In the Unity Project tab, expand the Orthello folders: Orthello –> Objects –> Sprites –> SpriteAtlas and then drag the SpriteAtlas-Cocos2D object into the Hierarchy.
  • In the Hierarchy tab, expand the OT object and then the Containers object and you will see your new container with a name something like “Container (id=-6840)“. This is the Container that will hold all of our player sprites from the atlas we made so you can rename the Container to something obvious like “player“.
  • Drag the player.png from the SpriteAtlases folder and drop it on the “OTSprite Atlas Cocos 2D” script’s Texture slot.
  • Drag the player.xml from the Project, SpriteAtlases folder and drop it on to the Atlas Data File slot. Now if you drop down the little Atlas Data arrow, you should see that it’s populated with all the sprite atlas data that TexturePacker generated for us.

Setting Up The Player Animations:

Now we need to assign all of the frames from the sprite atlas to individual animations.

  • Drag an Animation object from Orthello –> Objects –> Sprites into the Hierarchy. This will add a new object under OT –> Animations named something like “Animation (id=-4320)“. Rename this object to “player anims“.
  • With the new “player anims” OTAnimation still selected, adjust the settings to match those in the following image. To populate the Container field, drag & drop the “player” object from OT –> Containers on to the Container field.

Click the image to see all of the animation settings:

Making The Player Sprite

  • Next find the AnimatingSprite object in Orthello –> Objects –> Sprites object in the Project tab and drag it into the Hierarchy, this will make a new object in the scene with a name like “Animating Sprite (id=-23050)“. Rename this object “player“.
  • With the new player object still selected in the Hierarchy, drag the “player anims” object on to the Animation slot. The Sprite Container slot should automatically fill with a reference to the “player” container object, if it doesn’t you can drag & drop that onto the slot.
  • Now you should see the player sprite in your scene and if you press Play in Unity, the sprite will animate through all of the frames in all of the animations. We don’t want the animation to play on start so uncheck the Play On Start checkbox.

Adding Collision To The Player

In order for the player to collide correctly with the ladder and rope colliders we’ll be creating later, we need to set the following.

  • With the the player “OTAnimating Sprite” still selected in the Hierarchy, check the check box next to Collidable. This will automatically add a Rigidbody component to the object.
  • Click the dropdown list next to Physics and select Custom from the list.
  • Under Transform, set the Scale Z to 1.
  • Change the Depth to -1.
  • Under Box Collider, set Center Y to -0.1 and Z to 1. Change Size X to 0.45, Y to 0.6 and Z to 0.4.

If you followed the steps above, the settings on the player sprite should look like the following image.

Click on the image to see all of the settings:

Changing the Depth to -1 and the Center Z to 1 on the Box Collider will position the Collision at 0 on the Z axis while moving the player sprite 1 unit towards the camera. This has 2 effects: it makes sure that the player will always be visible in front of the level sprites while keeping the collision at 0 on the Z so that it will collide with the ladder and rope triggers. It sounds kinda strange, but you can see how it should look in this screen shot:

2dGamePt3 Player Collision

Setting Up The Shooting Animation

We need to add another animating sprite so that when you press the fire button, you’ll see a bullet blob animate from the player and hit the ground.

The Shoot Animation:

  • Drag an Animation object from Orthello –> Objects –> Sprites into the Hierarchy. This will add a new object under OT –> Animations named something like “Animation (id=-4320)“. Rename this object to “shoot anim“.
  • With the new “shoot anim” OTAnimation still selected, adjust the settings to match those in the following image. To populate the Container field, drag & drop the “level” object from OT –> Containers on to the Container field. Remember that we already added the shoot sprite animation to the level sprite atlas in Part 2 of the series.

2dGamePt3 Shoot Sprite Animations

The Shoot Sprite

  • Next find the AnimatingSprite object in Orthello –> Objects –> Sprites in the Project tab and drag it into the Hierarchy, this will make a new object in the scene with a name like “Animating Sprite (id=-23050)“. Rename this object “shoot“.
  • With the new shoot object still selected in the Hierarchy, drag the “shoot anim” object on to the Animation slot. The Sprite Container slot should automatically fill with a reference to the “level” container object, if it doesn’t you can drag & drop that onto the slot.
  • Set the Transform Position X to -1 so that the sprite is position to the left of the player’s sprite.
  • Set the Depth to -1 so that the sprites will appear in front of the level sprites.
  • Set the Frame Index to 18.

Now you should see the shoot sprite in your scene and if you press Play in Unity, the sprite will animate through all of the frames in all of the animations. We don’t want the animation to play on start so uncheck the Play On Start checkbox.

We only want to see the shoot sprite when the player is actually shooting so uncheck the checkbox next to Mesh Render on the shoot sprite. This will hide the sprite in the scene until we show it again later with a script.

Parenting The Shoot Sprite

We want the sprite to move with the player and we also need to flip the sprite so that it’s either on the player’s left or right side depending on which way the character is facing.

  • Go to Game Object –> Create Empty
  • Rename this object to “shoot parent” and make sure the X, Y, Z Position on the object is set to zero.
  • In the Hierarchy, drag and top the shoot sprite on to the shoot parent so that the shoot sprite becomes a child of the shoot parent object.
  • Drag and drop the shoot parent object on to the player sprite so that it’s a child of the player.

If you followed all the steps so far, your Hierarchy should look something like the following image. Note that I put all of my level tiles under an empty game object named LEVEL to keep things organized.

2dGamePt3 Player Parenting

Note that in order for the scripts to work, the child objects under the player must be named exactly as shown in the above image.

Hooking Up The Scripts

We’re finally ready to add the scripts so that the player can move!

  • Download the player scripts and unzip the file somewhere on your hard drive.
  • Drag the Scripts folder from the .zip into your project’s Asset folder.
  • Create an empty game object by going to Game Object –> Create Empty
  • Rename the new object to something like “Scripts“.
  • Drag and drop the xa.cs file from the Project tab onto the Scripts object in the Hierarchy.
  • Drag and drop the player.cs and the playerAnims.cs files from the Project tab on to the player object in the Hierarchy.
  • Make sure that the player is positioned above a brick tile so that she has something to stand on. Remember that it’s the player’s Box Collider that actually collides with objects in the world and not the visible sprite object, so the box will be positioned at something like 0,0,-1 (X and Y can be anywhere in the level but Z should always be -1).

Now if everything is setup correctly, when you press Play in Unity the player should stand on a brick tile without falling through it. And if you press left and right on the keyboard the player should move and the run animations should play.

Describing how the scripts work is beyond the scope of this tutorial, but I did add comments to the scripts that should hopefully help you understand how everything is working. If you have questions about anything in the scripts, please feel free to ask in the comments below or email me directly.

Adding The Ladder Colliders

In order for the ladders to work, we need to add colliders to them.

Creating A Ladder:

  • Go to GameObject –> Create Other –> Cube
  • Rename the Cube to something like “Ladder“.
  • Open the Tag Manager by going to to Edit –> Project Settings –> Tags
  • Under Tags in the next available slot (probably Element 1) type “Ladder” and then in the next slot after that, type in “Rope” (without the quotes).
  • While we’re here, we need to add another layer. Under the next empty User Layer (probably User Layer 9), type “NoDraw” (without the quotes).
  • Now click on the Ladder cube you created before and change the Tag to “Ladder” and then change the Layer to “NoDraw“.

Hiding Objects In The Game View:

You’ve probably noticed that the Ladder collider is visible in the Game view but we don’t want to see these in the actual game. To hide them, we need to make a change to the camera.

  • Click on the Main Camera object in the Hierarchy.
  • Under Camera, drop down the list next to Culling Mask and click on “NoDraw” to deselect it. Now any object that is in the “NoDraw” layer will be hidden in the Game view.

Sizing And Positioning The Ladder:

Every ladder in the scene needs to have one of these Ladder colliders and we need to adjust the size of the Ladder colliders to match the height of each of the ladders in the level. The ladder collider needs to be 1 unit taller than the visible ladder – so if your ladder is 4 tiles (sprites) tall, then the collider needs to be 5 units tall.

  • Assuming your ladder is 4 sprites high: Select the Ladder collider and change the Scale Y to 5 (1 unit taller than the visible ladder).
  • Snap the Ladder collider to one of the lower corners of the bottom sprite using the Vertex Snap feature in Unity.
  • You can duplicate this object, resize the Y and snap it to all the other ladder sprites in your level.

Your ladder should look like this (click to see a larger version):
2dGamePt3 Ladder Trigger

Now if you press Play in Unity and then walk the player over to the ladder, she should be able to climb up and down the ladder, the player’s sprite should be playing the climb animation and you should be able to exit the ladder at the top and bottom levels and also fall off the ladder if you exit somewhere in the middle.

Adding the Rope Colliders

The rope colliders follow pretty much the same setup as the ladders.

Creating A Rope:

  • Go to GameObject –> Create Other –> Cube
  • Rename the Cube to something like “Rope“.
  • Change the Tag to “Rope” and then change the Layer to “NoDraw“.

Sizing And Positioning The Rope:

Like the Ladders, every rope in the scene needs to have one of these Rope colliders. But unlike the Ladders, the Rope colliders must be the same width as your rope sprites.

  • Assuming your rope is 4 sprites wide: Select the Rope collider and change the Scale X to 4 (Y and Z scale should be 1).
  • Snap the Rope collider to one of the lower corners of the bottom sprite using the Vertex Snap feature.
  • You can duplicate this object, resize the X and snap it to all the other rope sprites in your level.

Your rope should look like this (click to see a larger version):
2dGamePt3 Rope Trigger

Now if you press Play in Unity and then walk the player over to the rope, she should be able to climb left and right along the rope, you should see the rope hang animation playing and if you press the down arrow while hanging from the rope, she should let go of the rope and fall.

Conclusion

Now you have everything you need to make levels that support the player’s full suite of movements: running, ladder climbing and rope shimmy. In the next tutorial, we’re going to be adding the scoring system, breaking out brick tiles and picking up objects.

You can download the project up to this point and you can play the web version of the project here.

If you like this post, please be sure to say hi in the comments and follow me on Twitter and Facebook. Your support helps to keep these tutorial coming. This blog post is part of iDevBlogADay, a collection of indie developers writing about their development experiences.

Regarding The AI:

When I began this series, It was my intention to include enemies that could follow the player around the level using behaviors similar to the original Lode Runner game. However my time has become increasingly limited and my programming skills aren’t fully up to the task of recreating their AI so I might not be able to get AI into this the series.

If you are a programmer who would like to contribute an AI behavior solution to this tutorial series, please contact me.

More Tutorials In This Series

Make A 2D Game in Unity3D Using Only Free Tools Part 1
Make A 2D Game in Unity3D Using Only Free Tools Part 2
Make A 2D Game With Unity3D Using Only Free Tools Part 3
Make A 2D Game With Unity3D Using Only Free Tools Part 4
Make A 2D Game With Unity3D Using Only Free Tools: Beginning Enemy AI With A* Pathfinding

And here’s another tutorial series that uses Sprite Manager 2 for the sprite display and animation duties:
Creating 2D Games with Unity3D Part 1
Creating 2D Games with Unity3D Part 2
Creating 2D Games with Unity3D Part 3
Creating 2D Games with Unity3D Part 5

Show Your Support

If you find these tutorials useful, please considering buying one or more of our games and apps for iPhone and iPad. Your support helps to keep the tutorials flowing!

  • Giant Moto: High flying arcade style motocross action!
  • Small Space: Fly a spaceship, eat space creatures, score point!
  • Holeshot Drag Racing: High speed drag racing action!
  • Alien Booth: Transform pictures of your friends into awesome aliens!
  • iSpoof Walken: A hilarious look into the world of Christopher Walken!
  • Gaga Eyes: Transform pictures of your friends to give them huge anime eyes!

About the author

Tim MillerTim Miller is a veteran game developer with over 15 years experience in the video game industry working as a Level Designer and Lead Level Designer at LucasArts, Secret Level and Nihilistic Software. He co-founded Rocket 5 Studios with his wife Cathy and their dog Rocket in 2009. Twitter, LinkedIn, Portfolio