/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Examen.bolita;

import java.awt.Graphics;
import javax.swing.ImageIcon;

/**
 *
 * @author felix
 */
public class bolita {
    private int x, y;
    private ImageIcon Img;
    private String path = 
    "/Users/felix/fie_mac/public_html/programacion_java/codigos/POO/src/Examen/bolita/";
    
    public bolita() {
        x = 100;
        y = 100;
        Img = new ImageIcon(path+"bola.png");
    }
    
    public int getX() {
        return x;
    }
    
    public int getY() {
        return y;
    }
    
    public void dibuja(Graphics g) {
        g.drawImage(Img.getImage(), x-25, y-25, 50, 50, null);
    }   
    
    public void mueve(int dx, int dy) {
        x = dx;
        y = dy;
        //x = x+dx  >   0 ? x+dx : 400;
        //x = x+dx  < 400 ? x+dx : 0;
        //y = y+dy  >   0 ? y+dy : 400;
        //y = y+dy  < 400 ? y+dy : 0;
    }     
}
    
