package game.invader;

import java.awt.*;
import javax.swing.*;

public class Invader extends JPanel {

    public static final int DEFAULT_STEP = 1;

    public static final Color DEFAULT_BACKGROUND = Color.MAGENTA;

    public static final int WIDTH = 10;
    public static final int HEIGHT = 10;

    int step = DEFAULT_STEP;

    int x = 0;

    int y = 0;

    String content;
	
    public int getStep() {
        return step;
    }

    public Invader setStep(int step) {
        this.step = step;
        return this;
    }

    public void setX(int x) {
        System.out.println(x);
        this.x = x;
    }

    public Invader moveDown() {
        y += step;
        repaint();
        return this;
    }

    public void paintComponent(Graphics graphics) {
        super.paintComponent(graphics);
        graphics.setColor(Color.MAGENTA);
        graphics.fillRect(x, y, WIDTH, HEIGHT);
    }
}

@@ -101,55 +101,8 @@
  %7B%0A%0A
-    public static final int DEFAULT_STEP = 1;%0A%0A
     
@@ -204,16 +204,17 @@
 H = 10;%0A
+%0A
     publ
@@ -243,24 +243,76 @@
 IGHT = 10;%0A%0A
+    public static final int DEFAULT_STEP = HEIGHT;%0A%0A
     int step
@@ -369,23 +369,113 @@
     
-String content;
+public Invader() %7B%0A        setLayout(null);%0A        setPreferredSize(new Dimension(WIDTH, HEIGHT));%0A    %7D
 %0A%09%0A 
@@ -679,11 +679,30 @@
 rint
-ln(
+f(%22New column: %25s%5Cn%22, 
 x);%0A
@@ -798,16 +798,73 @@
 aint();%0A
+        System.out.printf(%22Position  : %25d, %25d%5Cn%22, x, y);%0A
         

Improve the Invader a bit and add logging