Monday, February 9, 2015

Day 4: Make framework

Software is a big industry. One of its demands is rapid development and extensible capacity. Duplicated or “copy & paste” code seems good in software development, but in fact, it is the cause of many problems for:
- maintain due to order to find & fix every buggy repeated code
- understand because the code is larger
- etc.


As an architect and developer of your fantastic team, you need to figure out a framework of your game. (mark of 3)




Code:
//Moveable

public interface Moveable
{
    void jump();
    void forward();

}

Sunday, February 8, 2015

Day 3: Identify Behaviors

Today, game is an important industrial of software, one of most important features that a game must have is the extensible capacity. As an architect, you know the meaning of “implement into interface not into implementation”, so you must:


Create an interface for actor that can do :
- forward()
- jump()
- blink()

Code:


public class Game implements Movement
{
    private Square player;
    
    public Game()
    {
        player = new Square();
        player.makeVisible();
    }

Friday, February 6, 2015

Day 2: Animation of picture


Code:

public class Sun
{
    private Circle mySun;
 
    public Sun(){
        mySun = new Circle();
        mySun.makeVisible();
        mySun.changeColor("yellow");
        mySun.moveUp();
        mySun.moveHorizontal(190);
    }

Wednesday, February 4, 2015

Day 2: Create Class


Sun: 

public class Sun
{
    private Circle mySun;
 
    // Constructor
    public Sun(){
        mySun = new Circle();
        mySun.makeVisible();
        mySun.changeColor("yellow");
        mySun.moveUp();
        mySun.moveHorizontal(190);
    }
}

Day 1: Draw a picture ( Using BlueJ )


Code: 
Square wall = new Square();
wall.makeVisible();
wall.changeSize(150);
wall.moveDown();

Square otherWall = new Square();
otherWall.makeVisible();
otherWall.changeColor("black");
otherWall.moveDown();
otherWall.moveDown();
otherWall.moveRight();
otherWall.changeSize(30);
otherWall.changeSize(50);