<--애드센스-->

Class AppGameContainer

A game container that will display the game as an stand alone application.//영어설명은 위키에서 가져옴

생성자

AppGameContainer(Game game) throws SlickException: 게임 하나를 담는 인스턴스라고 생각하면 되려나 파라미터 Game은 인터페이스 Game의 인스턴스이다. 인터페이스 Game을 implements하는 클래스는 엄청 많은데 그중 BasicGame클래스에서 생성자로 Game을 생성하는 것 같다.

[참조변수] = new AppGameContainer(new Game("[게임 이름]")); 이런 식으로 생성한다. (여기서 new Game(String name)은 BasicGame클래스를 상속받은 Game클래스의 생성자를 임의로 만들어서 이렇게 되었다.)


AppGameContainer(Game game, int width, int height, boolean fullscreen) throws SlickException: 첫번째 생성자는 디스플레이 크기를 따로 설정해줘야 하지만 이 생성자는 한꺼번에 설정한다.


void setDisplayMode(int width, int height, boolean fullscreen): 첫번째 생성자를 이용해서 만들것이라면 이 메서드를 이용해야한다.


void start():게임을 구동한다.


void destroy():게임을 중단한다.

+ Recent posts