Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Games Domino  

Domino

Domino.lsl

Category: Games
By : Anonymous
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Domino
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Domino_1.lsl
1
2
3
4 //This domino script uses an llApplyImpulse fuction call to make it fall forward. If you decide that you want to resize the domino, you will need to adjust the amount of impulse applied.
5
6
7
8
9
10
11 vector base_pos;
12 rotation base_rot;
13 integer bump = 0;
14
15 move_back()
16 {
17 llSetPos(base_pos);
18 llSetRot(base_rot);
19 llSetPos(base_pos);
20 llSetRot(base_rot);
21 llSetPos(base_pos);
22 llSetRot(base_rot);
23 }
24
25 default
26 {
28 {
30 state waiting;
31 }
32 on_rez(integer sparam)
33 {
35 state waiting;
36 }
37
38 }
39
40 state waiting
41 {
43 {
45 {
46 llTriggerSound("fall", 1.0);
47 base_pos = llGetPos();
48 base_rot = llGetRot();
50 vector dir = llGetPos() - llDetectedPos(0);
51 dir = llVecNorm(dir);
52 llApplyImpulse(dir*1, FALSE);
53 llSleep(10.0);
54 state fix;
55 }
56 }
57 touch_start(integer sparam)
58 {
59 bump = 0;
60 }
61 touch(integer sparam)
62 {
63 bump++;
64 }
65 touch_end(integer sparam)
66 {
67 if(bump< 5)
68 {
69 llTriggerSound("fall", 1.0);
70 base_pos = llGetPos();
71 base_rot = llGetRot();
73 vector dir = llGetPos() - llDetectedPos(0);
74 dir = llVecNorm(dir);
75 llApplyImpulse(dir*1,FALSE);
76 llSleep(10.0);
77 state fix;
78 }
79 else
80 {
82 }
83 }
84 }
85
86 state fix
87 {
89 {
91 llSetStatus(STATUS_PHANTOM, TRUE);
92 llSleep(10.0); //how long before the domino resets itself
93 move_back();
94 llSleep(5.0);
95 llSetStatus(STATUS_PHANTOM, FALSE);
96 state default;
97 }
99 {
100 }
101 }// END //

Back to the Best Free Tools in Second Life and OpenSim.