Skip to content
Snippets Groups Projects
Commit a2b03f24 authored by dyddnrdl3@naver.com's avatar dyddnrdl3@naver.com
Browse files

hopefully last commit before submission

parent d416d0e6
No related branches found
No related tags found
No related merge requests found
...@@ -84,3 +84,7 @@ I'd like to talk about some feature, differences and other interesting topics ma ...@@ -84,3 +84,7 @@ I'd like to talk about some feature, differences and other interesting topics ma
<br/> <br/>
[<strong>Phaser Scene cycle</strong>](./lifecycle/README.md)<br/> [<strong>Phaser Scene cycle</strong>](./lifecycle/README.md)<br/>
[<strong>Phaser Physics: arcade & matter</strong>](./physics/README.md) [<strong>Phaser Physics: arcade & matter</strong>](./physics/README.md)
<br><br><br>
### Caution
This project is basically based on Phaser 3.24.1<br>
Docs were meant to treat about foundamental part of Phaser 3 which would not change. But if there are huge gap between latest version, please let us know.
\ No newline at end of file
...@@ -84,3 +84,7 @@ Phaser 게임 개발에 도움이 될 수 있는 여러 가지 특징, 차이 ...@@ -84,3 +84,7 @@ Phaser 게임 개발에 도움이 될 수 있는 여러 가지 특징, 차이
<br/> <br/>
[<strong>Phaser Scene cycle</strong>](./lifecycle/README_kr.md)<br/> [<strong>Phaser Scene cycle</strong>](./lifecycle/README_kr.md)<br/>
[<strong>Phaser Physics: arcade & matter</strong>](./physics/README_kr.md) [<strong>Phaser Physics: arcade & matter</strong>](./physics/README_kr.md)
<br><br><br>
### 주의사항
본 프로젝트는 Phaser 3.24.1를 기반으로 제작하였습니다.<br>
문서들은 변화의 여지가 없을만한 Phaser 3의 기본적인 부분을 다루고자 하였습니다. 하지만 최신 버전과 큰 차이가 있다고 느껴지실 경우, 알려주시면 감사하겠습니다.
\ No newline at end of file
# Phaser 3 Camera
...@@ -20,7 +20,7 @@ However, if you just started using phaser, you should know 3 basic Scene functio ...@@ -20,7 +20,7 @@ However, if you just started using phaser, you should know 3 basic Scene functio
Usually, you can load images or other resources at **preload** and create Phaser objects at **create** like sprite objects or others. And make your own game logic at **update**(If you are going to make event listner for logic, never write those codes in **update**). But you have to consider that **update** get executed periodically which is related with FPS. Usually, you can load images or other resources at **preload** and create Phaser objects at **create** like sprite objects or others. And make your own game logic at **update**(If you are going to make event listner for logic, never write those codes in **update**). But you have to consider that **update** get executed periodically which is related with FPS.
--- ---
## Why we load resources at **preload** and make objects at **create**? ## Why should we load resources at **preload** and make objects at **create**?
You may wonder why i suggest you to load resources at **preload** and create objects at **create**. Well, if you try you may see that some objects not being created well especially image related objects. This is because Phaser is based on JavaScript which makes loading resources asynchronously. Thus, to avoid such problem, i recommend you to load resources at preload and create phaser object after **preload** but it is not mandatory nor official. You may wonder why i suggest you to load resources at **preload** and create objects at **create**. Well, if you try you may see that some objects not being created well especially image related objects. This is because Phaser is based on JavaScript which makes loading resources asynchronously. Thus, to avoid such problem, i recommend you to load resources at preload and create phaser object after **preload** but it is not mandatory nor official.
--- ---
...@@ -39,7 +39,9 @@ You may want to limi your update rate because of performance issue or other reas ...@@ -39,7 +39,9 @@ You may want to limi your update rate because of performance issue or other reas
</code></pre> </code></pre>
Above code would let Phaser run **update** as half of default rate whcih means, if your Phaser game execute **update** 60 times a second, then above code block will make it 30 time a second. But you can't increase it. Above code would let Phaser run **update** as half of default rate whcih means, if your Phaser game execute **update** 60 times a second, then above code block will make it 30 time a second. But you can't increase it.
---
## Isn't there any **finish** in cycle?
Of course, there is state of Phaser Scene in **STOP** state which stands for when Phaser Scene is 'destroyed'(or you may say it as 'finished'). This state can be entered by triggering **destroy** event. However, as you see, there are **preload**, **create** and **update** but not others like **finish** or **destroy** from above. But you can add eventlistner to **destroy** event so you can unleash memories or do other stuffs.
<br><br> <br><br>
......
...@@ -39,7 +39,9 @@ Phaser의 Scene은 크게 다음의 세 가지 상태로 이루어져 있습니 ...@@ -39,7 +39,9 @@ Phaser의 Scene은 크게 다음의 세 가지 상태로 이루어져 있습니
</code></pre> </code></pre>
위의 코드는 **update**가 기존 실행 횟수의 절반으로 실행 횟수를 줄입니다. 예를 들어, 기존의 Phaser 게임에서 **update**를 초당 60회 실행 하였었다면, 위의 코드를 통해 초당 30회로 줄일 수 있습니다. 하지만 이를 증가시킬 수는 없습니다. 위의 코드는 **update**가 기존 실행 횟수의 절반으로 실행 횟수를 줄입니다. 예를 들어, 기존의 Phaser 게임에서 **update**를 초당 60회 실행 하였었다면, 위의 코드를 통해 초당 30회로 줄일 수 있습니다. 하지만 이를 증가시킬 수는 없습니다.
---
## 순환 주기에서 **종료**는 없나요?
물론, Phaser Scene의 '제거'(혹은 '종료'라고 간주하여도 무방합니다)에 해당하는 상태가 **STOP**의 범주 안에 속해있습니다. 이 상태는 **destroy** 이벤트를 통해서 진입할 수 있습니다. 그러나, 위에서는 보시다시피 **preload**, **created** 그리고 **update**만 있습니다. 하지만, 이벤트 리스너를 통해서 **destory** 이벤트 발생 시 실행될 코드를 작성할 수 있으며, 이때 메모리의 관리를 해주거나 다른 작업을 하실 수 있습니다.
<br><br> <br><br>
......
...@@ -15,7 +15,6 @@ From above, you may think 'why should we even consider about **matter** while it ...@@ -15,7 +15,6 @@ From above, you may think 'why should we even consider about **matter** while it
**arccade** and **matter** is basically for 2D games. If you check Phaser 3 API docs, you will see that game objects in both physics have function ```setVelocity(x [, y])```. And as you see, there is only x-axis and y-axis which means it really wasn't designed for 3D-game. You can use 3D camera plugin for Phaser 3 but there is high possibility that it doesn't work as you wanted. But, there is awesome extension [**enable3D**](https://github.com/enable3d/enable3d) for making 3D Phaser game **arccade** and **matter** is basically for 2D games. If you check Phaser 3 API docs, you will see that game objects in both physics have function ```setVelocity(x [, y])```. And as you see, there is only x-axis and y-axis which means it really wasn't designed for 3D-game. You can use 3D camera plugin for Phaser 3 but there is high possibility that it doesn't work as you wanted. But, there is awesome extension [**enable3D**](https://github.com/enable3d/enable3d) for making 3D Phaser game
<br><br> <br><br>
--- ---
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment