import java.awt.*; public class top_char { int x; int y; int r; int g; int b; char c[] = new char[1]; Color color; /******コンストラクタ******/ top_char(char c){ init(); this.c[0] = c; } /********init()*******/ void init(){ x = 0; y = 0; r = g = b = 0; color = Color.white; } /*********setX()*******/ void setXY(double ra, Color color[][][]){ x = (int)(Math.cos(ra)*150) + 250; y = (int)(-Math.sin(ra)*30) + (int)(((double)-3/25)*x) + 300; r = (int)(Math.random()*6)+3; g = (int)(Math.random()*6)+3; b = (int)(Math.random()*6)+3; this.color = color[r][g][b]; } /********draw*********/ void draw(Graphics off_g){ off_g.setColor(color); off_g.drawChars(c,0,1,x,y); //off_g.drawString(s,x,y); } }