pull/2/head
jaysunxiao 2021-10-03 09:02:45 +08:00
parent d298c1ac62
commit bdebe1e3ca
69 changed files with 923 additions and 33 deletions

View File

@ -29,6 +29,7 @@ ue虽然开源源代码但是代码量太大历史包袱太重不适合
```
使用godot你既可以用GDScript去编写代码也可以用C++去编写代码,还可以去改底层引擎代码
游戏行业到最后都是C++如果想把游戏当作自己的事业那绝对不要满足在脚本上游戏最后的优化都是基于硬件显卡之上的只能用C++
```
- 用godot你能感觉我能把控底层我能把控每一行代码的底层细节这个是程序员的浪漫godot在国外比较火是有原因的
@ -41,4 +42,5 @@ ue虽然开源源代码但是代码量太大历史包袱太重不适合
- unity在很久之前也同时支持过js和C#最后放弃了js主要是因为unity是mono和C#非常友好
- godot使用C++去解释执行gds这个时候对于godot来说比较重推荐gds
- 通过学习gds也可以学到一些编译原理的知识
- godot不仅仅是一个游戏引擎而且还是一个优质的学习资源
- godot不仅仅是一个游戏引擎而且还是一个优质的学习资源
- https://www.zhihu.com/question/393440831

View File

@ -1,17 +1,24 @@
- 参考资料
- [godot官方文档](https://docs.godotengine.org/en/stable/getting_started/scripting/gdscript/gdscript_basics.html)
- [Godot Tutorials的youtube播放量最高的godot教程视频](https://www.youtube.com/watch?v=JJQa3xrRNM0&list=PLJ690cxlZTgL4i3sjTPRQTyrJ5TTkYJ2_)
- [Godot Tutorials的GDScript Fundamentals Tutorial Seriesyoutube播放量最高的godot教程视频](https://www.youtube.com/watch?v=JJQa3xrRNM0&list=PLJ690cxlZTgL4i3sjTPRQTyrJ5TTkYJ2_)
- [Godot Tutorials的Godot Basics Tutorial Seriesyoutube播放量最高的godot教程视频](https://www.youtube.com/watch?v=sChM51ibm5k&list=PLJ690cxlZTgIsmdEhFufnB7O6KWoMS8M6)
- [B站视频](https://www.bilibili.com/video/BV17g4y1z7uS)
# 数据类型
- gds有5种基础类型
- BooleanInteger(Java long)Float(Java double)StringNull
![Image text](integer.JPG)
![Image text](integer_overflow.JPG)
![Image text](gc.JPG)
![Image text](step.JPG)
![Image text](image/integer.JPG)
![Image text](image/integer_overflow.JPG)
![Image text](image/step.JPG)
# 垃圾回收
![Image text](image/gc.JPG)
![Image text](image/gc1.png)
![Image text](image/gc2.png)
![Image text](image/gc3.png)

View File

Before

Width:  |  Height:  |  Size: 176 KiB

After

Width:  |  Height:  |  Size: 176 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/gc.JPG-39fa032320410100941ba40578241fc0.stex"
path="res://.import/gc.JPG-7827fecfd1aba43aa0b40579830536b9.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo02_base/gc.JPG"
dest_files=[ "res://.import/gc.JPG-39fa032320410100941ba40578241fc0.stex" ]
source_file="res://doc/demo02_base/image/gc.JPG"
dest_files=[ "res://.import/gc.JPG-7827fecfd1aba43aa0b40579830536b9.stex" ]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/godot_node.jpg-16331f3f19dfee3528c1c8a0616ee82e.stex"
path="res://.import/gc1.png-a39c555498c9b64c0ee3b8f21f2e4fb8.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/godot_node.jpg"
dest_files=[ "res://.import/godot_node.jpg-16331f3f19dfee3528c1c8a0616ee82e.stex" ]
source_file="res://doc/demo02_base/image/gc1.png"
dest_files=[ "res://.import/gc1.png-a39c555498c9b64c0ee3b8f21f2e4fb8.stex" ]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/gc2.png-36e735a03a6ba26ca1d4686067190377.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo02_base/image/gc2.png"
dest_files=[ "res://.import/gc2.png-36e735a03a6ba26ca1d4686067190377.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/gc3.png-46d3674dae65e7eced317eef68f37b06.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo02_base/image/gc3.png"
dest_files=[ "res://.import/gc3.png-46d3674dae65e7eced317eef68f37b06.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/integer.JPG-43a607bfd4c2c4f83e738b20fb6c9816.stex"
path="res://.import/integer.JPG-d38f4d47a40d6571b935c32988bff48a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo02_base/integer.JPG"
dest_files=[ "res://.import/integer.JPG-43a607bfd4c2c4f83e738b20fb6c9816.stex" ]
source_file="res://doc/demo02_base/image/integer.JPG"
dest_files=[ "res://.import/integer.JPG-d38f4d47a40d6571b935c32988bff48a.stex" ]
[params]

View File

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 92 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/integer_overflow.JPG-88e55ff6d1e3a0fbf64a06739e111a58.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo02_base/image/integer_overflow.JPG"
dest_files=[ "res://.import/integer_overflow.JPG-88e55ff6d1e3a0fbf64a06739e111a58.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/step.JPG-ea371ce51ca536d0350e70aed54f8432.stex"
path="res://.import/step.JPG-3330779acd60e454bafa0c046c73413a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo02_base/step.JPG"
dest_files=[ "res://.import/step.JPG-ea371ce51ca536d0350e70aed54f8432.stex" ]
source_file="res://doc/demo02_base/image/step.JPG"
dest_files=[ "res://.import/step.JPG-3330779acd60e454bafa0c046c73413a.stex" ]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/delta-1.png-4590396c04276c6e10c1c3ad368b08e3.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/delta-1.png"
dest_files=[ "res://.import/delta-1.png-4590396c04276c6e10c1c3ad368b08e3.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/delta.png-6d33a172cc16b58040616e8ab29659c0.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/delta.png"
dest_files=[ "res://.import/delta.png-6d33a172cc16b58040616e8ab29659c0.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/godot_lifecycle.jpg-b26541e87e5327f35f02175dab2eb781.stex"
path="res://.import/godot_lifecycle.jpg-037760a00ff142e71992244f6df72be8.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/godot_lifecycle.jpg"
dest_files=[ "res://.import/godot_lifecycle.jpg-b26541e87e5327f35f02175dab2eb781.stex" ]
source_file="res://doc/demo03_lifecycle/image/godot_lifecycle.jpg"
dest_files=[ "res://.import/godot_lifecycle.jpg-037760a00ff142e71992244f6df72be8.stex" ]
[params]

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/godot_node.jpg-b1ae50029be0ff59b37e5722166b013b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/godot_node.jpg"
dest_files=[ "res://.import/godot_node.jpg-b1ae50029be0ff59b37e5722166b013b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/godot_process.jpg-0257d8dc365734710f5f2b2802378ee8.stex"
path="res://.import/godot_process.jpg-2dfceb541e0df0a164b3b272e84ee08a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/godot_process.jpg"
dest_files=[ "res://.import/godot_process.jpg-0257d8dc365734710f5f2b2802378ee8.stex" ]
source_file="res://doc/demo03_lifecycle/image/godot_process.jpg"
dest_files=[ "res://.import/godot_process.jpg-2dfceb541e0df0a164b3b272e84ee08a.stex" ]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/physics-1.png-ef2e451962ac74f3691ab95a9cac88aa.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/physics-1.png"
dest_files=[ "res://.import/physics-1.png-ef2e451962ac74f3691ab95a9cac88aa.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/physics.png-9f49b72ca846193cb574ebd2739c5037.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/physics.png"
dest_files=[ "res://.import/physics.png-9f49b72ca846193cb574ebd2739c5037.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/process-1.png-02e8fff5bdf8b34a093c5dac67d08419.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/process-1.png"
dest_files=[ "res://.import/process-1.png-02e8fff5bdf8b34a093c5dac67d08419.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/process.png-05cef36425ae9b8cc0b114b51584db1c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/process.png"
dest_files=[ "res://.import/process.png-05cef36425ae9b8cc0b114b51584db1c.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/场景帧.png-d58f7565689f65bb808fb434138afafb.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/场景帧.png"
dest_files=[ "res://.import/场景帧.png-d58f7565689f65bb808fb434138afafb.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/场景循环.png-f6713b039d478efc4a04732969cd2801.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo03_lifecycle/image/场景循环.png"
dest_files=[ "res://.import/场景循环.png-f6713b039d478efc4a04732969cd2801.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -1,3 +1,13 @@
![Image text](./godot_process.jpg)
![Image text](./godot_node.jpg)
![Image text](./godot_lifecycle.jpg)
![Image text](image/场景循环.png)
![Image text](image/场景帧.png)
![Image text](image/delta.png)
![Image text](image/delta-1.png)
![Image text](image/godot_process.jpg)
![Image text](image/godot_node.jpg)
![Image text](image/godot_lifecycle.jpg)
![Image text](image/process.png)
![Image text](image/process-1.png)
![Image text](image/physics.png)
![Image text](image/physics-1.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/component1.png-bfffd673f61ca5b7b9409dbd5abb1acc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/component1.png"
dest_files=[ "res://.import/component1.png-bfffd673f61ca5b7b9409dbd5abb1acc.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/component2.png-02438ddc3566bd64199cba25f509171f.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/component2.png"
dest_files=[ "res://.import/component2.png-02438ddc3566bd64199cba25f509171f.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/component3.png-e2e3aef9bbb5a8e0d59937c323e75c96.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/component3.png"
dest_files=[ "res://.import/component3.png-e2e3aef9bbb5a8e0d59937c323e75c96.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/component4.png-bcbe335fca7b1a1e0ff653b967054cf0.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/component4.png"
dest_files=[ "res://.import/component4.png-bcbe335fca7b1a1e0ff653b967054cf0.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/component5.png-e232bac21600f8aad9b90d6e61d0869d.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/component5.png"
dest_files=[ "res://.import/component5.png-e232bac21600f8aad9b90d6e61d0869d.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/场景.png-7f14201406e86b2c1d0ba5c1fb89a726.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/场景.png"
dest_files=[ "res://.import/场景.png-7f14201406e86b2c1d0ba5c1fb89a726.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/坐标系-godot-1.png-b9dfb88e50a51646aec5b1bca8dd901b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/坐标系-godot-1.png"
dest_files=[ "res://.import/坐标系-godot-1.png-b9dfb88e50a51646aec5b1bca8dd901b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/坐标系-godot-4个象限.png-47092e2d3ef1fb607296ce2a91696203.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/坐标系-godot-4个象限.png"
dest_files=[ "res://.import/坐标系-godot-4个象限.png-47092e2d3ef1fb607296ce2a91696203.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -2,15 +2,15 @@
importer="texture"
type="StreamTexture"
path="res://.import/integer_overflow.JPG-08e89d4444868183c3be1155d3451030.stex"
path="res://.import/坐标系-ps.JPG-e90c99294ebd56598afae2b5db793ff2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo02_base/integer_overflow.JPG"
dest_files=[ "res://.import/integer_overflow.JPG-08e89d4444868183c3be1155d3451030.stex" ]
source_file="res://doc/demo05_scene_node/image/坐标系-ps.JPG"
dest_files=[ "res://.import/坐标系-ps.JPG-e90c99294ebd56598afae2b5db793ff2.stex" ]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/坐标系.png-8f9d049adb143c879b7a19c22253ff65.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/坐标系.png"
dest_files=[ "res://.import/坐标系.png-8f9d049adb143c879b7a19c22253ff65.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/节点.png-caccd57bbbfafdce9e2636439f7a3f30.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/节点.png"
dest_files=[ "res://.import/节点.png-caccd57bbbfafdce9e2636439f7a3f30.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/节点渲染顺序.png-399ad5898925e3419def2ff658ef0991.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://doc/demo05_scene_node/image/节点渲染顺序.png"
dest_files=[ "res://.import/节点渲染顺序.png-399ad5898925e3419def2ff658ef0991.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,34 @@
# 坐标系
![Image text](image/坐标系.png)
![Image text](image/坐标系-godot-1.png)
![Image text](image/坐标系-godot-4个象限.png)
![Image text](image/坐标系-ps.JPG)
```
因为刚开始的时候有点疑惑godot的坐标系原点既然在左上角。unitycocos的2d原点都在左下角左下角的2d坐标系感觉很复合习惯。
unity的坐标系就很符合数学里面的象限刚开始有点不适应。
后来了解到计算机屏幕是从左上角开始刷新的2d坐标系左上角为原点可以屏幕坐标系吻合可以提升一点效率。
unity的2d坐标系虽然在左下角但是unity的屏幕坐标系依然在左上角不统一。
虽然godot的2d坐标系在左上角的坐标系刚开始看不舒服但是和屏幕坐标系吻合了也算一种统一就不需要untiy2d的那么多概念了为godot点赞。
因为单论平面内容制作左上原点更符合视觉习惯也更符合设计常识比如ps。
```
# 场景和节点
![Image text](image/场景.png )
![Image text](image/节点.png)
![Image text](image/节点渲染顺序.png)
- 一个游戏可以包含多个场景但是一个场景中必须有一个根节点一个根节点可以包含多个不重名的子节点unity的子节点可以同名不同名更加符合习惯为godot点赞。
# 基本组件
![Image text](./image/component1.png)
![Image text](./image/component2.png)
![Image text](./image/component3.png)
![Image text](./image/component4.png)
![Image text](./image/component5.png)

View File

@ -0,0 +1,11 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://script/demo06_scene_node/hero.gd" type="Script" id=1]
[ext_resource path="res://icon.png" type="Texture" id=2]
[node name="Node2D" type="Node2D"]
[node name="Hero" type="Sprite" parent="."]
position = Vector2( 477.791, 270.893 )
texture = ExtResource( 2 )
script = ExtResource( 1 )

View File

@ -1,6 +1,11 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://script/demo_test/demoTest.gd" type="Script" id=1]
[ext_resource path="res://icon.png" type="Texture" id=2]
[node name="Node2D" type="Node2D"]
script = ExtResource( 1 )
[node name="icon" type="Sprite" parent="."]
position = Vector2( 410.547, 444.333 )
texture = ExtResource( 2 )

View File

@ -37,7 +37,7 @@ func _ready():
myClass.innerClassTest()
print("垃圾回收--------------------------------")
# 如果一个类没有指明继承哪个类则默认继承Reference可以被自动的垃圾回收类似其他语言的那种垃圾回收
# 如果一个类没有指明继承哪个类则默认继承Reference可以被自动的垃圾回收类似其他语言的那种垃圾回收,非常重要的知识点
for i in range(10000):
var instance = MyClass.new()
arr.append(instance)

View File

@ -0,0 +1,36 @@
extends Sprite
var gameWidth: int
var gameHeight: int
var spriteWidth: int
var spriteHeight: int
func _physics_process(delta):
setupSprite()
setupGameWindow()
positionTopCenter()
func setupSprite():
spriteWidth = texture.get_width()
spriteHeight = texture.get_height()
func setupGameWindow():
gameWidth = OS.window_size.x
gameHeight = OS.window_size.y
func positionTopCenter() -> void:
self.position.x = gameWidth / 2
self.position.y = spriteHeight / 2
func positionCenter() -> void:
self.position.x = gameWidth / 2
self.position.y = gameHeight / 2
func positionBottomCenter() -> void:
self.position.x = gameWidth / 2
self.position.y = gameHeight - spriteHeight / 2
func positionLeftCenter() -> void:
self.position.x = spriteWidth / 2
self.position.y = gameHeight / 2

View File

@ -38,3 +38,6 @@ static func randomIntRange(from: int, to: int) -> int:
return 0
return getRandom().randi_range(from, to - 1)
static func randomEle(array: Array):
return array[randomIntLimit(array.size())]