본문 바로가기

GAME10

The Descent import java.util.*;import java.io.*;import java.math.*; /** * Auto-generated code below aims at helping you parse * the standard input according to the problem statement. **/class Player { public static void main(String args[]) { Scanner in = new Scanner(System.in); // game loop while (true) { String str = "HOLD"; int check = 0; int check_i = -1; int SX = in.nextInt(); int SY = in.nextInt(); for.. 2015. 2. 9.
OnBoarding import java.util.*;import java.io.*;import java.math.*; /** * The code below will read all the game information for you. * On each game turn, information will be available on the standard input, you will be sent: * -> the total number of visible enemies * -> for each enemy, its name and distance from you * The system will wait for you to write an enemy name on the standard output. * Once you hav.. 2015. 2. 9.
안드로이드 캔버스 기준좌표. 캔버스 내에 기준 좌표값. 이미지 0 ,0 ; 텍스트 0 , 택스트의 높이값; paint.setTextSize('값'); 값 = 텍스트 사이즈를 정해주면 값과 근사치의 높이가 나옴. 자바 절대값 Math.abs('값'); 값= 안에 들어있는 값은 절대값으로 나옴.(-값을 +값으로 변경함.) 예) String str = "가나다" ; Rect rect = new Rect(); Paint paint = new Paint(); void onDraw(Canvas canvas){ paint.getTextBounds(str,0,str.length(),rect); int tempY = (int)Math.abs(rect.top - rect.bottom); tempY = 높이값. } 지정 좌표에 이미지를 중심점으로 두고.. 2014. 12. 1.
스케일 터치이벤트 // 기본 800x1280 해상도 대응.float SCALE_X = screen_width / 800f;float SCALE_Y = screen_height / 1280f;// 기본 800x1280 터치 대응.float EVENT_X = 800f / screen_width;float EVENT_Y = 1280f / screen_height; //켄버스canvas.scale(SCALE_X, SCALE_Y); //터치이벤트event_X = event.getX() * EVENT_X;event_Y = event.getY() * EVENT_Y; 2014. 11. 24.