Skip navigation

Monthly Archives: December 2011

Had a great night last night – my friend Spud and I met up with some old school friends, Joe Clark and Chris Elliott. We went down the King’s Head pub in Stutton for a few drinks, after which we went back to Joe’s, broke out the N64 and played some four player Mario Kart, GoldenEye and Mario Tennis just like we used to when we were at school!

I got the HUD working today, (with a little help from http://answers.unity3d.com/questions/35562/score-with-gui-text.html) which increments each time you catch a fly:

Not sure I’ve done it the best way though because I added a HUD script and added it to a GUI Text object and the fly collection is done inside in the playerController, using some indiscriminate trigger based collision detection which I think is a pretty dirty way of doing it!

I’ve been working on Dad’s laptop seeing as I’m currently home for Christmas (from the 23rd to tomorrow, the 29th) when I’m heading back to Guildford. Dropbox has been really useful in helping me work from different locations, allowing me to easily sync my Unity project between multiple computers and make changes on any of them, which then will be automatically synced up when I carry on working elsewhere.

I’m thinking that my next task should be some menus to allow level select. I need to get the bedroom scene working that you can exit, at which point you’re presented with the level(/dream) select screen.

Festive Collection

While I wanted to do a bit of development on Christmas day, as working on Christmas day is pretty dedicated, I didn’t get round to it until today what with all the family stuff, Skyward Sword and Skyrim to compete with. On Christmas day my brother and his wife told my parents and I the fantastic news that they’re having a baby – so I’m going to be an Uncle! Can’t wait 🙂

My goal for today was to get collecting the flies working, which I’ve done with plenty of use of the Script Reference (http://unity3d.com/support/documentation/ScriptReference/Collider.OnTriggerEnter.html). When that wasn’t too hard I added collection particles (some placeholder example fireworks seeing as I’m not sure what I want here yet) and also some snow seeing it was also inside the example files and I was feeling a bit festive.

Next I’d like to get some HUD working – with a fly counter that shows how many you have left to get.

Converted the SmoothFollow2D.js example script file to C# with a little help from http://forum.unity3d.com/threads/71409-SmoothFollow2D.js-to-SmoothFollow2D.cs-is-giving-me-a-no-render-ship (I think the issue was that  you can’t directly access each part of a vector in C# like you can in JavaScript).  This revealed a bug that saw the camera slowly sinking through the ground, which bizarrely seemed to fix itself  :S I’m always dubious of miracle fixes as they also tend to unfix themselves later on.

I got a rope sort of working using the http://www.unifycommunity.com/wiki/index.php?title=LineRenderer_Ropehttp://answers.unity3d.com/questions/9705/tie-objects-together.html and http://www.unifycommunity.com/wiki/index.php?title=3D_Physics_Based_Rope, which linked me to the rope editor from www.reverieinteractive.com that I’m now playing about with.

 

Rope! Sort of.

I’d like to write my own but I’d rather make the game now and worry about doing it myself later. Perhaps not the wisest way of doing things though, however I wouldn’t be surprised if getting it to do what I need is as hard as doing my own version.

 

 

Worked late tonight but wanted  to do something towards my game so I drew a rubbish tree just now:

Rubbish Tree

I realised that if I can go for one day without doing anything, I can easily go for seven days, and if I can go for one week without doing anything then I can go forever, so I want to try and make sure I make some progress whenever possible, no matter how small.

Just watched this longingly: http://www.youtube.com/watch?v=XzRJosAiD98

Thing is, I can create graphics like this easily and import them in, but this video makes it looks so easy (and sexy?!)  to do it in Unity. Also, whenever I import them in they look like ass. So I need to figure a way to fix that.

Still haven’t got changing jump direction mid air sorted yet. This guy is having the same issue: http://forum.unity3d.com/threads/85796-Side-Scrolling-Platformer-Change-Direction-in-Air so I replied to see if he ever managed to solve it.

I need to start on the rope physics soon too. Then I can start making some puzzles/ levels. I watched this really interesting talk from Jonathan Blow and Marc Ten Boch yesterday: http://www.youtube.com/watch?feature=player_embedded&v=OGSeLSmOALU. It’s especially relevant for me seeing as I know what my mechanics are, but not my puzzles.

Now have double jumping working, which I did yesterday. I feel a bit hung over from Sarah P’s house warming to do any meaningful coding today, although I really want to add the ability to change your direction mid jump.

I’ve looked up some cartoon references for the spider and the fly characters and have drawn them in Flash:

Boris

Collectible/ Edible Fly

I will create some different versions and see if I can improve on them another time but they’ll do for now.

http://unity3d.com/support/documentation/ScriptReference was very useful this morning for checking all the things I probably should know but don’t.

I used: http://unity3d.com/support/documentation/ScriptReference/CharacterController.Move.html to redo my movement and get jumping working. I painstakingly deconstructed it and wrote it out myself to make sure I understood it and I’m now playing about with it to get double jumping working.

I’ve updated my player character so its now just a plane. Initially there was an issue with needing to rotate the plane so it was facing the camera, which messed up the movement controls. I solved this by adding the Plane as a child of the player object so that its rotation doesn’t affect the Player.

Jump around. Jump around! Get up! Get up! Get down! And so forth.

Thought this was going to be an unproductive lunch but I managed to find an easy way to lock the Z position and stop the cube from rotating about. You can also lock the rotation in each axis which solves the problem of the cube falling over:

Setting Constraints

I also found an amended version of the  example of the Unity 2DGameplayTutorialProject Lerpz project here: http://vonlehecreative.wordpress.com/2010/08/26/unity-resource-langmancontroller/

This strips out all the fluff and is just the useful movement bits. I’m going to try and learn from this to help me add jumping to my game, as if you just lift an entire script you never understand fully how it works, which will come back to bite you later on when you come to add more features or need to fix bugs with it.

Another useful thing from this example is that it showed me what type of shader I need to add to utilise the transparency on my character PNG:

Transparency Shader

It also uses a plane instead of a cube for the character, which probably makes sense for me so I’ll switch this out later.

Got collision working. Just need to improve the movement so it’s locked to the x and y planes and so you can jump. Currently your cube can easily topple over and then your steering will veer you off in crazy directions.

Ship it!

 

In unrelated news, I’ve been listening to lots of this: http://www.youtube.com/watch?v=ABYnqp-bxvg while I work. It’s a great feel good song and also has a brilliant video!

I have now finished reading the book and am back working on the game. I’ve also been jotting down lots of ideas every time they pop into my head – which is usually as I’m laying in bed. I have two potential names, a bunch of ideas for levels, a fist pass control scheme, a load of songs I want to use but probably won’t be able to get licences for and some other random ideas for various bits of gameplay.

I also read some of the older posts on here and can’t believe I started this in July! Time goes way too quickly. Especially as you get older.  Was quite interesting to read though. It’s amazing how much of what you’ve been up to that you forget without a record of it.