วันอาทิตย์ที่ 22 กันยายน พ.ศ. 2556

Continue





void setup() {
  for(int i = 0; i < 100; i += 5) {
    if (i == 50) {
      continue;
    }
   line(i, 0, i, 100);
  }
}

Chess




int r = 38;
void setup(){
  size(400, 400);
  int x, y, i, j;
int[][] Chess= {
 {
 2, 3, 4, 6, 5, 4, 3, 2
 }
 , {
 1, 1, 1, 1, 1, 1, 1, 1
 }
 , {
 0, 0, 0, 0, 0, 0, 0, 0
 }
 , {
 0, 0, 0, 0, 0, 0, 0, 0
 }
 , {
 0, 0, 0, 0, 0, 0, 0, 0
 }
 , {
 0, 0, 0, 0, 0, 0, 0, 0
 }
 , {
 1, 1, 1, 1, 1, 1, 1, 1
 }
 , {
 2, 3, 4, 6, 5, 4, 3, 2
 }
 };
  strokeWeight(4);
   for (y=0,i=0 ; i<Chess.length ; i++,y+=50){
    for (x=0,j=0 ; j<Chess.length ; j++,x+=50){
      if ((j+i)%2 == 0){
       fill(66, 217, 146);
     }
     else fill(192);
     rect(x, y, 200, 200);
   }
}
  for (y=25,i=0 ; i<Chess.length ; i++,y+=50){
    for (x=25,j=0 ; j<Chess.length ; j++,x+=50){
      if (y<200){
        fill(0);
      }
      else{
        fill(255);
     }
  if (Chess[i][j]==1){
   Prawn(x, y);
  }
  else if (Chess[i][j]==2){
    Rook(x, y);
  }
  else if (Chess[i][j]==3){
    Knight(x, y);
  }
  else if (Chess[i][j]==4){
    Bishop(x, y);
  }
else if (Chess[i][j]==5){
    Queen(x, y);
 }
else if (Chess[i][j]==6){
  King(x, y);
}
}
}
}

void Rook(int x, int y){
  ellipse(x, y, r, r);
  fill(255,0,0);
  text("Rook", x-14, y+4);
}

void Knight(int x, int y){
  ellipse(x, y, r, r);
  fill(255,0,0);
  text("Knight", x-17, y+4);
}

void Bishop(int x, int y){
  ellipse(x, y, r, r);
  fill(255,0,0);
  text("Bishop", x-18, y+4);
}

void Queen(int x, int y) {
  ellipse(x, y, r, r);
  fill(255,0,0);
  text("Queen", x-18, y+4);
}

void King(int x, int y) {
  ellipse(x, y, r, r);
  fill(255,0,0);
  text("King", x-12, y+4);
}

void Prawn(int x, int y){
  ellipse(x, y, r, r);
}

base&derived class






void setup() {
  Animal a = new Animal();
  Animal b = new Dog();
  a.move();
  b.move();
}

class Animal {
  void move() {
  println("Animal move >w<");
  }
}

class Dog extends Animal {
  void move() {
  println("Dog move -w-");
  }
}

gcd & lcd




void setup(){
  int x = 4;
  int y = 6;
  println(gcd(x,y));
  println(lcd(8, 2));}

int gcd(int x,int y){
  if (x == 0){
    return y;
  }
  if (y == 0){
    return x;
  }
  if (x > y){
    return gcd(y,x % y);
  }
  else{
    return gcd(x,y % x);
  }
}

int lcd(int x, int y) {
return (x*y)/gcd(x, y);
}

Button







void setup() {
  size(200, 200);
  background(255);
  println(a.toString());
  println(b.toString());
  a.Clicked();
  a.Display();
}

Button a = new Button("moowan", 100, 100, 50);
Button b = new Button();

void draw() {
  a.Display();
  b.Display();
}

class Button {
  int k = 0;
  int x;
  int y;
  int s;
  String name;

  Button(String n, int a, int b, int c) {
    this.name = n;
    this.x = a;
    this.y = b;
   this.s = c;
  }

  Button() {
    this.name = "Kananard";
    this.x = 50;
    this.y = 50;
    this.s = 20;
  }

  String toString() {
    String s = this.name;
    return s;
  }

  void Clicked() {
    if ((mousePressed && mouseX >=x && mousePressed && mouseX <=x + s) && (mousePressed && mouseY >= y && mousePressed && mouseY <= y + s)) {
      if (k % 8 == 0) {
        println(this.name);
      }
      k = k + 1;
    }
  }
  void Display() {
    rect(x, y, s, s);
    a.Clicked();
    b.Clicked();
   }
}

Palindrome








void setup(){
  String s = "CIVIC";
  if (isPalindrome(s)) {
    println(s + " is a palindrome");
  }
  else {
    println(s + " is not a palindrome");
  }
}

String reverseString(String s){
  String show = "";
  for (int index=0;index<s.length();index++){
    show += s.charAt(s.length() - index - 1);
  }
   return show;
}

boolean isPalindrome(String s){
  return s.equals(reverseString(s));
}

ReverseString




void setup(){
  println(reverseString("Computer"));
}

String reverseString(String s){
  String show = "";
  for(int index=0;index<s.length();index++){
    show += s.charAt(s.length() - index - 1);
  }
  return show;
}


Tic-Tac-Toe(OX)








void setup()
{
  size(600, 600);
  background(255);
  strokeWeight(8);
  stroke(0);
  int i, j ,xPos ,yPos;
  int xLine, yLine;
  int[][] Pieces=new int[3][3];
  for (xLine=200,yLine=200 ; xLine<=400 && yLine<=400 ; xLine+=200,yLine+=200)
  {
    line(xLine, 0, xLine, height);
    line(0, yLine, width, yLine);
  }
  for (i=0,xPos=100;i<Pieces.length;i++,xPos+=200)
  {
    for (j=0,yPos=100;j<Pieces.length;j++,yPos+=200)
    {
      Pieces[i][j]=int(random(0,2));
      if (Pieces[i][j]%2==0)
        {DrawO(xPos, yPos);}
      else DrawX(xPos, yPos);
  }
  }
}

void DrawO(int x, int y)
{
  int r=180;
  strokeWeight(1);
  stroke(0);
  fill(0);
  ellipse(x, y, r, r);
  fill(255);
  ellipse(x, y, r-15, r-15);
}

void DrawX(int x, int y)
{
  strokeWeight(8);
  line(x-90, y-90, x+90, y+90);
  line(x-90, y+90, x+90, y-90);
}

Othello






void setup()
{
  size(400, 400);
  int i;
  int j;
  int[][] Othello = new int[8][8] ;
  int x;
  int y;

  background(44, 132, 0);
  for (x=50 , y=50 ; x < width && y < height ; x += 50,y += 50)
  {
    line(x, 0, x, height);
    line(0, y, width, y);
  }
  noStroke();
  smooth();
  for (i = 0, x = 25 ; Othello.length > i ; i++,x += 50)
  {
    for (j=0, y=25 ; Othello[0].length > j ; j++,y+=50)
    {
      Othello[i][j]= int(random(0, 200));
      if (Othello[i][j]%2 == 0)
      {
        fill(255);
      }
      else
      {
        fill(0);
      }
      ellipse(x, y, 40, 40);
    }
  }
}

วันเสาร์ที่ 21 กันยายน พ.ศ. 2556

Binary Calculate & Display(Plus)








boolean[] A = { false, false, true, false};  // กำหนดตัวแปรชนิด boolean ประเภท array ชื่อ A
boolean[] B = {true, true, false, false};  // กำหนดตัวแปรชนิด boolean ประเภท array ชื่อ B 
boolean[] j =new boolean[4];  // กำหนดตัวแปรชนิด boolean ประเภท array ชื่อ j ใช้ในการทดเลขจากการคำนวณ
boolean[] cal =new boolean[4];  // กำหนดตัวแปรชนิด boolean ประเภท array ชื่อ cal เก็บค่าที่คำนวณได้
int[] plus = new int[5];  // กำหนดตัวแปรชนิด boolean ประเภท array ชื่อ plus ใช้เก็บค่าที่จะใช้แสดง
int i = 0;  // กำหนดตัวแปรชนิด int ชื่อ i เพื่อเรียกใช้ค่าใน array ตำแหน่ง i นั้นๆ
int x = 45;  // กำหนดตัวแปรชนิด int ชื่อ x เพื่อกำหนดจุดที่วาดวงกลมวงแรก
void setup(){
 size(200,200);  // กำหนดขนาดของ screen
  background(195);  // กำหนดสีของ screen เป็นสีเทา
  i = A.length - 1;  // ให้ ค่า i เท่ากับความยาวของ A -1 
  while (i > 0)  // กำหนดเงื่อนไขการวนลูป ถ้า i > 0
  {
    if (A[i] == true && B[i] == true){  // กำหนดเงื่อนไข ถ้า A ที่ตำแหน่ง i มีค่าเป็น true และ B ตำแหน่ง i มีค่าเป็น true
      j[0] = true;  // ให้ j ที่ตำแหน่ง 0 เป็น true
      cal[i] = false;  // ให้ cal ที่ตำแหน่ง i เป็น false 
      if (j[1] == true) {  // กำหนดเงื่อนไข ถ้า j ที่ตำแหน่ง 1 เป็น true
        cal[i] = true;  // ให้ cal ที่ตำแหน่ง i เป็น true 
      }
      else {  // ถ้า j ที่ตำแหน่ง 1 ไม่เป็น true
         cal[i]=false;  // ให้ cal ที่ตำแหน่ง i เป็น false 
      }
      j[1] = j[0];  // ให้ค่า j ที่ตำแหน่ง 1 เท่ากับค่า j ที่ตำแหน่ง 0
    }
    else if (A[i] == false && B[i] == false){  // กำหนดเงื่อนไข ถ้า A ที่ตำแหน่ง i มีค่าเป็น false และ B ตำแหน่ง i มีค่าเป็น false                                   
      j[0] = false;  // ให้ j ที่ตำแหน่ง 0 เป็น false
      cal[i] = false;  // ให้ cal ที่ตำแหน่ง i เป็น false   
      if (j[1] == true){  // กำหนดเงื่อนไข ถ้า j ที่ตำแหน่ง 1 เป็น true
        cal[i] = true;  // ให้ cal ที่ตำแหน่ง i เป็น true 
      }
      else{  // ถ้า j ที่ตำแหน่ง 1 ไม่เป็น true
        cal[i] = false;  // ให้ cal ที่ตำแหน่ง i เป็น false 
      }
      j[1] = j[0];  // ให้ค่า j ที่ตำแหน่ง 1 เท่ากับค่า j ที่ตำแหน่ง 0
    }
    else{ // ถ้านอกเหนือจากเงื่อนไขข้างต้น
      j[0] = false;  // ให้ j ที่ตำแหน่ง 0 เป็น false
      cal[i] = true;  // ให้ cal ที่ตำแหน่ง i เป็น true 
      if (j[1] == true){ // ถ้า j ที่ตำแหน่ง 1 เป็น true
        cal[i] = false;  // ให้ cal ที่ตำแหน่ง i เป็น false
        j[0] = true;  // ให้ j ที่ตำแหน่ง 0 เป็น true
      }
      else{ // ถ้านอกเหนือจากเงื่อนไขข้างต้น
        cal[i] = true; // ให้ cal ที่ตำแหน่ง i เป็น true
      }
      j[1] = j[0]; // ให้ j ที่ตำแหน่ง 1 เท่ากับค่า j ที่ตำแหน่ง 0 
    }
    i = i - 1;  // ให้ i เพิ่มขึ้นเรื่อยๆทีละ 1 
  }
   i = 0;  // ให้ i เท่ากับ 0
   if(A[0] == true && B[0] == true){  // กำหนดเงื่อนไข ถ้า A ที่ตำแหน่ง 0 เป็น true และ B ที่ตำแหน่ง 0 เป็น true                                  
     fill(104, 34 ,139);  // กำหนดสีเป็นสีม่วง
     ellipse(x,120,30,30);  // วาดวงกลม
   }
   while (i < A.length) {  // กำหนดเงื่อนไขการวนลูป ถ้า i > A.length
     if (cal[i] == true){ // กำหนดเงื่อนไข ถ้า cal ท่ตำแหน่ง i เป็น true
       plus[i] = 1;  // ให้ plus ที่ตำแหน่ง i เป็น 1
       fill(0,128,128); // กำหนดสีเป็นสีฟ้า
       ellipse(x,120,30,30); // วาดวงกลม
       x = x + 30; // ให้ค่า x เพิ่มขึ้นเรื่อยๆที่ละ 30
     }
     if (cal[i] == false){ // กำหนดเงื่อนไข ถ้า cal ท่ตำแหน่ง i เป็น false
       plus[i] = 0;  // ให้ plus ที่ตำแหน่ง i เป็น 0
       fill(255); // กำหนดสีให้เป็นสีขาว
       ellipse(x,120,30,30); // วาดวงกลม
       x = x + 30; // ให้ค่า x เพิ่มขึ้นเรื่อยๆที่ละ 30
     }
     i = i + 1; // ให้ค่า i เพิ่มขึ้นเรื่อยๆทีละ 1
   }
  if(A[0] == true && B[0] == true){ // กำหนดเงื่อนไข ถ้า A ที่ตำแหน่ง 0 เป็น true และ B ที่ตำแหน่ง 0 เป็น true                                        
    fill(0); // กำหนดสีเป็นสีดำ
    textFont(createFont("Cordia New",26));  // กำหนดฟรอนต์เป็น Cordia New ขนาด 26
    text("Plus is" + " " + "1" + plus[0] + plus[1] + plus[2] + plus[3],45,70); // แสดงค่า
  }
  else{  // ถ้านอกเหนือจากเงื่อนไขข้างต้น
    fill(0);  // กำหนดสีเป็นสีดำ
    textFont(createFont("Cordia New",26));  // กำหนดฟรอนต์เป็น Cordia New ขนาด 26
    text("Plus is" + " " + plus[0] + plus[1] + plus[2] + plus[3],45,70);  // แสดงค่า
  }
}

วันศุกร์ที่ 20 กันยายน พ.ศ. 2556

Solar System





int[ ] moon = {0, 0, 1, 2, 63, 62, 27, 15};
float[ ] distance = {0.4+.5, 0.7+.5, 1.0+.5, 1.4+.5, 3.0+.5, 4.7+.5, 6.3+.5,7.5+.5};
float[ ] Radius = {7.2, 18.0, 20.0, 10.6, 70.0, 50.0, 40.0, 35.0};
String[ ] names= {"Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune"};
int n = 0;

void setup() {
  size(800, 500);
  background(0);
  smooth();
}
void draw() {
  fill(255,153,0);
  drawCircle(-550,height/2,1200);
  while (n < moon.length) {
     Star(90 * distance[n], height/2, Radius[n]);
     text(names[n],90 * distance[n] - 15 ,height/2 + 60 + (n * 10));
     n = n + 1;
  }
}

void Star(float x, int y, float r) {
  fill (random(255),random(255),random(255));
  drawCircle(x, y, r) ;
  int b = 1;
  while (b <= moon[n]) {
    float a = 360/moon[n];
    a = a * b;
    fill(random(255),random(255),random(255));
    drawCircle((r*cos(a))+x, ((r*sin(a))+y-(r*sin(90)))+r, 5);
    noFill();
    b = b + 1;
  }
}

void drawCircle(float x, float y, float r) {
  ellipse(x, y, r, r);
}

วันจันทร์ที่ 16 กันยายน พ.ศ. 2556

VERMIN THE GAME (BETA VERSION) [nintendo game and watch]





Press 'd' or 'j' to move left or right 
for Hit a something in your game
THAT's AUTOMATIC

FONTS = NOT WORKING IN BROWSERS
IF YOU CAN RUN IN SOFTWARE [PROCESSING 2.0]

PLEASE.....RUN IT ^^ FOR Beautiful animation 

Designed : 

     Name of function

           - keypressed ไม่มี Parameter ไม่มี return value ใช้สำหรับ รับค่าของ User (interface)
           - DrawBackground ไม่มี Parameter ไม่มี return value ใช้สำหรับ วาดภาพพื้นหลังของเกม
           - DrawCharacter ไม่มี Parameter ไม่มี return value ใช้สำหรับ วาดตัวละครในตัวเกม
           - update1 ไม่มี Parameter ไม่มี return value ใช้สำหรับสุ่มค่าจุดเริ่มต้นตำแหน่งและช่องของ ลูกบอล 1
           - update2 ไม่มี Parameter ไม่มี return value ใช้สำหรับสุ่มค่าจุดเริ่มต้นตำแหน่งและช่องของ ลูกบอล 2
           - DrawMonster ไม่มี Parameter ไม่มี return value ใช้สำหรับวาดจุดเริ่มต้นตำแหน่งและช่องของ ลูกบอล 1 และ 2
           - DrawHit ไม่มี Parameter ไม่มี return value  ใช้สำหรับวาดค้อนที่ใช้ทุบ (ตำแหน่งที่ทุบ) เมื่อมีการกดปุ่ม j หรือ k 
           - CountPoint ไม่มี Parameter มี return value คือ ค่า Point (คะแนนที่ได้) ใช้สำหรับนับค่าคะแนนเมื่อค้อนกระทบกับลูกบอล ในระยะที่ถูกต้อง
           - TextShow ไม่มี Parameter ไม่มี return value ใช้สำหรับแสดงผลค่าคะแนน แล้วก็ชื่อเกม รวมไปถึง หน้าต่าง GAME OVER เมื่อเกมจบ 

     Responsible Man

           - Kananard Sathienthai  5601012630019  = DrawBackground(), TextShow(),update1(),update2()
           - Chinnawat Chimdee    5601012630060  = All Function (Main Developer)
           - Tanath Poonnachit      5601012630124  = DrawCharacter(),CountPoint(),ClearGame()

CODE in Game : 

boolean cis = true;
int Width=600;
int Height=400;
int count=0;
int xMove=0;
int i=0;
int Speed=20; //////////// CAN CHANGE
int frame=0;
int[] index = {
  0, 0
};
int[] Slot = {
  0, 110, 220
};
int[] indexMons = new int[2];
int[] PosMons = { //X axis
  80, 190, 300, 410, 520
};
int[] xPosMons = {
  0, 0
};
int[][] yPosMons= {
  {
    300, 280, 250, 210, 180, 150
  }
  ,
  {
    320, 290, 260, 230, 180, 150
  }
};
boolean[] Hit= {
  false, false
};
boolean[] CheckHIT= {
  false, false
};

void setup()
{
  frameRate(10);
  size(Width, Height);
  update1();
  update2();
}
void draw()
{
  DrawBackground();
  DrawCharacter();
  DrawMonster();
  TextShow();
  frame++;
}

void keyPressed() //kEYPRESSED USER BUTTON FOR PLAY
{
  if (key=='j' || key=='J')
  {
    if (xMove<220)
    {
      i++;
    }
  }
  if (key=='f' || key=='F')
  {
    if (xMove>0)
    {
      i--;
    }
  }
  xMove=Slot[i];

  if (key=='r' || key=='R')
  {
    ClearGame();
  }
}

void ClearGame()
{
  i=0;
  frame=0;
  index[0]=0;
  index[1]=0;
  cis = true;
  xMove=0;
  Speed=20;
  yPosMons[0][0]=300;
  yPosMons[1][0]=320;
  count=0;
  update1();
  update2();
  DrawBackground();
  DrawCharacter();
  DrawMonster();
  TextShow();
}

void update1() //update ball 1
{
  indexMons[0]=int(random(0, 5));  //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  xPosMons[0]=PosMons[indexMons[0]];
}
void update2() //update ball 2
{
  indexMons[1]=int(random(0, 5)); //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  xPosMons[1]=PosMons[indexMons[1]];
}

void DrawBackground() //BG - Moowhan
{
  background(100, 100, 255);
  int HeightHalf=Height/2;
  int xStart_Line=0;
  int xEnd_Line=50;
  strokeWeight(0.25);
  line(0, 175, width, 175);
  strokeWeight(4);
  fill(0);
  for (xStart_Line=0 ; xStart_Line<Width ; xStart_Line+=110) {
    xEnd_Line=xStart_Line+50;
    line(xStart_Line, HeightHalf, xEnd_Line, HeightHalf);
  }
}

void DrawCharacter() //Interface Character - Sinn
{
  ellipse(188+xMove, 70, 50, 50);  //Head
  ellipse(188+xMove, 130, 30, 60); //Body
  strokeWeight(4);
  line(160+xMove, 175, 175+xMove, 160);  //LeftLeg
  line(200+xMove, 160, 215+xMove, 175);  //RightLeg
  fill(255);
  strokeWeight(1);
  ellipse(180+xMove, 70, 10, 10); //LeftEye
  ellipse(200+xMove, 70, 10, 10); //RightEye
  ellipse(190+xMove, 85, 30, 5);  //Mouth
  DrawHit();
}

int CountPoint() //CountPoint sinn+wat
{
  for (int j=0;j<2;j++)
  {
    if (index[j]<=5) {
      switch (indexMons[j]) {
      case 0 :
        if (xMove==Slot[0] && yPosMons[j][index[j]] == 180 && CheckHIT[j]==false)
        {
          count++;
          CheckHIT[j]=true;
        }
        break;

      case 1 :
        if (xMove==Slot[1] && yPosMons[j][index[j]] == 180 && CheckHIT[j]==false)
        {
          count++;
          CheckHIT[j]=true;
        }
        break;

      case 2 :
        if ((xMove==Slot[0] || xMove==Slot[2]) && yPosMons[j][index[j]] == 180 && CheckHIT[j]==false)
        {
          count++;
          CheckHIT[j]=true;
        }
        break;

      case 3 :
        if (xMove==Slot[1] && yPosMons[j][index[j]] == 180 && CheckHIT[j]==false)
        {
          count++;
          CheckHIT[j]=true;
        }
        break;

      case 4 :
        if (xMove==Slot[2] && yPosMons[j][index[j]] == 180 && CheckHIT[j]==false)
        {
          count++;
          CheckHIT[j]=true;
        }
        break;
      }
    }
  }
  AutoHit();
  return count;
}

void AutoHit()
{
  for (int q=0;q<2;q++) {
    if (yPosMons[q][index[q]] == 180) {
      if (xMove==Slot[0])
      {
        if (indexMons[q]==0)
        {
          Hit[0]=true;
        }
        if (indexMons[q]==2)
        {
          Hit[1]=true;
        }
      }
      if (xMove==Slot[1])
      {
        if (indexMons[q]==1)
        {
          Hit[0]=true;
        }
        if (indexMons[q]==3)
        {
          Hit[1]=true;
        }
      }
      if (xMove==Slot[2])
      {
        if (indexMons[q]==2)
        {
          Hit[0]=true;
        }
        if (indexMons[q]==4)
        {
          Hit[1]=true;
        }
      }
    }
  }
}

void DrawHit() //draw hammer that hit - wat
{
  fill(0);
  if (Hit[0]==false)
  {
    quad(80+xMove, 20, 50+xMove, 50, 80+xMove, 80, 110+xMove, 50);
    strokeWeight(3);
    line(95+xMove, 67, 125+xMove, 100); //LeftHammerHandle
    strokeWeight(8);
    line(125+xMove, 100, 140+xMove, 117);//LeftHand
    strokeWeight(4);
    line(143+xMove, 120, 160+xMove, 125);//LeftArm
  }//LeftNoHit
  if (Hit[1]==false)
  {
    quad(295+xMove, 20, 265+xMove, 50, 295+xMove, 80, 325+xMove, 50);
    strokeWeight(3);
    line(250+xMove, 100, 280+xMove, 67);//RightHammerHandle
    strokeWeight(8);
    line(235+xMove, 117, 250+xMove, 100);//RightHand
    strokeWeight(4);
    line(213+xMove, 125, 233+xMove, 120);//RightArm
  }//RightNoHit
  if (Hit[0]==true) //ball check and slot check => draw********************************
  {
    quad(60+xMove, 130, 105+xMove, 130, 105+xMove, 175, 60+xMove, 175);//LeftHammer
    strokeWeight(3);
    line(100+xMove, 155, 125+xMove, 150);//LeftHammerHandle
    strokeWeight(8);
    line(125+xMove, 150, 140+xMove, 143);//LeftHand
    strokeWeight(4);
    line(143+xMove, 140, 160+xMove, 130);//LeftArm
    Hit[0]=false;
  }//LeftHit
  if (Hit[1]==true)
  {
    quad(280+xMove, 130, 325+xMove, 130, 325+xMove, 175, 280+xMove, 175);//RightHammer
    strokeWeight(3);
    line(250+xMove, 150, 280+xMove, 155);//RightHammerHandle
    strokeWeight(8);
    line(235+xMove, 142, 250+xMove, 150);//RightHand
    strokeWeight(4);
    line(213+xMove, 130, 233+xMove, 140);//RightArm
    Hit[1]=false;
  }//RightHit
}

void TextShow() //OUTPUT POINT METHOD Moowhan
{
  fill(0);
  //del /* xxxxxxx */ if you run in Processing program
  /*
  textSize(40);
   text("VERMIN", 300, 350);
   text(CountPoint(), 500, 350);

   if (yPosMons[0]<=150 || yPosMons[1] <=150)
   {
   background(0);
   fill(255);
   text("GAME OVER", 185, height/2-50);
   text("Press R to Restart", 130, height/2);
   text("Score : "+CountPoint(), 220, height/2+50);
   }
   */

  text("VERMIN", 300, 350);
  text(CountPoint(), 500, 350);

  if (index[0]>5 || index[1]>5)
  {
    background(0);
    fill(255);
    text("GAME OVER", 250, height/2-50);
    text("Press R to Restart", 230, height/2);
    text("Score : "+CountPoint(), 255, height/2+50);
  }
}
void DrawMonster() //draw monster - wat
{
  int r=20;
  int j;
  fill(0);
  for (j=0;j<2;j++)
  {
    if (CheckHIT[j] == false)
    {
      if (j==0 && frame%Speed==0)
      {
        index[0]++;
      }
      if (j==1 && frame%Speed-2==0)
      {
        index[1]++;
      }
      if (j==0 && index[0]<=5)
      {
        ellipse(xPosMons[j], yPosMons[j][index[0]], r, r);
      }
      if (j==1 && index[1]<=5)
      {
        ellipse(xPosMons[j], yPosMons[j][index[1]], r, r);
      }

      if (CountPoint() % 10 == 0 && CountPoint() != 0 && cis == true && Speed >=16) {
        Speed -= 2;
        cis=false;
      }
      else if (CountPoint()%10 >= 1 && CountPoint() != 1)
      {
        cis=true;
      }
    }
    if (CheckHIT[j] == true)
    {
      if (j==0)
      {
        update1();
        index[0]=0;
      }
      if (j==1)
      {
        update2();
        index[1]=0;
      }  
      CheckHIT[j]=false;
    }
  }
}