Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Unitroids

Discussion in 'Made With Unity' started by Eric5h5, May 21, 2007.

  1. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Here we go again. ;) "Asteroids" this time, because I could reuse a lot of the assets from Unity Invaders...hey, I already had those asteroids in the background, it was inevitable.... So it took less time, and it gave me an excuse to implement a few functions that I'm using elsewhere anyway. Again, nothing modernized as far as gameplay goes, but stuff blows up real good. (Well, and there are difficulty levels.) Although that's it for now, I think...don't start expecting Retro Unity-ified Arcade Game O' The Week or anything. :)

    Check out the wrap-around on the large asteroids: they appear on one side of the screen as they disappear on the other. I spent some time trying tricks with multiple cameras, and it almost worked, but there was some minor glitching I couldn't get rid of, so I had to do it the hard way. Oh well...probably not even worth it. ;) Aside from using hyperspace to get out of the way when you're stuck between a rock and...another rock (if you're fast enough), you can use it to warp in during those occasions when you've managed to fill the screen with debris and then you die, and you get bored waiting for the game to decide there's enough of a clear area to warp in.

    Plus there's a few more sounds derived from the Gear Worx Productions weapons audio pack, including the thrust sound effect, strangely, though you'd never know.... (The warp sound effect was originally a buzz-saw, yay for Audacity!)

    Edit: Updated stand-alone and web-player below.

    --Eric
     

    Attached Files:

  2. Marble

    Marble

    Joined:
    Aug 29, 2005
    Posts:
    1,271
    Really rather good. I like the additions you've made to the "menu." I've been trying to do something only slightly different for a couple of months and here you are with another sub-week project. You're great, Eric!
     
  3. seon

    seon

    Joined:
    Jan 10, 2007
    Posts:
    1,441
    Eric: Unreal! Love it!
     
  4. cblarsen

    cblarsen

    Joined:
    Mar 10, 2007
    Posts:
    266
    I never could play asteroids, so I appreciate the "easy" setting.

    It all looks and sounds cool. Shooting wildly at the start of a level results in wonderful waves of thunder :D
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Nah, I'm not great, Unity is. :) Here's the updated files...a couple of bugfixes.

    --Eric
     

    Attached Files:

  6. happysteve

    happysteve

    Joined:
    Oct 29, 2008
    Posts:
    5
    It's probably asking too much but, would you mind posting your project or your code? I know it would greatly enhance my learning (and probably others as well) of both scripting and unity =)

    I chose to try and make a similar spawn for my first learning project so it would really rock to look through your scripts. Asteroids is a great example of basic gameplay and design. Perfect to start with.

    Sorry if I'm out of line here...
     
  7. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Put this up on the apple store Eric.
     
  8. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I did post the project for Unity Invaders. Unitroids is unfortunately messier since I hacked it together pretty quickly, so I wouldn't want to inflict that on people. ;) As for the Apple store, nah, it's just a direct clone of Asteroids; I could only justify releasing it for free, and frankly I wouldn't want to put the effort into making an iPhone version (relatively little effort as it would be, maybe).

    --Eric
     
  9. theinfomercial

    theinfomercial

    Joined:
    Sep 9, 2008
    Posts:
    1,000
    It might build up your rep for iPhone gamers if you give them a game for free. I'd make the (little) effort to build for the iPhone.

    P.S. Cool desktop icon you have for this game. :D

    P.P.S. Ingame music. Spacey-Techno maybe. And a game over sound so you won't be left mute when game over plays.
     
  10. aaron-parr

    aaron-parr

    Joined:
    Apr 22, 2007
    Posts:
    577
    I still play this now and then. Its good fun.

    I think you got the controls right which is one of the secrets to why Asteroids was so much fun in the olden times
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Yep...Unity makes it easy to tweak stuff, so it's not hard to sit there and fiddle with the controls until it feels right, as opposed to the usual "eh, it works, good enough" methods because it's too much trouble to change things.

    Anyway, it's not Asteroids, but my 2D shooter tutorial uses pretty much the same controls, and has the project available, so hopefully that would serve just as well as an example.

    --Eric
     
  12. 64746c

    64746c

    Joined:
    Oct 21, 2007
    Posts:
    181
    I'm not loving the controls that much, actually. I probably didn't spend nearly enough time playing the real thing when I was younger ;). I think it would be more intuitive to simply have the up arrow key mapped to thrust.

    I liked the feel, graphics and sound. One thing that bugged me, however, was the way shots were fired. Is this supposed to simulate overheating, where the gun shuts down until it cools off enough? I would (ever-so-humbly) suggest that you limit how fast shots are fired one after another, and not disable firing for a period of time if you shoot too fast.

    I was going to suggest you add some novelties (powerups, bosses, etc) to make this iPhone-worthy but I honestly have no idea how the control scheme would work for the iPhone. :D
    Keep it up!
     
  13. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Feel free to assign whatever keys you like to thrust. ;) (As long as you're running the standalone, of course.)

    Hey, it's Asteroids--all I did was clone it. :) Anyway, I think that adds to the strategy, so IMO the original programmers got that bit right.

    True, and with extra stuff it wouldn't be Asteroids anymore...which was kind of the point....

    Thanks!

    --Eric
     
  14. 64746c

    64746c

    Joined:
    Oct 21, 2007
    Posts:
    181
    Oh yeah, the standalone... heh. I'm used to downloading webplayers whenever possible simply because, as a child of the Generation of Impatience™, I would rather not wait! ;)

    Agreed, but if you were intending to sell this game, I would guess that people would either want a few extra gameplay elements or something almost completely identical to the original (in graphics and gameplay).

    Do what you want though, it is your game after all!
     
  15. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Nope, no intentions there. :) I did this a year and a half ago as basically a quick programming exercise; I'd rather focus on new stuff.

    --Eric
     
  16. 64746c

    64746c

    Joined:
    Oct 21, 2007
    Posts:
    181
    Just noticed those dates... that explains a lot. :eek:
     
  17. drJones

    drJones

    Joined:
    Oct 19, 2005
    Posts:
    1,351
    nice work eric - you seem to have a knack for good old school gameplay (where's a ponies update? ; )

    sounds like you aren't working on it anymore but one thing i would mention, IMO at any difficulty level it should start with only a few dangers more discernibly ramp up over time for a better sense of progression. maybe you are doing that already but it was hard for me to notice because it starts with so many.

    fun game, good solid explosion too : )
     
  18. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    Well, as I mentioned, it's Asteroids, and works just like it. ;) (Well, OK, I did add those difficulty levels, which the original didn't have, but that's the extent of my desecration....) It adds two asteroids per level up to a max of 12, I think.

    --Eric
     
  19. jeeyoh

    jeeyoh

    Joined:
    Feb 4, 2013
    Posts:
    4
    I really like the wrap around screen of the whole game, I'm also trying out to make my own wrapscreen. The only way I can think of is to put on 2 colliders for transporting but it will result some small "popping" everytime the game object was transported to the other edge. Do you have any tips? :D Thank you in advance! :D
     
  20. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The wrap code is:

    Code (csharp):
    1.         myTransform.position.x = Mathf.Repeat(myTransform.position.x, aWidth);
    2.         myTransform.position.z = Mathf.Repeat(myTransform.position.z, aHeight);
    There aren't any colliders involved.

    --Eric
     
    VAN-D00M likes this.
  21. VAN-D00M

    VAN-D00M

    Joined:
    Dec 24, 2013
    Posts:
    44
    How did you get that to work please Eric? I've been trying with if statement after if statement but its not really working out. That looks so simplified but I can't see how it works? :)
     
  22. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That's all there is...the code is in Update. There are no if statements.

    --Eric