COMP1400 – Programming for Designers

Class announcements for Programming for Designers

COMP1400 – Programming for Designers random header image

Assignment 2 demo

Posted by on August 23rd, 2010 · Assignments

An example app for ass2 can be found at:
http://www.cse.unsw.edu.au/~cs1400/ass/ass2/Missile.html

Assignment 2: Missile Command

Posted by on August 22nd, 2010 · Assignments

You’re task for assignment 2 is to create a game similar to the old Atari game Missile Command. You don’t have to completely reproduce that game, but you should the following elements:

  1. Multiple ‘enemy’ objects falling from the sky
  2. A launcher base at the bottom of the screen.
  3. When the user clicks on an enemy, a missile is launched from the base to hit the enemy.
  4. When the missile hits the enemy, it explodes.

[Read more →]

Lab 5

Posted by on August 17th, 2010 · Lab

Your task in this lab is to practise using for loops and prefabs.

We’re going to make a simple game in which the player has to click on a bunch of moving targets to destroy them.

  1. Create a target object of your choice. Give it a script to make it move around randomly.
  2. Create a prefab and drag the object into the prefab.
  3. Use the prefab to create multiple copies of the object.
  4. Use the Inspect to change the properties of the prefab and observe how the instances are affected.
  5. Create an empty “joint” object.
  6. Add a script to the joint to create many instances of the prefab when the game is started. Use a variable to specify the number.

Unity has a built-in facility for detecting when the user clicks on an object. To make it work, your object must have a Collider component attached to it. Most of the built-in primitive objects (boxes, spheres, etc) have colliders by default. If you are using a model you downloaded, you will have to add your own collider.

  1. Make sure your prefab includes a collider. If you don’t have one, add one from the Component menu.

When the user clicks on an object with a collider, a MouseDown event occurs. You can catch this event by adding an OnMouseDown() method to your script.

  1. Add an OnMouseDown() event handler to the script on the target prefab.
  2. Make the object destroy itself when it is clicked.

When all the targets are destroyed, we want to start a new level with twice as many. To keep track of the number of live targets we can add them all as children of the joint object and use Transform.childCount to see how many are left.

  1. Add an Update method to the joint object which checks how many children are left.
  2. If there are no children left, create twice as many as before.

Challenge: Rather than making objects disappear immediately when clicked, make them perform some kind of ‘dying’ behaviour (change colour, spin around, explode or something).

Assignment 1 – Submission

Posted by on August 15th, 2010 · Assignments

Submitting the storyboard: Since the storyboards are going to be checked during lab session at week 4 (week 5 for Monday tut), the final PAPER version of the storyboard has to be handed to the tutor at the start of next lab session.

Submitting the complete Unity project implementing your scene:

1) Script files:

Your assignment will be stored in a number of files. The script files (.js files) can be submitted via two ways: using the “give” web page or using “give” command.

[Read more →]

Lab 4

Posted by on August 11th, 2010 · Uncategorized

Tasks for lab 4:

  1. Check out the Ass1 demo if you haven’t had a chance to yet.
  2. Show your Ass1 storyboards to your tutor for feedback.
  3. Returning to last week’s lab, make the ‘treasure’ objects move around randomly.
  4. Work on your assignment.

Ass 1 Demo

Posted by on August 10th, 2010 · Assignments

I’ve created a simple demo of the kind of thing I expect for assignment 1. You can play it online here.

You can control the plane with the arrow keys. Notice the “physics” are very simple. You don’t need to try to simulate realistic flight.

For the two other moving things requirement, I added a blimp which circles the centre building and a collection of cars which flee from the plane if it comes too close. Of course, you don’t have to follow my example here. You can add any other objects you want, as long as you have two distinct movements.

Course Forums open

Posted by on August 5th, 2010 · Assignments

I’ve opened the Course Forums for this subject. Reza, Sam and I will be monitoring the Assignments forum and answering any questions. If you are having any problems, please post them there so that everyone can have access to the answers.

Update: You need to register before you can use the forums. It doesn’t just automatically use your CSE login.

Lab 3

Posted by on August 3rd, 2010 · Lab

In this lab you are going to make a very simple game. The player moves around in a 2D world gathering ‘treasures’. When each treasure is touched, it disappears.
[Read more →]

Ass 1 – flight simulator

Posted by on August 3rd, 2010 · Assignments

Your task for assignment 1 will be to design and program a simple flight simulator in Unity. It must contain the following:

  1. A plane under the control of the player, as per the controls below.
  2. At least two other moving objects in the scene. How they move is up to you.
  3. A static landscape to fly over.

[Read more →]

Lab Week 2

Posted by on July 27th, 2010 · Lab

Note: If you missed last week’s lab you will need to activate your CSE account. Look at the instructions from last week. Ask your tutor about this before you proceed.

Your task in this lab will be to create some objects and make them move. You’ll also learn how to import more interesting models than simple cubes and spheres.
[Read more →]