You are on page 1of 1

using System;

using System.Drawing;
using System.Windows.Forms;
using System.IO;
using System.Threading;

class Piedra {
int x, y;
int radio;

public Piedra( int el_x, int el_y, int el_radio) {


this.x= el_x;
this.y= el_y;
this.radio= el_radio;
}

public void Pintar(Graphics oAreaParaPintar) {


oAreaParaPintar.FillEllipse( new SolidBrush(Color.Black),
this.x,
this.y,
2*this.radio,
2*this.radio);
}

public void Borrar(Graphics oAreaParaPintar) {


oAreaParaPintar.FillEllipse( new SolidBrush(Color.White),
this.x,
this.y,
2*this.radio,
2*this.radio);
}

public void Mover( int delta_x, int delta_y) {


x += delta_x;
y += delta_y;
}
}

public class VentanaPiedras:Form {


private Piedra p1;

public VentanaPiedras() {
this.p1= new Piedra( 0, 0, 5);
this.Paint += new PaintEventHandler(Pintar);
}

private void Pintar(object sender, PaintEventArgs e) {


this.p1.Pintar(e.Graphics);
}

public static void Main() {


Application.Run(new VentanaPiedras());
}
}

You might also like