Package main.ch.morrolan.gibb.snake

Examples of main.ch.morrolan.gibb.snake.BodyPart.move()


    public void move() {
        BodyPart part = new BodyPart(0, 0);
        Point position = new Point(0, 0);

        part.direction = Direction.DOWN;
        part.move(1);
        position.y += 1;
        assertEquals(position, part.position);

        part.direction = Direction.RIGHT;
        part.move(5);
View Full Code Here


        part.move(1);
        position.y += 1;
        assertEquals(position, part.position);

        part.direction = Direction.RIGHT;
        part.move(5);
        position.x += 5;
        assertEquals(position, part.position);

        part.direction = Direction.UP;
        part.move(3);
View Full Code Here

        part.move(5);
        position.x += 5;
        assertEquals(position, part.position);

        part.direction = Direction.UP;
        part.move(3);
        position.y -= 3;
        assertEquals(position, part.position);

        part.direction = Direction.LEFT;
        part.move(2);
View Full Code Here

        part.move(3);
        position.y -= 3;
        assertEquals(position, part.position);

        part.direction = Direction.LEFT;
        part.move(2);
        position.x -= 2;
        assertEquals(position, part.position);
    }

    @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.