> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-ko/sdk7/programming-patterns/game-objects.md).

# 게임 오브젝트

게임 오브젝트 패턴을 사용해 코드를 더 읽기 쉽고 확장하기 쉽게 만드세요.

장면이 더 복잡해질수록, 일부 로직을 별도의 게임 오브젝트 파일로 분리해 두는 것이 유용합니다. 이렇게 하면 장면의 मुख्य 코드를 깔끔하고 읽기 쉽게 유지하면서, 장면의 여러 엔티티를 제어하는 재사용 가능한 부분은 캡슐화할 수 있습니다.

게임 오브젝트는 장면에서 볼 수 있는 엔티티 유형, 예를 들어 문이나 버튼, 몬스터 같은 것의 모든 속성과 메서드를 담고 있습니다. 이 추상화 덕분에 장면의 मुख्य 로직이 담긴 파일에서는 단 한 줄의 코드로 완전한 게임 오브젝트를 인스턴스화할 수 있습니다. 또한 동일한 방식으로 이러한 객체의 메서드를 호출할 수도 있습니다.

게임 오브젝트 정의는 각각 별도의 파일에 두는 것을 권장합니다.

## 타입 오브젝트 패턴

장면에서 공통점이 많은 여러 종류의 게임 오브젝트를 사용한다면, 이 리팩터링을 한 걸음 더 나아가 *base* 이들이 공통으로 가진 모든 것을 담는 게임 오브젝트 타입을 정의할 수 있습니다. 그런 다음 이 기본 클래스를 상속하는 하위 클래스를 만들 수 있습니다.

이 패턴에 대해 더 자세히 읽으려면 [Game Programming Patterns](http://www.gameprogrammingpatterns.com/type-object.html).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decentraland.org/creator/content-creator-ko/sdk7/programming-patterns/game-objects.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
