ソラマメブログ
訪問ありがとう☆
QRコード
QRCODE

  
Posted by at

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="";}
}
}


  

Posted by Treva Slade at 23:45Comments(0)ゲーム

2008年06月13日

数字当てゲーム(一人用)

作品No.002【数字当てゲーム】
☆遊び方☆
1.自動で3つの数字が決まります(見えない)(例175)
2.その数字を予想して3つの数字をしゃべります(例159)
3.1は場所と数字があっているのでone strikeとなります。
4.5は数字はあっていますが場所が違うのでone ballとなります。
5.これを繰り返し数字と場所を当てます。

integer first ;
integer second ;
integer third ;
integer sfirst;
integer ssecond;
integer sthird;
integer i=1;
key toucherid;
integer handle;


reset(){
toucherid=NULL_KEY;
llListenRemove(handle);}

decision(){
first = llFloor(llFrand(9.0))+1;
second =llFloor(llFrand(9.0))+1;
third =llFloor(llFrand(9.0))+1;}

default{
state_entry(){
llSetTouchText("number baseball Game");
reset();
}

on_rez(integer r){
llResetScript();
}

touch_start(integer x){
toucherid=llDetectedKey(0);
do{
decision();}
while(first==second ||first==third || second ==third);
//llSetText((string)first+(string)second+(string)third,<1,0,0>,1);
llSay(0,"Chat three numbers");
handle=llListen(0,"",toucherid,"");}

listen(integer channel,string name,key id,string message){
sfirst =(integer)llGetSubString(message,0,0);
ssecond =(integer)llGetSubString(message,1,1);
sthird =(integer)llGetSubString(message,2,2);

integer h=0;
integer b=0;

if(first==sfirst){
h=h+1;}
if(first==ssecond){
b=b+1;}
if(first==sthird){
b=b+1;}
if(second==sfirst){
b=b+1;}
if(second==ssecond){
h=h+1;}
if(second==sthird){
b=b+1;}
if(third==sfirst){
b=b+1;}
if(third==ssecond){
b=b+1;}
if(third==sthird){
h=h+1;}
if(h==3){
llSay(0,"homerun");
llSay(0,"you say"+(string)i+"times");
llResetScript();}
if(h==2){
llSay(0,"two strikes");}
if(h==1){
llSay(0,"one strike");}
if(b==3){
llSay(0,"three balls");}
if(b==2){
llSay(0,"two balls");}
if(b==1){
llSay(0,"one ball");}
i=i+1;

state opponentturn;}}

state opponentturn{
state_entry(){
state yourturn;}}

state yourturn{
state_entry(){
llSay(0,"Chat three numbers");
handle=llListen(0,"",toucherid,"");}

listen(integer channel,string name,key id,string message){
sfirst =(integer)llGetSubString(message,0,0);
ssecond=(integer)llGetSubString(message,1,1);
sthird =(integer)llGetSubString(message,2,2);

integer h=0;
integer b=0;

if(first==sfirst){
h=h+1;}
if(first==ssecond){
b=b+1;}
if(first==sthird){
b=b+1;}
if(second==sfirst){
b=b+1;}
if(second==ssecond){
h=h+1;}
if(second==sthird){
b=b+1;}
if(third==sfirst){
b=b+1;}
if(third==ssecond){
b=b+1;}
if(third==sthird){
h=h+1;}
if(h==3){
llSay(0,"Homerun");
llSay(0,"you say"+" "+(string)i+" "+"times");
llSay(0,"Game over");
llResetScript();}
if(h==2){
llSay(0,"two strikes");}
if(h==1){
llSay(0,"one strike");}
if(b==3){
llSay(0,"three balls");}
if(b==2){
llSay(0,"two balls");}
if(b==1){
llSay(0,"one ball");}
i=i+1;
state opponentturn;}}  

Posted by Treva Slade at 18:35Comments(2)ゲーム

2008年06月13日

足跡帳

訪問ありがとうございます☆。
お立ち寄りの際はご気軽にコメント残して下さいね!  

Posted by Treva Slade at 10:28Comments(0)足跡帳

2008年06月12日

じゃんけんゲーム

作品No.001【じゃんけん】
タッチするとダイアログが出て、stone, scissors, paperを選んでじゃんけんができるゲームを作りました。

key toucherid =NULL_KEY;
list jaction=["stone","scissors","paper"];
integer dialogchannel=198;
integer handle;
integer gcp;

resetjanken(){
toucherid=NULL_KEY;
llListenRemove(handle);}

default{

on_rez(integer y){
llResetScript();}

state_entry(){
llSetTouchText("janken");
resetjanken();
}

touch_start(integer x){
toucherid = llDetectedKey(0);
llSay(0,"choice your action");
handle =llListen(dialogchannel,"","","");
gcp = llFloor(llFrand(3.0));
llDialog(toucherid,"choice your action",jaction,dialogchannel);}

listen(integer channel,string name, key id,string message){
if(gcp==1){
llSay(0,"stone");
if(message=="stone"){
llSay(0,"draw");
gcp = llFloor(llFrand(3.0));
llDialog(toucherid,"choice your action",jaction,dialogchannel);}
else if(message=="paper"){
llSay(0,"you win");}
else if(message=="scissors"){
llSay(0,"you lose");}
}
else if(gcp==2){
llSay(0,"scizzors");
if(message=="stone"){
llSay(0,"you win");}
else if(message=="paper"){
llSay(0,"you lose");}
else if(message=="scissors"){
llSay(0,"draw");
gcp = llFloor(llFrand(3.0));
llDialog(toucherid,"choice your action",jaction,dialogchannel);}
}
else if(gcp==0){
llSay(0,"paper");
if(message=="stone"){
llSay(0,"you lose");
}
else if(message=="paper"){
llSay(0,"draw");
gcp = llFloor(llFrand(3.0));
llDialog(toucherid,"choice your action",jaction,dialogchannel);}
else if(message=="scissors"){
llSay(0,"you win");}

}
}
}


  

Posted by Treva Slade at 23:08Comments(0)ゲーム