アットウィキロゴ

JAVA ぎrl

import java.awt.*;
import java.awt.Graphics;
import java.awt.event.*;
import java.io.*;

class pro extends Frame implements Runnable{

Frame f;
Thread th;
int t,ch,stage,x,y;
int w,h,m,n;
int select;

int memor[][][]=new int[5][500][500];
int memog[][][]=new int[5][500][500];
int memob[][][]=new int[5][500][500];

public static void main(String[] args){
Frame f=new pro();
f.setTitle("movie");
f.setSize(600,600);
f.setBackground(Color.yellow);
f.show();
}

pro() {
addWindowListener(new stopwin());

w=500;
h=500;


try{
BufferedReader br =new BufferedReader(new FileReader("zubon.txt"));
String[] test = new String[w*h];
String str;
String x[]=new String[5];
for(int i=0; i<w*h; i++){
str = br.readLine();
x=str.split(",");
m=Integer.valueOf(x[0]);
n=Integer.valueOf(x[1]);
memor[1][m][n]=Integer.valueOf(x[2]);
memog[1][m][n]=Integer.valueOf(x[3]);
memob[1][m][n]=Integer.valueOf(x[4]);
}
br.close();
}
catch(IOException e){System.out.println("入出力エラーです。");}

try{
BufferedReader br2 =new BufferedReader(new FileReader("skirt.txt"));
String str2;
String x2[]=new String[5];
for(int i=0; i<w*h; i++){
str2 = br2.readLine();
x2=str2.split(",");
m=Integer.valueOf(x2[0]);
n=Integer.valueOf(x2[1]);
memor[2][m][n]=Integer.valueOf(x2[2]);
memog[2][m][n]=Integer.valueOf(x2[3]);
memob[2][m][n]=Integer.valueOf(x2[4]);
}
br2.close();
}
catch(IOException e){System.out.println("入出力エラーです。");}

try{
BufferedReader br3 =new BufferedReader(new FileReader("satuki.txt"));
String str3;
String x3[]=new String[5];
for(int i=0; i<w*h; i++){
str3 = br3.readLine();
x3=str3.split(",");
m=Integer.valueOf(x3[0]);
n=Integer.valueOf(x3[1]);
memor[3][m][n]=Integer.valueOf(x3[2]);
memog[3][m][n]=Integer.valueOf(x3[3]);
memob[3][m][n]=Integer.valueOf(x3[4]);
}
br3.close();
}
catch(IOException e){System.out.println("入出力エラーです。");}

try{
BufferedReader br4 =new BufferedReader(new FileReader("yukari.txt"));
String str4;
String x4[]=new String[5];
for(int i=0; i<w*h; i++){
str4 = br4.readLine();
x4=str4.split(",");
m=Integer.valueOf(x4[0]);
n=Integer.valueOf(x4[1]);
memor[4][m][n]=Integer.valueOf(x4[2]);
memog[4][m][n]=Integer.valueOf(x4[3]);
memob[4][m][n]=Integer.valueOf(x4[4]);
}
br4.close();
}
catch(IOException e){System.out.println("入出力エラーです。");}


stage=1;
ch=1;
th=new Thread(this);
th.start();
}

class stopwin extends WindowAdapter{
public void windowClosing(WindowEvent we){System.exit(0);}
}

public void paint( Graphics g ) {
int cc,j;
g.setColor(Color.blue);
g.fillRect(0,0,600,600);
g.setColor(Color.yellow);
g.fillRect(50,50,500,500);

g.setColor(Color.black);
g.drawRect(50,50,500,500);

g.setColor(Color.blue);
for (m=0;m<h;m++){
for (n=0;n<w;n++){
cc=0;
if(memor[ch][m][n]<200)cc=cc+1;
if(memog[ch][m][n]<200)cc=cc+1;
if(memob[ch][m][n]<200)cc=cc+1;
if(cc==3)g.fillRect(50+n,50+m,1,1);
}
}

g.setColor(Color.black);
if (stage==1)g.drawString("さつきさんに、サッカーの試合に誘われた。",300,100);
if (stage==2)g.drawString("正直、サッカーなんて興味がない。",300,100);
if (stage==3)g.drawString("僕が興味のあるのはさつきさんである。",300,100);
if (stage==4)g.drawString("太郎君でしょう",300,100);
if (stage==5)g.drawString("はい",300,100);
if (stage==6)g.drawString("やっぱりね。さつきのともだちのゆかりです。",300,100);
if (stage==7)g.drawString("どうして、わかったんですか。",300,100);
if (stage==8)g.drawString("あなたみたいなかわいい男の子いないわよ",300,100);
if (stage==9)g.drawString("負けちゃいましたね",300,100);
if (stage==10)g.drawString("そうね。さつきがくるわ",300,100);

if (stage==11)g.drawString("残念でしたね",300,100);
if (stage==12)g.drawString("どこが残念なのよ。もう来ないで",300,100);
if (stage==13)g.drawString("太郎君",300,100);
if (stage==14)g.drawString("ゆかりさん",300,100);
if (stage==15)g.drawString("昨日はさつきさんどうしたんでしょうね。",300,100);
if (stage==16)g.drawString("負けたときは仕方がないわ",300,100);
if (stage==17)g.drawString("どうして負けたのかな",300,100);
if (stage==18)g.drawString("オスでなくなったからよ",300,100);
if (stage==19)g.drawString("どういうことですか",300,100);
if (stage==20)g.drawString("男でも、女でも、選手はオスである必要があるの",300,100);

if (stage==21)g.drawString("試合に勝てば、かわいいメスが手に入る。だから、オスはがんばれるの",300,100);
if (stage==22)g.drawString("そんなものですかね。",300,100);
if (stage==23)g.drawString("そういうものよ",300,100);
if (stage==24)g.drawString("恋人って、ゆかりさんですか",300,100);
if (stage==25)g.drawString("そうだったわ",300,100);
if (stage==26)g.drawString("どうしたら、さつきさんはオスに戻れるんですか",300,100);
if (stage==27)g.drawString("昔の恋人よりも、かわいい恋人が出来たらね。",300,100);
if (stage==28)g.drawString("ゆかりさんよりもかわいい人なんていませんよ",300,100);
if (stage==29)g.drawString("一人いるわ",300,100);
if (stage==30)g.drawString("さつきさん",300,100);

if (stage==31)g.drawString("その服どうしたの",300,100);
if (stage==32)g.drawString("変ですか",300,100);
if (stage==33)g.drawString("変じゃない",300,100);
if (stage==34)g.drawString("かわいいですか",300,100);
if (stage==35)g.drawString("かわいい",300,100);
if (stage==36)g.drawString("今日は、試合に勝つためのおまじないに来ました",300,100);
if (stage==37)g.drawString("おまじない",300,100);
if (stage==38)g.drawString("そう、おまじないです。",300,100);
if (stage==39)g.drawString("何するの",300,100);
if (stage==40)g.drawString("僕のファーストキスです",300,100);


if (stage==41)g.drawString("さつき、絶好調ね",300,100);
if (stage==42)g.drawString("おまじないが効いたみたいですね",300,100);
if (stage==43)g.drawString("おまじないね",300,100);
if (stage==44)g.drawString("これから、お姉さまと呼んでいいですか",300,100);
if (stage==45)g.drawString("いいわよ。争いはオスに任せて、メス同士なかよくしましょう",300,100);
if (stage==46)g.drawString("はい",300,100);

}

public void update(Graphics g) {
paint(g);
}

public void run() {

repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }
stage=2;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

stage=3;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=4;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=5;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=6;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=7;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=8;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=9;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=10;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=11;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=3;
stage=12;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=13;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=14;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=15;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=16;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=17;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=18;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=19;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=20;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=21;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }


ch=1;
stage=22;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=23;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=24;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=25;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=26;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=27;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=1;
stage=28;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=29;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=30;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }


ch=3;
stage=31;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=32;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=3;
stage=33;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=34;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=3;
stage=35;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=36;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=3;
stage=37;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=38;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=3;
stage=39;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=40;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=41;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=42;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=43;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=44;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=4;
stage=45;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }

ch=2;
stage=46;
repaint();
try{th.sleep(3000);} catch(InterruptedException e) { }






}
}
最終更新:2010年10月21日 02:48