In terms of lines of code, (Javascript?), how many lines would say you coded up for that?
Unity's very object-oriented. What you do is write individual scripts for each object that you want to control, rather than one monolithic program. There are a dozen or so scripts in this case, ranging from just a few lines, to about 100 I think for the most complex. I'm too lazy to go through and add them up
, so I'm going to guess around 300 lines total (yep, Javascript). The cool thing is, because of this approach, you can frequently take scripts from other projects and re-use them with little or no modification. There are three or four scripts for that game that I just ripped off from other stuff I did...saves work.
Also, did you make the graphics in unity or import them from another app?
There are a few 3D primitives in Unity (cube, sphere, etc.), but normally you create graphics in other apps. Unity is for getting everything to work together. The pipeline is fantastic...you can actually modify graphics or models
while your project is running and immediately see the changes. There's no re-importing, either; you just save the file in whatever app you're using, and it's automatically updated in Unity.
Couple of things: (constructive feedback)
Good feedback, thanks.
I had the idea to do that game almost at the last minute, so it didn't get any playtesting or anything. Yep, I also got complaints about the reload time from others.
The delay is just a variable that I could set to anything. I tried for something that would add some challenge, but it seems most people would have liked it to be shorter. There was also confusion about the presents count...I tried to explain a little in the text below, but it's still not clear enough. It's actually correct; it starts out at 3 and goes down by 1 every time an alien successfully makes off with a present, so you don't want it to hit zero.
The text cursor works & displays fine, but the mouse doesn't display, but it does work (which is tricky, 'cuz you can't see it!). Would that be a unity bug?
Possibly. Up until the most recent version, the mouse cursor would always be visible except in full-screen mode, and even then it's always visible unless you specifically turn it off. But now you can make it disappear in windowed mode as well, though it has the behavior you noted. If you don't turn the mouse cursor off, this won't happen. It might just be an OS X thing; I think this can happen with other games in windowed mode as well.
Could it be that it might still be listening for keyboard events?
Yep. It depends on how you implement the input events...probably the way I did it wasn't ideal for a web player.
Very tough to hit, and tougher as the game progresses.
Heh...I use a gaming mouse as my usual mouse, and I was concerned that I was actually making it too easy.
Makes you appreciate the value of playtesting on a variety of different setups....
All in all - a VERY good job! I was laughing out loud!
Thanks! Unity makes it fun to make stuff like that. I love the built-in physics engine...when you shoot a UFO and the present tumbles onto the table, for example, that's almost completely unscripted. I just get rid of the UFO and let the physics engine take over, and gravity (plus mass, drag, friction, etc.) does the rest.
--Eric