Sunday, 14 November 2010

Project Design and List taking

Well week 5 and we are ... making lists, lists everyone needs lists and it can be suprising what you can do with a good list. For the example exercise we were tasked to create a prim which would record the number of objects and avatars which have bumped into it. Shown below is the code for this prim making the lists:

list mylist = [];

default
{

state_entry()
{
// llSay(0, "Hello, Avatar!");

}

collision_start(integer total_number)
{

llOwnerSay(llDetectedName(0) +"::"+ (string)llVecMag(llDetectedVel(0)));
string name = llDetectedName(0);
float vel = llVecMag(llDetectedVel(0));
mylist = [name, vel] + mylist;

}

touch_start(integer total_number)
{
llOwnerSay((string) mylist);
}
}

Project Design - now a little bit serious, my project has a few ideas in fruition it will be either a flight sim or an off rails rollercoaster. Using the impulse and gravity commands to navigate them, should be lots of fun to create and play about with.

No comments:

Post a Comment