Unity Invaders
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Unity Community Index // Showcase
View previous topic :: View next topic  
Author Message
Eric5h5



Joined: 19 Jul 2006
Posts: 6917

PostPosted: Sun May 13, 2007 2:28 am    Post subject: Unity Invaders Reply with quote
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. Smile

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. Smile

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. Wink Hint: people with 1-button mice (surely nobody here) shouldn't bother to try....

--Eric



Unity Invaders.zip
 Description:
Stand alone Universal Binary

Download
 Filename:  Unity Invaders.zip
 Filesize:  9.4 MB
 Downloaded:  901 Time(s)


Invaders.zip
 Description:
Project folder

Download
 Filename:  Invaders.zip
 Filesize:  6.48 MB
 Downloaded:  1014 Time(s)


UnityInvadersWeb.zip
 Description:
Web player

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
View user's profile Send private message Visit poster's website
bronxbomber92



Joined: 11 Nov 2006
Posts: 885

PostPosted: Sun May 13, 2007 3:16 am    Post subject: Reply with quote
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 Smile
Back to top
View user's profile Send private message
Seon



Joined: 10 Jan 2007
Posts: 986
Location: Melbourne, Australia

PostPosted: Sun May 13, 2007 3:28 am    Post subject: Reply with quote
Very cool Eric! The invaders are a little more accurate and trigger happy, than what I remember... but a very good remake of the classic! Well done.
_________________
Seon :: Sector3 Games
http://www.sector3.com.au
http://blog.sector3.com.au
http://itunes.com/app/circuitdefenders
http://itunes.com/app/tankz
http://itunes.com/app/turetwars
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Ulognep
Senior QA Specialist


Joined: 31 Aug 2005
Posts: 569
Location: UT HQ, Copenhagen

PostPosted: Sun May 13, 2007 3:29 am    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website
Lallander



Joined: 23 Apr 2006
Posts: 428

PostPosted: Sun May 13, 2007 3:51 am    Post subject: Reply with quote
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
View user's profile Send private message
forestjohnson



Joined: 01 Oct 2005
Posts: 1346

PostPosted: Sun May 13, 2007 4:26 am    Post subject: Reply with quote
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... Razz
Back to top
View user's profile Send private message Visit poster's website AIM Address
Eric5h5



Joined: 19 Jul 2006
Posts: 6917

PostPosted: Sun May 13, 2007 4:34 am    Post subject: Reply with quote
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. Confused 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. Wink 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



Invaders2.png

Back to top
View user's profile Send private message Visit poster's website
Marble



Joined: 29 Aug 2005
Posts: 722
Location: Norwich, Norfolk

PostPosted: Sun May 13, 2007 4:55 am    Post subject: Reply with quote
Cool. And rather difficult, actually!
Back to top
View user's profile Send private message Visit poster's website
VICTOM



Joined: 28 Aug 2005
Posts: 221
Location: NYC - Hoboken -

PostPosted: Sun May 13, 2007 8:38 am    Post subject: Reply with quote
Great remake, much harder than original. I love the damage shake. You can really feel the pain. But level one is too hard Wink

Cheers,
Back to top
View user's profile Send private message
Marble



Joined: 29 Aug 2005
Posts: 722
Location: Norwich, Norfolk

PostPosted: Sun May 13, 2007 10:01 am    Post subject: Reply with quote
That's a really clever way to make destructible 2D objects, Eric!
Back to top
View user's profile Send private message Visit poster's website
zoul



Joined: 05 May 2007
Posts: 50
Location: New Jersey

PostPosted: Sun May 13, 2007 10:54 am    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website AIM Address
GWPGearWorx



Joined: 29 Apr 2007
Posts: 169

PostPosted: Sun May 13, 2007 10:58 am    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website
DaveyJJ



Joined: 24 Mar 2005
Posts: 1431
Location: Waterloo, Ontario, Canada

PostPosted: Sun May 13, 2007 12:13 pm    Post subject: Reply with quote
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
drJones



Joined: 19 Oct 2005
Posts: 1342
Location: New Hampshire

PostPosted: Sun May 13, 2007 3:03 pm    Post subject: Reply with quote
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
View user's profile Send private message
HiggyB
Unity Product Evangelist


Joined: 08 Dec 2006
Posts: 5105
Location: San Francisco CA USA

PostPosted: Mon May 14, 2007 6:58 pm    Post subject: Reply with quote
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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Post new topic   Reply to topic    Unity Community Index // Showcase All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
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