COMP1400 – Programming for Designers

Class announcements for Programming for Designers

COMP1400 – Programming for Designers random header image

Lab Week 1

Posted by on July 18th, 2010 · Lab

We will be starting labs in Week 1 for all classes except the Monday lab which will start in Week 2.

There are 3 tasks for this week’s lab:

  1. Activate your CSE account.
  2. Write your first program!
  3. Play with Unity

Activate your CSE account

The first thing we will do in this week’s lab is activate your CSE account:

  1. Go into the banjo lab
  2. Login as ‘newuser’
  3. Follow the prompts to activate your account.
  4. Write your new username and password somewhere so you don’t lose it.
  5. Log out.
  6. Log back in with your new CSE login and password (to activate your account).
  7. Log out again.
  8. Return to the Mac lab, but don’t log in yet as it will take a while for your account details to be processed.

Write your first program.

This is an exercise in breaking down a task into a sequence of simple instructions. Work in pairs. Your tutor will give each of you a small, incomplete pack of cards.

  1. Shuffle the deck.
  2. Go through the deck to find the smallest card.
  3. On a sheet of paper, write a set of instructions so that someone else can repeat the same procedure. Assume that they are very stupid and need to have ever last detail spelled out.
  4. Test your instructions on different size decks:
    • What if there is only 2 cards in the deck? Or only one? Or none?
    • What if all the cards in the deck were the same?
  5. Swap programs with another pair and check their code. Was it the same as yours?
  6. Now try writing instructions to sort the entire deck into order.
  7. Show your programs to your tutor for a lab mark.

Experiment with Unity

Experiment with making a scene in unity.

  1. Login with your CSE login and password set up earlier
  2. Open Unity, it should prompt you to create a new project
  3. Give the project a name and save it into the Scratch directiony.
  4. Experiment with creating objects and arranging them in the scene window.
  5. Try adjusting an object’s properties in the Inspector and see how to affects things.
  6. Join several objects together in the Hierarchy menu and see how this affects their movement
  7. Download the script: KeyMovement.js and import it into your project using Assets > Import New Asset
  8. Attach this script to an object in your scene. Run the game and use the arrow keys to make the object move.
  9. Remove the script from the object (with the ‘Remove Component’ command in the Inspector) and add it to the Camera instead. Run your game again.
  10. The script has some parameters ‘speed’ and ‘turnSpeed’ try changing these values and see what happens.
  11. What happens if the script is added to several objects at the same time?
  12. Open up the script in the editor and take a look at the code.
  13. Save your project.
  14. Open the /Scratch directory in Finder and copy your project over to your home directory to save it permanently.

The current version of Unity has some issues with the file system here at CSE which means that you can’t save projects directly into your home directory. This is very annoying. Until they fix this problem, you will have to copy the files to and from your home directory outside of Unity.

No Comments so far ↓

There are no comments yet...Kick things off by filling out the form below.

You must log in to post a comment.