Puntaje.java

   1 /**
   2  *@author Andres Felipe Quevedo vega. andresfe118@hotmail.com
   3  */
   4 import java.awt.*;
   5 
   6 public class Puntaje extends ObjetoGrafico{
   7         private static final long serialVersionUID = -4496455711050108645L;
   8         private int cantidad;
   9         private String nombreJugador;
  10         public Puntaje(int posx,int posy,int an,int al, String nombre){
  11                 super(posx,posy,an,al);
  12                 nombreJugador = nombre;                                 
  13         }
  14         public void paint(Graphics g){
  15                 if(getVisible()){
  16                         g.setFont( new Font( "Ravie", Font.BOLD, 18 ) );
  17                         g.drawString(nombreJugador +" : "+cantidad, getX(), getY());
  18                 }
  19         }
  20         public void add(int n) {
  21                 cantidad += n;
  22         }
  23         public long getCantidad() {
  24                 return cantidad;
  25         }
  26         public void setCantidad(int cantidad) {
  27                 this.cantidad = cantidad;
  28         }
  29         public String getNombreJugador() {
  30                 return nombreJugador;
  31         }
  32         public void setNombreJugador(String nombreJugador) {
  33                 this.nombreJugador = nombreJugador;
  34         }
  35 
  36 }

CategoryJava | CategoryProgramacion


CategoryProgramacion

Java/CrazyBalls/Puntaje.java (last edited 2009-05-20 14:03:16 by AndresFe118)