안드로이드) 캐릭터의 좌표 이동

북마크 추가

    public void fighterMove() {

 

        Thread th = new Thread(new Runnable() {

            @Override

            public void run() {

 

                switch (getBtnCnt()) {

                    case 1:

 

                    case 2:

                        moveLeft += 60;

                        moveRight += 60;

                        break;

                    case 3:

                        moveLeft -= 60;

                        moveRight -= 60;

                        break;

                    case 4:

                        moveTop -= 60;

                        moveBottom -= 60;

                        break;

                    case 5:

                        moveTop += 60;

                        moveBottom += 60;

                        break;

                }

                try {

                    Thread.sleep(300);

                } catch (Exception e) {

                    e.printStackTrace();

                }

            }

 

        });

        th.start();

    }

    public void fighterMover() {

 

        stop = false;

 

        Thread th = new Thread(new Runnable() {

            @Override

            public void run() {

 

                while(!stop) {

                    if (atkCnt != 4) {

 

                        bmpID = image;

                        num = 8;

                        offy = 0;

 

                        offx += bmpID.getWidth() / 8;

 

                        if (offx >= bmpID.getWidth()) {

                            offx = 0;

                        }

 

                        try {

                            Thread.sleep(300);

                        } catch (Exception e) {

                            e.printStackTrace();

                        }

                    }

                }

            }

        });

        th.start();

    }

 

    @Override

    public void run() {

 

    }

}

 

AD
개*****
2014-10-08 00:25
SHARE
댓글

처음에 좌표 이동이 안되던건 왜 안되는거여?
관리자