Unity Community


Page 1 of 2 12 LastLast
Results 1 to 20 of 35
  1. Volunteer Moderator
    Posts
    23,726

    2D shooter tutorial

    I just put up a tutorial on the wiki here, involving the 2D shooter + level editor project from here. No, this isn't the long-awaited 2D platformer tutorial; it's just something I put together over the last couple of days. It's not about how to create a 2D game, but about working with and extending a Unity project, with some scripting, so I don't think there will be any overlap. At first it was just going to be a brief thing, but somehow it got...longer. I tried not to make many assumptions about the hypothetical reader's abilities, so I guess it's more oriented towards beginners. It could probably use some screenshots. However, I've also attached here an extended version of the project from the above link, with everything from the tutorial up till Part 7, section 2 included (except Part 6, section 1a, 'cause I was too lazy), which might be useful as an illustration if I explained stuff wrong or left something out. Which is likely , so let me know about mistakes, etc.

    NOTE: a newer version is available here. It's mostly the same as the attached version, but recompiled as a Unity 4.3 project. I'd replace the attachment here but that doesn't work for larger files anymore, so I'm leaving it for posterity or something...maybe people who for some reason are using an earlier Unity version....

    --Eric
    Attached Files


  2. Posts
    5,283

    Re: 2D shooter tutorial

    Wow, this looks like you've invested quite some time into it. I only rushed over it but it looks very good!
    I can't use these two things together.


  3. Location
    32.71 N, 117.15 W
    Posts
    5,419
    Yo Ho Ho, Santa Eric's has delivered goodies for all us little Unitee's!

  4. Volunteer Moderator
    Posts
    23,726
    Thanks; hopefully someone gets something from it. Forgot to say, I updated the project from the first link (the non-extended version), so if anyone downloaded that previously, it's been changed a little since then and won't quite work with the tutorial.

    (I don't think Santa says "yo ho ho" unless he's also a pirate with a bottle of rum. )

    --Eric


  5. Posts
    5,283
    /me starts singing Yo-ho, Yo-ho a pirate's life for me!
    I can't use these two things together.


  6. Location
    Waterloo, Ontario, Canada
    Posts
    1,559
    I now know that Eric IS Santa! Thanks very much for all the gifts during the last few weeks.
    DaveyJJ
    // aka Unity forum member #5 (and yet, I still can't code)


  7. Location
    New Hampshire
    Posts
    1,352
    wow eric that's awesome - finally got a chance to look at it and its chock full of cool stuff (that level editor is sweet!)

    fantastic work & very generous of you ; )
    -O

  8. Volunteer Moderator
    Posts
    23,726
    OK, it's been bugging me for days that I didn't implement all the scripting suggestions from the last couple pages of the tutorial, so I went ahead and finished it (except for the "lots o' stuff" part). So now the enemy ships won't crash into walls and they do pathfinding, so they can go around walls instead. Updated project folder above...replace the SimpleEnemy prefab on the Manager script with the Enemy prefab if you want to see the more advanced scripts in action. I updated Part 7 of the tutorial to cover some of the new stuff.

    --Eric


  9. Location
    Melbourne, Australia
    Posts
    631
    Thanks Eric for this great asset and tutorial!

    Cheers.


  10. Location
    Copenhagen
    Posts
    45
    Thanks Eric

    Very helpful to us Unity newbies.

    Happy new year!
    Go play some jazz...


  11. Posts
    154

    thanks!

    hey!

    This is great...Ill dig thru this as well! thank you!

    Looks like there are still lots of people who love the ol 2d!

    ( doh - Im using iPhone Unity - so the types are all required to be strict...do you you have a web based gameplay version of this? )

    cheers,

    Tj

  12. Volunteer Moderator
    Posts
    23,726

    Re: thanks!

    I put #pragma strict on all the scripts...there were only 2-3 lines that needed to be changed after doing that, but here's the whole lot anyway.

    --Eric
    Attached Files


  13. Posts
    154

    awesome!

    hey

    this is awesome...thank you for sharing. Its like Asteroids in a cave!

    thank you again.

    cheers,

    Tj


  14. Posts
    358
    Hi Eric,

    I downloaded the code but kept getting the following error on Unity 2.1:

    Assets/2DShooter Assets/Scripts/FPSCounter.js(7,2): BCE0153: 'UnityEngine.RequireComponent' can be applied on one of these targets only : Class.

    I had to replace it with

    @script RequireComponent(GUIText)

    Also, it's amazing how horrible I am at this game.

  15. Volunteer Moderator
    Posts
    23,726
    Oops, thought I fixed that ages ago. Anyway you can make levels as easy as you want them to be, so make a level without any enemies, then you will be awesome at the game.

    --Eric


  16. Posts
    245
    I got that error on my pc, unity 2.51

    MissingReferenceException: The variable shootSound of 'BulletControl' doesn't exist anymore. This happened in the game object "Bullet2".
    You probably need to select the "Bullet2" in the hierarchy and reassign the shootSound variable of the 'BulletControl' script in the inspector.


  17. Posts
    125
    Awesome game and scripts Eric5h5, thanks again and a merry yo ho ho with a bottle of brandy!


  18. Location
    Austin, Texas
    Posts
    2,146
    We will all remember this as the day we were given awesomeness by Captain Jac...erm, Eric5h5.

    Yar.

  19. Volunteer Moderator
    Posts
    23,726
    Surely the day to be remembered is December 20, 2007 rather than today.... Thanks though.

    --Eric


  20. Location
    Australia
    Posts
    2
    Well - seems like I'm three years too late for this thread but the tutorial and sample project are both awesome still!

    I opened the sample project in Unity 3.0, did the automatic project upgrade it prompts you for and got a bunch of compile errors since it seems that they have made an official Unity class named 'EditorGUI' which conflicts with the script in the sample project. In case anyone's stuck on that I just renamed both the script file and all references to it in LevelEditor.js to 'MyEditorGUI' and now it's working great.

    Thank you Eric!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •