2008年06月18日
ブロック積み上げゲーム
作品番号No.003【ブロック積み上げゲーム】
☆ルール☆
交互にブロックを積み上げていって、縦か横かななめに4つそろたら勝ち。

[main]
string appearobject;
float i=0;
key playera;
string aname;
integer handle;
integer handlea;
integer flag=1;
default{
state_entry(){
llSay(0,"Game Start");}
on_rez(integer r){
llListenRemove(handle);
llListenRemove(handlea);
llResetScript();}
touch_start(integer total_number){
handle=llListen(0,"","","reset");
handlea=llListen(70,"","","");
if(flag ==1){
playera = llDetectedKey(0);
aname = llKey2Name(playera);
llSay(70,aname);
flag=2;}
if(llDetectedName(0)==aname){
appearobject = "blue cube Die";
llSay(95,aname);}
if(llDetectedName(0)!=aname){
appearobject = "red cube Die";
llSay(95,llDetectedName(0));}
i = i+0.501 ;
llRezObject(appearobject,llGetPos()+<0,0,i>,ZERO_VECTOR,ZERO_ROTATION,0);
llPlaySound("buddyon",1); }
listen(integer channel,string name , key id , string message){
if(message == "reset"){
llResetScript();}
if(channel==70){
aname=message;
flag=2;}
}
}
[judge]
integer handle;
string playera;
string playerb;
integer re;
integer count=1;
default
{
state_entry(){
handle= llListen(95,"","","");
re =llListen(0,"","","reset");}
on_rez(integer r){
llResetScript();
llListenRemove(handle);
llListenRemove(re);}
listen(integer channel , string name , key id, string message){
if(count==1){
playera= message;
count=2;
}
if(message!=playera && channel==95){
playerb = message;}
if(message==playera && channel==95){
llSetText(playerb,<1,1,1>,1);}
else{
llSetText(playera,<1,1,1>,1);}
if (message=="reset"){
llSetText("",<1,1,1>,1);
count=1;
playera="";
playerb="";}
}
}
☆ルール☆
交互にブロックを積み上げていって、縦か横かななめに4つそろたら勝ち。

[main]
string appearobject;
float i=0;
key playera;
string aname;
integer handle;
integer handlea;
integer flag=1;
default{
state_entry(){
llSay(0,"Game Start");}
on_rez(integer r){
llListenRemove(handle);
llListenRemove(handlea);
llResetScript();}
touch_start(integer total_number){
handle=llListen(0,"","","reset");
handlea=llListen(70,"","","");
if(flag ==1){
playera = llDetectedKey(0);
aname = llKey2Name(playera);
llSay(70,aname);
flag=2;}
if(llDetectedName(0)==aname){
appearobject = "blue cube Die";
llSay(95,aname);}
if(llDetectedName(0)!=aname){
appearobject = "red cube Die";
llSay(95,llDetectedName(0));}
i = i+0.501 ;
llRezObject(appearobject,llGetPos()+<0,0,i>,ZERO_VECTOR,ZERO_ROTATION,0);
llPlaySound("buddyon",1); }
listen(integer channel,string name , key id , string message){
if(message == "reset"){
llResetScript();}
if(channel==70){
aname=message;
flag=2;}
}
}
[judge]
integer handle;
string playera;
string playerb;
integer re;
integer count=1;
default
{
state_entry(){
handle= llListen(95,"","","");
re =llListen(0,"","","reset");}
on_rez(integer r){
llResetScript();
llListenRemove(handle);
llListenRemove(re);}
listen(integer channel , string name , key id, string message){
if(count==1){
playera= message;
count=2;
}
if(message!=playera && channel==95){
playerb = message;}
if(message==playera && channel==95){
llSetText(playerb,<1,1,1>,1);}
else{
llSetText(playera,<1,1,1>,1);}
if (message=="reset"){
llSetText("",<1,1,1>,1);
count=1;
playera="";
playerb="";}
}
}
Posted by Treva Slade at 23:45│Comments(0)
│ゲーム