간단한 2 차원 게임을 만들고 기본 아키텍처를 설계하는 좋은 방법을 제안 할 수 있는지 궁금합니다.기본 게임 Archecture Question
게임은 매우 간단합니다. 화면에는 촬영, 이동 및 히트 감지를 수행하는 많은 유형의 장치가 있습니다. 화면이 확대/축소되고 화면 측면에 메뉴 UI 막대가 있습니다.
는지금이 아키텍처는 다음과 같습니다
Load a "stage".
Load a UI.
Have the stage and UI pass references to each other.
Load a camera, feed it the "stage" as a parameter. Display on screen what the camera is told to "see"
Main Loop {
if (gameIsActive){
stage.update()
ui.update()
camera.updateAndRedraw()
}
}else{
if (!ui.pauseGame()){
gameIsActive=true
}
if(ui.pauseGame()){
gameIsActive=false
}
stage update(){
Go through a list of objects on stage, perform collision detection and "action" checks.
objects on stage are all subclasses of an object that has a reference to the stage, and use that reference to request objects be added to the stage (ie. bullets from guns).
}
ui update(){
updates bars, etc.
}
을 어쨌든,이 모든 아주 기본적인 것입니다. 이 일을하는 더 좋은 방법이 있는지 궁금해.
덕분에, 마태 복음