game programming with slick2 d
TRANSCRIPT
Game Programmingwith Slick2DGROW Game Team - for Freshman
Contents
Installation Hello, world! Draw the image Move the image with Keyboard Animation with Array Animation with Animation
Installation
GROW Game Team - for Freshman
Installation
Slick2D Homepage
Installation
Unzip 압축을 해제하여 적당한 위치에 폴더째로 옮긴다 다른 것은 다 지워도 dll(Windows) 나 so(UNIX/Linux), dylib(OS X) 와 lib 폴더 내용은 남겨두어야 한다
Installation
Eclipse project Java 프로젝트를 생성한다
Installation
Eclipse project Slick2D 라이브러리를 추가한다 추가한 라이브러리는 이후에도 재활용 가능
Hello, world!
GROW Game Team - for Freshman
Hello, world!
New Class file 새 소스 파일을 생성하고 수정한다
16 번 줄 : 우리가 구현한 코드를 사용하기 위해 준비 17 번 줄 : 해상도와 전체화면 유무 설정 18 번 줄 : 게임 시작
Hello, world!
실행한다
Draw the Image
GROW Game Team - for Freshman
Draw the Image
새 소스 폴더를 생성한다 이름은 아무 거나 상관 없지만 대중적으로 쓰이는 res 로 한다
Draw the Image
res 소스 폴더에 이미지를 추가한다 Slick2D 는 PNG, GIF, JPG, TGA 파일을 지원한다
Draw the Image
코드를 수정한다 5, 11, 18 번째 줄 참고
11 번째 줄 : 사용할 이미지를 불러온다 18 번째 줄 : 이미지를 화면에 출력한다
Draw the Image
실행한다
Move the image with Key-board
GROW Game Team - for Freshman
Move the image with Keyboard
코드를 수정한다 1, 7, 14, 15, 20~23, 28 번째 줄 참고 20~23 번째 줄 : 눌린 키에 따라 좌표 이동 28 번째 줄 : 지정된 좌표에 출력
Move the image with Keyboard
실행한다
Animation with Array
GROW Game Team - for Freshman
Animation with Array
애니메이션의 원리 여러 이미지를 빠른 속도로 교체하여 출력하는 것 동영상은 24 프레임 , 콘솔 및 휴대용 게임은 30 프레임 , PC 게임은 60 프레임이 기본 지역 단위 애니메이션과 전역 단위 애니메이션이 존재
지역 단위 애니메이션 : 캐릭터 등 단일 개체의 애니메이션 전역 단위 애니메이션 : 게임 / 동영상 화면
Animation with Array
애니메이션을 위한 이미지를 추가한다
Animation with Array
코드를 수정한다 6, 7, 14, 21 ~ 26, 35 번째 줄 참고
Animation with Array
실행한다
Animation with Animation
GROW Game Team - for Freshman
Animation with Animation
코드를 수정한다 6, 13~16, 21~23, 33 번째 줄 참고
Animation with Animation
실행한다