| View previous topic :: View next topic |
Eric5h5
Joined: 19 Jul 2006 Posts: 6917
|
Posted: Sun May 13, 2007 2:28 am Post subject: Unity Invaders |
|
|
|
Well, folks, after 6 days it's finally done: The story is that you're on a big asteroid in an asteroid belt defending the...something...from invaders from, er, somewhere...nah, never mind, it's just Space Invaders.
Since it's a relatively small project (~500 lines for the main script, probably about 400 or so total for the others), I thought it might make a decent example of a complete game for newcomers to maybe learn a few things from, so I'm attaching the project folder, as well as a web player and a UB stand-alone. I think some things are easier to understand in context, and this ended up covering quite a few areas...2D sprites in a 3D environment, particle effects, sound, scoring, physics, multiple camera techniques, layers, a bit of level management, etc.
Hopefully the code isn't too horrible, though my use of which scripts control which objects tends to be kind of arbitrary at times. I tried to comment some of the more obtuse areas, though it's not really much more than I usually do for myself anyway, so if there are any questions, I can try to answer them. It's entirely likely there are things that should be done in a better way, as well, so if anyone happens to find anything particularly stupid (or bugs), please let me know.
There are some elements that are easily tweakable in the inspector, of course (on the "InvaderControl" script mostly), but it might make an interesting exercise to expand on the game if anyone feels so inclined. Powerups, different alien behavior, bosses, etc. Right now it's just yer basic Space Invaders.
All the code and graphics and most of the sound is ©2007 by me, and is provided for instructional purposes only, please don't use in your own projects (not likely that you'd want to anyway) without written permission etc. etc. blah blah, you know the drill. You can however distribute any modifications of this project. A few of the sounds are public domain and several are modifications of sounds from the Gear Worx Productions "modern weapons and warfare" sound pack. $20 was a good deal!
Controls are what you'd expect...by default, arrow keys to move, ctrl/space to fire (and also starts the game for the mouse-challenged.) Oh, and see if you can find the easter egg on the title screen. No fair looking at the source code. Hint: people with 1-button mice (surely nobody here) shouldn't bother to try....
--Eric
| Description: |
| Stand alone Universal Binary |
|
 Download |
| Filename: |
Unity Invaders.zip |
| Filesize: |
9.4 MB |
| Downloaded: |
901 Time(s) |
| Description: |
|
 Download |
| Filename: |
Invaders.zip |
| Filesize: |
6.48 MB |
| Downloaded: |
1014 Time(s) |
| Description: |
|
 Download |
| Filename: |
UnityInvadersWeb.zip |
| Filesize: |
1.38 MB |
| Downloaded: |
657 Time(s) |
Last edited by Eric5h5 on Tue Oct 21, 2008 12:21 am; edited 1 time in total |
|
| Back to top |
|
|
bronxbomber92
Joined: 11 Nov 2006 Posts: 885
|
Posted: Sun May 13, 2007 3:16 am Post subject: |
|
|
|
Nicely done! I couldn't get past the coin slot though....
Naw, j/k, it only took me ten minutes. The game was fun, glad you released the project to
|
|
| Back to top |
|
|
Seon

Joined: 10 Jan 2007 Posts: 986 Location: Melbourne, Australia
|
|
| Back to top |
|
|
Ulognep Senior QA Specialist

Joined: 31 Aug 2005 Posts: 569 Location: UT HQ, Copenhagen
|
Posted: Sun May 13, 2007 3:29 am Post subject: |
|
|
|
| Excellent job! I found this to be quite addicting, actually. I wanted to keep pumping in virtual quarters to try again. Nicely done!
|
|
| Back to top |
|
|
Lallander

Joined: 23 Apr 2006 Posts: 428
|
Posted: Sun May 13, 2007 3:51 am Post subject: |
|
|
|
Great handling overall. The coin thing took me about 4 - 5 tries before i realized you needed to line up the shadow.
The invaders do seem much more agressive then the original.
|
|
| Back to top |
|
|
forestjohnson

Joined: 01 Oct 2005 Posts: 1346
|
Posted: Sun May 13, 2007 4:26 am Post subject: |
|
|
|
This is a lot harder than the space invaders I played. A couple things I might change:
The falling invaders should be able to be shot and also be a hazard to the player.
Slow down the enemies bullets and make there be less of them, if you want it to be more like the famous space invaders games.
The game over sequence seems a bit too long?
I love the coin thing too! Should I be able to skip it with space?
Just think if you had an actual quarter for each time we have played it so far...
|
|
| Back to top |
|
|
Eric5h5
Joined: 19 Jul 2006 Posts: 6917
|
Posted: Sun May 13, 2007 4:34 am Post subject: |
|
|
|
| Ulognep wrote: | | I found this to be quite addicting, actually. |
Me too...I'm not sure why. I mean it's a nearly 30-year old game. Oh well, at least it got a lot of play-testing....
When I first implemented the bombing routine, the invaders just bombed randomly. I quickly realized that made it way too easy, but fortunately it was just a matter of a few lines of code to bolt on some proximity logic. Now the program chooses a random number to decide whether to bomb randomly or not. I started at 80% but that was a bit much. I think it's at 50% now, which seemed about right, but if you just change that one number to something lower, that will make it easier. You can also make it so they start dropping 2 bombs at once (the maximum) later on if you like. It's possible they start doing that too early.
And here's a screenshot...I thought I attached it to my first message, but then again there's a 3-attachment limit, isn't there.
--Eric
|
|
| Back to top |
|
|
Marble

Joined: 29 Aug 2005 Posts: 722 Location: Norwich, Norfolk
|
Posted: Sun May 13, 2007 4:55 am Post subject: |
|
|
|
| Cool. And rather difficult, actually!
|
|
| Back to top |
|
|
VICTOM

Joined: 28 Aug 2005 Posts: 221 Location: NYC - Hoboken -
|
Posted: Sun May 13, 2007 8:38 am Post subject: |
|
|
|
Great remake, much harder than original. I love the damage shake. You can really feel the pain. But level one is too hard
Cheers,
|
|
| Back to top |
|
|
Marble

Joined: 29 Aug 2005 Posts: 722 Location: Norwich, Norfolk
|
Posted: Sun May 13, 2007 10:01 am Post subject: |
|
|
|
| That's a really clever way to make destructible 2D objects, Eric!
|
|
| Back to top |
|
|
zoul

Joined: 05 May 2007 Posts: 50 Location: New Jersey
|
Posted: Sun May 13, 2007 10:54 am Post subject: |
|
|
|
very well done -- and what a great use of the "modern weapons and warfare" pack ... I personally never thought of using it for something like this ... and check it out ... it works!
Great job ... and excellent choice for a classic!
The thing I loved the most, aside from the obvious use of one of our products (heh), was the coin drop ... and the 3d backgrounds ... I also loved the overly pixelated 2d artwork ... excellent work!
_________________ David Higgins - Developer
Fragmented Code - http://fragmentedcode.com
Gear Worx Productions - http://gearworxprod.com
PunkArts - http://www.punkarts.com
Last edited by zoul on Sun May 13, 2007 11:04 am; edited 1 time in total |
|
| Back to top |
|
|
GWPGearWorx

Joined: 29 Apr 2007 Posts: 169
|
Posted: Sun May 13, 2007 10:58 am Post subject: |
|
|
|
That is awesome to hear some of my sounds were put to good use, looks and plays great, addicting little game. Well done, gotta love the classics.
_________________ Steve Adamson
President
Gear Worx Productions Inc.
http://gearworxprod.com
Follow Us On Twitter:
http://twitter.com/GWPGearWorx |
|
| Back to top |
|
|
DaveyJJ

Joined: 24 Mar 2005 Posts: 1431 Location: Waterloo, Ontario, Canada
|
Posted: Sun May 13, 2007 12:13 pm Post subject: |
|
|
|
Eric5h5, can I post the web player version on the showcase section of Widget Monkyy Games, please?
Love it. And agree it's harder than the original (which stole so many of my $0.25 I'd rather not remember).
_________________ DaveyJJ
www.kokotap.com <- Fun, simple, joyful games for the iPhone and iPod Touch
www.widgetmonkeys.com <- seriously simple fun
www.widgetmonkeygames.com <- Developer of fun games made with Unity
Last edited by DaveyJJ on Sun May 13, 2007 3:35 pm; edited 1 time in total |
|
| Back to top |
|
|
drJones
Joined: 19 Oct 2005 Posts: 1342 Location: New Hampshire
|
Posted: Sun May 13, 2007 3:03 pm Post subject: |
|
|
|
haha that's awesome! i'm surprised its in 2D - i'm eager to check out the project files to see how you got that all working (thanks so much for posting them ; )
go retro!
_________________ -O |
|
| Back to top |
|
|
HiggyB Unity Product Evangelist

Joined: 08 Dec 2006 Posts: 5105 Location: San Francisco CA USA
|
Posted: Mon May 14, 2007 6:58 pm Post subject: |
|
|
|
Fun stuff, good work! My only complaints/suggestions:
1. While I enjoyed the whole "drop the coin in the slot" bit, maybe you can (a) expand the coin slot a bit, it took me 3 tries to get it right (sorry, still drinking my coffee this morning ;P), and (b) have an option to skip it.
2. Can you have it auto-fire if I just hold down the spacebar? I'm lazy and want it to repeatedly fire if I hold down the fire key.
Otherwise yes, it is very addictive. It truly does remind me of all those days I spent riding my lil' dirt bike over to the arcade to promptly burn through my entire weekly allowance playing video games... Ahh, good times!
_________________ Tom Higgins - Product Evangelist at Unity Technologies ApS
http://unity3d.com | http://blogs.unity3d.com
Want to discuss my avatar? Do it here. |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|