Compare commits
588 Commits
3.2-5c154d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b509950099 | ||
|
|
db745e5e59 | ||
|
|
ecbb2ee713 | ||
|
|
bf544aefd9 | ||
|
|
156044e6dd | ||
|
|
245cbfc66a | ||
|
|
a90d9d8c9a | ||
|
|
51fadd795c | ||
|
|
6a0325b0b8 | ||
|
|
41171d85d4 | ||
|
|
6adcbc912e | ||
|
|
8a582321ae | ||
|
|
520b4a7870 | ||
|
|
0ae09b7e5a | ||
|
|
0343cedd48 | ||
|
|
a01005f397 | ||
|
|
7d73b8c4cb | ||
|
|
217436bce6 | ||
|
|
7c6cd796d7 | ||
|
|
a2e97c0a25 | ||
|
|
14fcc0e133 | ||
|
|
de00da353c | ||
|
|
656595a6d2 | ||
|
|
588c1cd257 | ||
|
|
082cb16072 | ||
|
|
3088473167 | ||
|
|
d7b6f86b0b | ||
|
|
7d5f9269ca | ||
|
|
94d3d40d70 | ||
|
|
84ac7b40a6 | ||
|
|
af2b9b1f30 | ||
|
|
6424e02ebf | ||
|
|
a5bce2f144 | ||
|
|
a0f59648f2 | ||
|
|
57daa67c23 | ||
|
|
711822a319 | ||
|
|
10eb2807b8 | ||
|
|
0cff177d59 | ||
|
|
05aeb11de9 | ||
|
|
1d8fa9c44d | ||
|
|
69b317692e | ||
|
|
649360f17e | ||
|
|
a5f9289d13 | ||
|
|
5f4a9e409f | ||
|
|
bdc33d1568 | ||
|
|
dc4abff7d0 | ||
|
|
a64cebdf7a | ||
|
|
efb56dcee4 | ||
|
|
0540894062 | ||
|
|
49718c4b16 | ||
|
|
c70741bac0 | ||
|
|
78c04bbd28 | ||
|
|
9fb7d5d211 | ||
|
|
84eabb3cf7 | ||
|
|
aecf661c9c | ||
|
|
b45ef5497b | ||
|
|
2fc0497915 | ||
|
|
d588eb58ce | ||
|
|
bf4d1038d6 | ||
|
|
48aaefbf12 | ||
|
|
ba8718ed09 | ||
|
|
219eeacced | ||
|
|
28e2fc1f15 | ||
|
|
d438fcc8d6 | ||
|
|
7d525f4c9b | ||
|
|
89b2660d69 | ||
|
|
9acb5528b6 | ||
|
|
1280ef63e7 | ||
|
|
0d6b7722c0 | ||
|
|
dbe9f48dcc | ||
|
|
8be477ce38 | ||
|
|
16f4b10bc6 | ||
|
|
1cd5f27f8e | ||
|
|
da2f21baac | ||
|
|
c97a648356 | ||
|
|
f78efc69ee | ||
|
|
dc3670e25a | ||
|
|
a445398c60 | ||
|
|
3ced51c91c | ||
|
|
1f58baa94c | ||
|
|
6a2de9c3ee | ||
|
|
be7a046c1e | ||
|
|
ba2755359d | ||
|
|
2d64c95990 | ||
|
|
9456158841 | ||
|
|
90f309174d | ||
|
|
a531235db3 | ||
|
|
debdec8469 | ||
|
|
819d201cc4 | ||
|
|
a88ca219b8 | ||
|
|
c05d05009b | ||
|
|
b06917acaa | ||
|
|
9db52662cb | ||
|
|
7befd7c718 | ||
|
|
90617ba1e8 | ||
|
|
f7a1433739 | ||
|
|
d21c03d09c | ||
|
|
d169ec17e2 | ||
|
|
fad2469531 | ||
|
|
4d49bbd1b8 | ||
|
|
5557b10cfa | ||
|
|
fdb2f50a20 | ||
|
|
0d46333c4e | ||
|
|
c3b0331d8a | ||
|
|
0e24c8eb2e | ||
|
|
be77353917 | ||
|
|
d3c71ddb20 | ||
|
|
c49e134e13 | ||
|
|
81249b3f4a | ||
|
|
51a7d389af | ||
|
|
5f0e0ce205 | ||
|
|
6f44371df1 | ||
|
|
15bcb941de | ||
|
|
5d9542113a | ||
|
|
0fb1b4e09c | ||
|
|
1e02914267 | ||
|
|
6db1062768 | ||
|
|
adf6d7e08d | ||
|
|
c492e5fd73 | ||
|
|
7ed5b1c116 | ||
|
|
53d3f9cdde | ||
|
|
edccce8563 | ||
|
|
a87fded4cf | ||
|
|
fdae025495 | ||
|
|
fa6061c623 | ||
|
|
8ab921d5b4 | ||
|
|
723331f814 | ||
|
|
71630e80e4 | ||
|
|
5646c6a7a8 | ||
|
|
582229e17c | ||
|
|
7e2a55aa07 | ||
|
|
b05fb07d77 | ||
|
|
7e60538469 | ||
|
|
9f59648c26 | ||
|
|
13b2787173 | ||
|
|
6c635fe75a | ||
|
|
6d5ded3c7d | ||
|
|
cbb68060c6 | ||
|
|
0fba875c72 | ||
|
|
98899881e7 | ||
|
|
8fd41702c6 | ||
|
|
34d174e315 | ||
|
|
3265d3fcd4 | ||
|
|
7d42ae3c9a | ||
|
|
e6fcf24f89 | ||
|
|
16d8ba09fb | ||
|
|
7223aec001 | ||
|
|
0ec2fff5bf | ||
|
|
78bbd99f0d | ||
|
|
b4c73f4888 | ||
|
|
677dc46eeb | ||
|
|
fbb7cb442c | ||
|
|
909331ac51 | ||
|
|
785e3213d5 | ||
|
|
fad6cc2e1b | ||
|
|
9a0c857131 | ||
|
|
bac1e69164 | ||
|
|
8e9c180278 | ||
|
|
3859c66f0e | ||
|
|
9a5176e430 | ||
|
|
95cfb076d1 | ||
|
|
9043224bb2 | ||
|
|
01db4a6f99 | ||
|
|
035e905a3e | ||
|
|
b2ed2d6f6d | ||
|
|
fbef18f58b | ||
|
|
4f866f2a9a | ||
|
|
af93126e05 | ||
|
|
5bda007763 | ||
|
|
f70868ce22 | ||
|
|
6e44341d67 | ||
|
|
3788da41cd | ||
|
|
57c1cb9ffa | ||
|
|
85b8f10778 | ||
|
|
0a35055aa0 | ||
|
|
3ef6a15741 | ||
|
|
d190e73ad3 | ||
|
|
79d30931c3 | ||
|
|
56f103953d | ||
|
|
be7be4c1cc | ||
|
|
5553ecfd88 | ||
|
|
ab9ffb7558 | ||
|
|
c181965682 | ||
|
|
31d1c0c112 | ||
|
|
82913393a8 | ||
|
|
523c7d34c0 | ||
|
|
71eea49eba | ||
|
|
98e9176b73 | ||
|
|
b8a8670301 | ||
|
|
a69b2f7e21 | ||
|
|
722bd11689 | ||
|
|
4d01a2678f | ||
|
|
8fc246a051 | ||
|
|
f954d78903 | ||
|
|
196df0c78b | ||
|
|
ddf6d60ed4 | ||
|
|
c423f3bfc6 | ||
|
|
2a962929f3 | ||
|
|
b74261ca04 | ||
|
|
7176ff19dc | ||
|
|
62db0c91de | ||
|
|
b36d6f0db2 | ||
|
|
81ea8edf47 | ||
|
|
567931097e | ||
|
|
4a4b46cbe1 | ||
|
|
cdbdbac1e7 | ||
|
|
5eed925b7b | ||
|
|
c76c4e8a5c | ||
|
|
a2557fce51 | ||
|
|
40ce32c5da | ||
|
|
7af99c55ef | ||
|
|
232eb35acf | ||
|
|
757cc4261c | ||
|
|
851862f8db | ||
|
|
5689210c46 | ||
|
|
4d31672264 | ||
|
|
7e9d31bb04 | ||
|
|
1b61bc4bb0 | ||
|
|
84b7f9ea36 | ||
|
|
d880218056 | ||
|
|
3706e3e998 | ||
|
|
e2abd0e7fb | ||
|
|
647002a75c | ||
|
|
9484fbbace | ||
|
|
1c169add0d | ||
|
|
7e43dbf64b | ||
|
|
ce4600350e | ||
|
|
db8ac0422d | ||
|
|
fc7ff91882 | ||
|
|
0dfb54ff7f | ||
|
|
65b34f8192 | ||
|
|
ad2cdfebd4 | ||
|
|
1113bafac4 | ||
|
|
0938a48563 | ||
|
|
68aefef5b9 | ||
|
|
e85494a57a | ||
|
|
e9f0f75c5b | ||
|
|
9c8dc6383e | ||
|
|
f7e3ceb31e | ||
|
|
c3f09a45dc | ||
|
|
fbc7341439 | ||
|
|
179f94528b | ||
|
|
beaefdc0c0 | ||
|
|
ea37c101e0 | ||
|
|
a5d736f624 | ||
|
|
0a84347d11 | ||
|
|
b032b75c07 | ||
|
|
c27056da58 | ||
|
|
302e8727e1 | ||
|
|
18c76b6dae | ||
|
|
5867e5e931 | ||
|
|
f4d146d0ec | ||
|
|
548c4d5b26 | ||
|
|
6860a1e814 | ||
|
|
3a38ab4635 | ||
|
|
0e83ebc6af | ||
|
|
b47178faac | ||
|
|
7cd99ae192 | ||
|
|
81a16597b9 | ||
|
|
79edc17b70 | ||
|
|
1eb4eccd55 | ||
|
|
2aff1c69a3 | ||
|
|
65c8d77cf4 | ||
|
|
502d410777 | ||
|
|
0d02b2f90d | ||
|
|
167e1d391b | ||
|
|
f6ac674864 | ||
|
|
83af3223df | ||
|
|
518eb6df52 | ||
|
|
199e4bed4c | ||
|
|
63d1cd9a60 | ||
|
|
4bbf04129a | ||
|
|
d4496aada8 | ||
|
|
71d29dcf3b | ||
|
|
956875c306 | ||
|
|
e375d5aa49 | ||
|
|
8a4a0262e9 | ||
|
|
2b16927567 | ||
|
|
92c39e7f1c | ||
|
|
185d0f4b05 | ||
|
|
82c9367044 | ||
|
|
4045f997c2 | ||
|
|
934b02bd84 | ||
|
|
4e27134403 | ||
|
|
76ec36d805 | ||
|
|
285139fc4e | ||
|
|
a62a4c8534 | ||
|
|
3696e43696 | ||
|
|
778baf07cc | ||
|
|
106e03c3b8 | ||
|
|
c34e3f33c6 | ||
|
|
b4ab5b4e14 | ||
|
|
b4252c05bf | ||
|
|
cbb297750f | ||
|
|
6cbfa30e8b | ||
|
|
58c33d04db | ||
|
|
e306a408dc | ||
|
|
8ef5764b0d | ||
|
|
b81ab55554 | ||
|
|
6947ff4529 | ||
|
|
20d2e6ed2f | ||
|
|
a3a6e72099 | ||
|
|
faee000550 | ||
|
|
1cf4fff74a | ||
|
|
6df3667072 | ||
|
|
d059806f20 | ||
|
|
e03d6abbc8 | ||
|
|
648befbf58 | ||
|
|
78dffe0d04 | ||
|
|
fa3c247bd5 | ||
|
|
73d96b7306 | ||
|
|
ffd600917d | ||
|
|
da6fffbc81 | ||
|
|
5e8f722c91 | ||
|
|
7e9078be51 | ||
|
|
26d2f226a8 | ||
|
|
b89af52a73 | ||
|
|
ac939fc8f8 | ||
|
|
a00465dee8 | ||
|
|
ecd12d2163 | ||
|
|
a0ad65d7df | ||
|
|
8fcf95c120 | ||
|
|
a78c51da26 | ||
|
|
b91b30a854 | ||
|
|
fb9d637fb7 | ||
|
|
a467f5078b | ||
|
|
6c521556a0 | ||
|
|
b22177e926 | ||
|
|
19dd819072 | ||
|
|
c22732e4cc | ||
|
|
24bd3745e3 | ||
|
|
afc51649fe | ||
|
|
d9202081aa | ||
|
|
40b8c76856 | ||
|
|
cfeb6d6b75 | ||
|
|
a667e74db5 | ||
|
|
682b933dac | ||
|
|
ee5862a782 | ||
|
|
bf898dc717 | ||
|
|
55934859e3 | ||
|
|
8a6a3a8eef | ||
|
|
6bdf4cd06e | ||
|
|
2c2c89e040 | ||
|
|
490f178f62 | ||
|
|
f2c66d1904 | ||
|
|
c1461de661 | ||
|
|
905717d462 | ||
|
|
470464518b | ||
|
|
b04aa38abb | ||
|
|
3b06e40e72 | ||
|
|
1d5184e235 | ||
|
|
85ca2fb2a1 | ||
|
|
d3cc6be62c | ||
|
|
4eb852ac78 | ||
|
|
139cb6b05e | ||
|
|
35f9517ea8 | ||
|
|
095beddcb9 | ||
|
|
1b2ce74a39 | ||
|
|
fa0fce0eb6 | ||
|
|
1a9aea09ef | ||
|
|
0cfbbec3f9 | ||
|
|
f47f25180c | ||
|
|
c71e401b08 | ||
|
|
364e8cbfb8 | ||
|
|
93509019a9 | ||
|
|
6ca863ffb0 | ||
|
|
a425dccaa5 | ||
|
|
2eb14690fc | ||
|
|
da12c09942 | ||
|
|
dd2ba9a5ba | ||
|
|
ea65d7f896 | ||
|
|
3d16659046 | ||
|
|
8d726b52a9 | ||
|
|
6cf53c39bf | ||
|
|
cd586acd33 | ||
|
|
3d4947bcb5 | ||
|
|
044afe7976 | ||
|
|
9dbd05a8a8 | ||
|
|
5efee6741f | ||
|
|
3d7c24ef1b | ||
|
|
de27fa1d5a | ||
|
|
02c6a268c3 | ||
|
|
ae57eb2080 | ||
|
|
4af38765af | ||
|
|
f3f0ac4827 | ||
|
|
5f1776bdf4 | ||
|
|
c9193d1035 | ||
|
|
948db2893b | ||
|
|
92e24ceb99 | ||
|
|
e591ceece9 | ||
|
|
7ef60c2874 | ||
|
|
471243f38e | ||
|
|
bde67b4c5e | ||
|
|
666d1cbf99 | ||
|
|
2831e16798 | ||
|
|
521fc2d755 | ||
|
|
d103e7aec2 | ||
|
|
7349ccc6a0 | ||
|
|
cd32f64f80 | ||
|
|
983c1361dd | ||
|
|
3657f91c0c | ||
|
|
7edfc9b29e | ||
|
|
e77b85fba3 | ||
|
|
0f848370fe | ||
|
|
4618c9b04e | ||
|
|
5c40412e34 | ||
|
|
48d2ec90fc | ||
|
|
06af3f0c2c | ||
|
|
2c244014df | ||
|
|
5766a55115 | ||
|
|
ce2bd76d80 | ||
|
|
b0c27f044e | ||
|
|
0d3be3e10f | ||
|
|
6ddead591a | ||
|
|
560ea5a6ce | ||
|
|
60457b4d99 | ||
|
|
86be54ae49 | ||
|
|
6eec19b9af | ||
|
|
935e9bbc44 | ||
|
|
59d443e889 | ||
|
|
31b962adba | ||
|
|
aeba3a05aa | ||
|
|
9737f8eaa7 | ||
|
|
a0a5b0e7b0 | ||
|
|
8902903099 | ||
|
|
353dc4d2d6 | ||
|
|
a8d797cd46 | ||
|
|
3d158cc902 | ||
|
|
9f8a625c8e | ||
|
|
3eda0c7fe1 | ||
|
|
81fef6072b | ||
|
|
8fea00cfac | ||
|
|
960ade79ca | ||
|
|
6ac2aeea60 | ||
|
|
e5ceb2d8a5 | ||
|
|
713dfd064d | ||
|
|
188cfda940 | ||
|
|
3eb81eb6a2 | ||
|
|
be59edcb97 | ||
|
|
bf4425babb | ||
|
|
85e7aeec99 | ||
|
|
8793b7117f | ||
|
|
7d7c08ad54 | ||
|
|
d4c040b527 | ||
|
|
5c532525cc | ||
|
|
1b1244d113 | ||
|
|
27af28d02c | ||
|
|
0fbb2b99b0 | ||
|
|
861638b9d0 | ||
|
|
e6c19ff4a9 | ||
|
|
2ff9d17f46 | ||
|
|
5566c748c2 | ||
|
|
730b2f30a0 | ||
|
|
cb52878006 | ||
|
|
ab0816a44e | ||
|
|
f2918178d7 | ||
|
|
b9ad7a4ac3 | ||
|
|
981359289c | ||
|
|
37e7ec0985 | ||
|
|
0e2c5ad182 | ||
|
|
3e3a9e7b6e | ||
|
|
27e4e36e03 | ||
|
|
bbe50fc9da | ||
|
|
410d783126 | ||
|
|
f47d0909cc | ||
|
|
907b8a2f42 | ||
|
|
1923153f46 | ||
|
|
5875f2a320 | ||
|
|
895749024a | ||
|
|
2e40f67b1b | ||
|
|
f1de905f87 | ||
|
|
b0d4a7cb8a | ||
|
|
fed698d0d2 | ||
|
|
db01a216fd | ||
|
|
b46a823342 | ||
|
|
2190128fd3 | ||
|
|
9e096b1c89 | ||
|
|
14580c55ac | ||
|
|
076b0453c6 | ||
|
|
6b983c0542 | ||
|
|
07d6c311d7 | ||
|
|
58c337c33c | ||
|
|
aeb2d7b8d5 | ||
|
|
b0fdd8cf76 | ||
|
|
fbde23fbb0 | ||
|
|
3f507c0363 | ||
|
|
a2979d237b | ||
|
|
9d67db049a | ||
|
|
851f486a48 | ||
|
|
be43d1644b | ||
|
|
75505ca79f | ||
|
|
7c8b9962ca | ||
|
|
149cfcb995 | ||
|
|
7611baf52e | ||
|
|
efd3a46331 | ||
|
|
4c0cb41a0e | ||
|
|
f6594e9923 | ||
|
|
4a832ad714 | ||
|
|
0200ba6c95 | ||
|
|
d047c2de5b | ||
|
|
f30f16b8ce | ||
|
|
52f5b2e5d2 | ||
|
|
0fc59325ab | ||
|
|
eba852bbde | ||
|
|
f82dd94089 | ||
|
|
3e9e2079a7 | ||
|
|
585455e67c | ||
|
|
b7e0a470c7 | ||
|
|
53ea602c07 | ||
|
|
874d3bcc33 | ||
|
|
cbb5c94c6f | ||
|
|
87cfcb7a4f | ||
|
|
31cc886d07 | ||
|
|
9a2889b35b | ||
|
|
44daa8ac89 | ||
|
|
44aefaecb6 | ||
|
|
7a7af4cf4e | ||
|
|
1916f87ac5 | ||
|
|
36e8b45bd4 | ||
|
|
89b64e33e2 | ||
|
|
2b10e6724e | ||
|
|
b9685cb369 | ||
|
|
d1f25ca4aa | ||
|
|
11a72411cc | ||
|
|
5057fcff50 | ||
|
|
d791cd9bda | ||
|
|
7d7c728227 | ||
|
|
5fb81434e7 | ||
|
|
c3c4fdf4fa | ||
|
|
9ea18370d3 | ||
|
|
f9333dce01 | ||
|
|
84a87a5128 | ||
|
|
7d64830cfe | ||
|
|
f08916c90f | ||
|
|
e44e3521b6 | ||
|
|
89978a7421 | ||
|
|
6ca2a45a21 | ||
|
|
57f8628b50 | ||
|
|
a4e8231f5a | ||
|
|
f71816ed31 | ||
|
|
ef069d49ae | ||
|
|
742ea87708 | ||
|
|
45f5417822 | ||
|
|
f28a09ea0d | ||
|
|
85c1805d33 | ||
|
|
7e129db12e | ||
|
|
7bfc57d1ae | ||
|
|
cd48c9a9cc | ||
|
|
244b759787 | ||
|
|
6875a21545 | ||
|
|
694ee7fa36 | ||
|
|
6e3db7c64d | ||
|
|
2d4d23302a | ||
|
|
4456027f91 | ||
|
|
19312b2899 | ||
|
|
ca17967de1 | ||
|
|
491fb265b1 | ||
|
|
08be1b7f03 | ||
|
|
4ef90a836a | ||
|
|
bfd903a933 | ||
|
|
e0db0b8f6d | ||
|
|
4d21951b71 | ||
|
|
7656c08454 | ||
|
|
e894e4655a | ||
|
|
2ce76ff4e5 | ||
|
|
e5d829eb8f | ||
|
|
7f025e000e | ||
|
|
5132941a84 | ||
|
|
ef265cca0a | ||
|
|
31bb09233b | ||
|
|
57f5e0835d | ||
|
|
814909538f | ||
|
|
94ec2ea5d9 | ||
|
|
40aec7c068 | ||
|
|
ead2777f48 | ||
|
|
0a0d44d4f1 | ||
|
|
4911866f3d | ||
|
|
d7e1052205 | ||
|
|
8e2dbf3f55 | ||
|
|
2ee9b47f6c | ||
|
|
d8dc94c1ff | ||
|
|
d989bf6209 | ||
|
|
021070215c | ||
|
|
ac61cba05b | ||
|
|
21e829416f | ||
|
|
cf7e4b31f4 | ||
|
|
dc5c1016ce | ||
|
|
8a0824a948 |
21
.clang-format
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
BasedOnStyle: LLVM
|
||||||
|
AlignAfterOpenBracket: DontAlign
|
||||||
|
AlignOperands: DontAlign
|
||||||
|
AlignTrailingComments:
|
||||||
|
Kind: Never
|
||||||
|
OverEmptyLines: 0
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: Inline
|
||||||
|
BreakConstructorInitializers: AfterColon
|
||||||
|
ColumnLimit: 0
|
||||||
|
ContinuationIndentWidth: 8
|
||||||
|
IndentCaseLabels: true
|
||||||
|
IndentWidth: 4
|
||||||
|
InsertBraces: true
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
|
RemoveSemicolon: true
|
||||||
|
SpacesInLineCommentPrefix:
|
||||||
|
Minimum: 0 # We want a minimum of 1 for comments, but allow 0 for disabled code.
|
||||||
|
Maximum: -1
|
||||||
|
TabWidth: 4
|
||||||
|
UseTab: Always
|
||||||
@@ -2,10 +2,15 @@
|
|||||||
root = true
|
root = true
|
||||||
|
|
||||||
# Unix-style newlines with a newline ending every file.
|
# Unix-style newlines with a newline ending every file.
|
||||||
[*.cs]
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[*.cs]
|
||||||
csharp_space_after_cast = false
|
csharp_space_after_cast = false
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
|
|
||||||
[*.csproj]
|
[*.csproj]
|
||||||
|
insert_final_newline = false
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
13
.github/CODEOWNERS
vendored
@@ -2,7 +2,12 @@
|
|||||||
# Each line is a file pattern followed by one or more owners.
|
# Each line is a file pattern followed by one or more owners.
|
||||||
# Owners can be @users, @org/teams or emails
|
# Owners can be @users, @org/teams or emails
|
||||||
|
|
||||||
/misc/2.5d @aaronfranke
|
/.github/dist/ @Calinou
|
||||||
/mono/2.5d @aaronfranke
|
|
||||||
/2d/physics_tests @pouleyKetchoupp
|
/3d/voxel/ @aaronfranke
|
||||||
/3d/physics_tests @pouleyKetchoupp
|
/misc/matrix_transform/ @aaronfranke
|
||||||
|
/misc/2.5d/ @aaronfranke
|
||||||
|
/mono/2.5d/ @aaronfranke
|
||||||
|
|
||||||
|
/2d/physics_tests/ @pouleyKetchoupp
|
||||||
|
/3d/physics_tests/ @pouleyKetchoupp
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/bug-report.md
vendored
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Bug Report
|
name: Bug Report
|
||||||
about: Report a bug with one of the demo projects.
|
about: Report a bug with one of the demo projects.
|
||||||
title: ''
|
title: ""
|
||||||
labels: bug
|
labels: bug
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: Feature / Enhancement Request
|
name: Feature / Enhancement Request
|
||||||
about: Adding new features or improving existing ones.
|
about: Adding new features or improving existing ones.
|
||||||
title: ''
|
title: ""
|
||||||
labels: enhancement
|
labels: enhancement
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
25
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,24 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
Only submit a pull request if all of the following conditions are met:
|
Please target the `master` branch in priority.
|
||||||
|
PRs can target `3.x` if the same change was done in `master`, or is not relevant there.
|
||||||
|
|
||||||
* It must work with the latest stable Godot version. Do not submit a
|
Relevant fixes are cherry-picked for stable branches as needed by maintainers.
|
||||||
pull request if it only works with alpha/beta builds.
|
You can mention in the description if the change is compatible with `3.x`.
|
||||||
|
|
||||||
* It must follow all of the Godot style guides, including the GDScript
|
|
||||||
style guide and the C# style guide.
|
|
||||||
|
|
||||||
* The demo should not be overcomplicated. Simplicity is usually preferred.
|
|
||||||
|
|
||||||
* If you are submitting a new demo, please ensure that it includes a
|
|
||||||
README file similar to the other demos.
|
|
||||||
|
|
||||||
* If you are submitting a copy of a demo translated to C# etc:
|
|
||||||
|
|
||||||
* Please ensure that there is a good reason to have this demo translated.
|
|
||||||
We don't want to have multiple copies of every single project.
|
|
||||||
|
|
||||||
* Please ensure that the code mirrors the original closely.
|
|
||||||
|
|
||||||
* In the project.godot file and in the README, include "with C#" etc in
|
|
||||||
the title, and also include a link to the original in the README.
|
|
||||||
-->
|
-->
|
||||||
|
|||||||
32
.github/dist/export_presets.cfg
vendored
@@ -1,23 +1,41 @@
|
|||||||
[preset.0]
|
[preset.0]
|
||||||
|
|
||||||
name="HTML5"
|
name="Web"
|
||||||
platform="HTML5"
|
platform="Web"
|
||||||
runnable=true
|
runnable=true
|
||||||
|
advanced_options=false
|
||||||
|
dedicated_server=false
|
||||||
custom_features=""
|
custom_features=""
|
||||||
export_filter="all_resources"
|
export_filter="all_resources"
|
||||||
include_filter=""
|
include_filter=""
|
||||||
exclude_filter=""
|
exclude_filter=""
|
||||||
export_path=""
|
export_path=""
|
||||||
script_export_mode=1
|
encryption_include_filters=""
|
||||||
script_encryption_key=""
|
encryption_exclude_filters=""
|
||||||
|
encrypt_pck=false
|
||||||
|
encrypt_directory=false
|
||||||
|
script_export_mode=2
|
||||||
|
|
||||||
[preset.0.options]
|
[preset.0.options]
|
||||||
|
|
||||||
custom_template/debug=""
|
custom_template/debug=""
|
||||||
custom_template/release=""
|
custom_template/release=""
|
||||||
variant/export_type=0
|
variant/extensions_support=false
|
||||||
|
variant/thread_support=true
|
||||||
vram_texture_compression/for_desktop=true
|
vram_texture_compression/for_desktop=true
|
||||||
vram_texture_compression/for_mobile=false
|
vram_texture_compression/for_mobile=true
|
||||||
|
html/export_icon=true
|
||||||
html/custom_html_shell=""
|
html/custom_html_shell=""
|
||||||
html/head_include=""
|
html/head_include=""
|
||||||
html/full_window_size=true
|
html/canvas_resize_policy=2
|
||||||
|
html/focus_canvas_on_start=true
|
||||||
|
html/experimental_virtual_keyboard=true
|
||||||
|
progressive_web_app/enabled=true
|
||||||
|
progressive_web_app/ensure_cross_origin_isolation_headers=true
|
||||||
|
progressive_web_app/offline_page=""
|
||||||
|
progressive_web_app/display=0
|
||||||
|
progressive_web_app/orientation=1
|
||||||
|
progressive_web_app/icon_144x144=""
|
||||||
|
progressive_web_app/icon_180x180=""
|
||||||
|
progressive_web_app/icon_512x512=""
|
||||||
|
progressive_web_app/background_color=Color(0, 0, 0, 1)
|
||||||
|
|||||||
45
.github/dist/footer.html
vendored
@@ -1,19 +1,38 @@
|
|||||||
<!-- The list of demos will be inserted above by the CI process. -->
|
<!-- The list of demos will be inserted above by the CI process. -->
|
||||||
</ul>
|
</ul>
|
||||||
<h2>Unavailable demos</h2>
|
<h2>Unavailable demos</h2>
|
||||||
<ul>
|
<ul class="unsupported-demos">
|
||||||
<li><code>2d/hdr/</code>: Not supported on HTML5 yet.
|
<li><code>2d/glow</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
|
||||||
<li><code>3d/voxel/</code>: Not supported on HTML5 yet.
|
<li><code>2d/navigation_mesh_chunks</code>: Relies on debug-only drawing functionality which is not available in projects exported in release mode.</li>
|
||||||
<li><code>audio/device_changer/</code>: Not supported on HTML5 due to browser limitations.
|
<li><code>2d/physics_tests</code>: Relies on debug-only drawing functionality which is not available in projects exported in release mode.</li>
|
||||||
<li><code>loading/background_load/</code>: Not supported on HTML5 yet.
|
<li><code>3d/labels_and_texts</code>: Does not export in headless mode due to an engine bug (font importing infinite loop).</li>
|
||||||
<li><code>loading/multiple_threads_loading/</code>: Not supported on HTML5 yet.
|
<li><code>3d/decals</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
|
||||||
<li><code>loading/threads/</code>: Not supported on HTML5 yet.
|
<li><code>3d/ik</code>: Demo is not fully ported to Godot 4 yet (even though the feature works on the web).</li>
|
||||||
<li><code>misc/matrix_transform/</code>: Results are only visible in the editor.
|
<li><code>3d/navigation_mesh_chunks</code>: Relies on debug-only drawing functionality which is not available in projects exported in release mode.</li>
|
||||||
<li><code>mobile/android_iap/</code>: Only relevant on native Android.
|
<li><code>3d/occlusion_culling_mesh_lod</code>: Occlusion culling is disabled by default in web builds to decrease binary size.</li>
|
||||||
<li><code>mobile/sensors/</code>: Not supported on HTML5 yet.
|
<li><code>3d/particles</code>: Demo mostly showcases features that are not available in Compatibility (which the web platform always uses).</li>
|
||||||
<li><code>mono/*/</code>: Not available yet (requires Mono-enabled HTML5 build).</li>
|
<li><code>3d/physical_light_camera_units</code>: Demo is not tuned for the Compatibility rendering method (which the web platform always uses).</li>
|
||||||
<li><code>networking/*/</code>: Doesn't make sense to be hosted on a static host, as the server must be hosted on the same origin due to the browser's same-origin policy.</li>
|
<li><code>3d/physics_tests</code>: Relies on debug-only drawing functionality which is not available in projects exported in release mode.</li>
|
||||||
<li><code>plugins/*/</code>: Only effective within the editor.</li>
|
<li><code>3d/variable_rate_shading</code>: Not supported on the Compatibility rendering method (which the web platform always uses)</li>
|
||||||
|
<li><code>3d/volumetric_fog</code>: Not supported on the Compatibility rendering method (which the web platform always uses)</li>
|
||||||
|
<li><code>3d/voxel</code>: Freezes after a few seconds of gameplay due to web platform-specific threading issues.</li>
|
||||||
|
<li><code>audio/bpm_sync</code>: Not functional on the web platform due to differences in the audio playback implementation.</li>
|
||||||
|
<li><code>audio/device_changer</code>: Not relevant for the web platform, as the web browser always chooses the audio output device.</li>
|
||||||
|
<li><code>audio/midi_piano</code>: Not functional on the web platform due to differences in the audio playback implementation.</li>
|
||||||
|
<li><code>audio/spectrum</code>: Not functional on the web platform due to differences in the audio playback implementation.</li>
|
||||||
|
<li><code>compute/*</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
|
||||||
|
<li><code>gui/msdf_font</code>: Does not export in headless mode due to an engine bug (font importing crashes).</li>
|
||||||
|
<li><code>gui/translation</code>: Does not export in headless mode due to an engine bug (font importing crashes).</li>
|
||||||
|
<li><code>loading/runtime_save_load</code>: Native filesystem access is not available on the web platform.</li>
|
||||||
|
<li><code>misc/compute_shader_heightmap</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
|
||||||
|
<li><code>misc/large_world_coordinates</code>: Not supported on the Compatibility rendering method (which the web platform always uses).</li>
|
||||||
|
<li><code>misc/matrix_transform</code>: Results are only visible in the editor.</li>
|
||||||
|
<li><code>mobile/android_iap</code>: Only relevant on native Android.</li>
|
||||||
|
<li><code>mobile/sensors</code>: Not supported on the web platform.</li>
|
||||||
|
<li><code>mono/*</code>: Not available yet (requires Mono-enabled HTML5 build).</li>
|
||||||
|
<li><code>networking/*</code>: Doesn't make sense to be hosted on a static host, as the server must be hosted on the same origin due to the browser's same-origin policy.</li>
|
||||||
|
<li><code>plugins/*</code>: Only effective within the editor.</li>
|
||||||
|
<li><code>xr/openxr_*</code>: Not functional on the web platform, as these demos are not designed for WebXR.</li>
|
||||||
</ul>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
26
.github/dist/header.html
vendored
@@ -4,13 +4,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Godot demos exported to HTML5</title>
|
<title>Official Godot demos exported to Web</title>
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--background-color: #fff;
|
--background-color: #fff;
|
||||||
--text-color: #222;
|
--text-color: #222;
|
||||||
--link-color: hsl(220, 100%, 45%);
|
--link-color: hsl(220, 100%, 45%);
|
||||||
|
--link-visited-color: hsl(270, 100%, 55%);
|
||||||
--link-underline-color: hsla(220, 100%, 45%, 0.3);
|
--link-underline-color: hsla(220, 100%, 45%, 0.3);
|
||||||
|
--link-underline-visited-color: hsla(270, 100%, 45%, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
@@ -18,7 +20,9 @@
|
|||||||
--background-color: #222;
|
--background-color: #222;
|
||||||
--text-color: #eee;
|
--text-color: #eee;
|
||||||
--link-color: hsl(200, 100%, 70%);
|
--link-color: hsl(200, 100%, 70%);
|
||||||
|
--link-visited-color: hsl(250, 100%, 80%);
|
||||||
--link-underline-color: hsla(200, 100%, 70%, 0.3);
|
--link-underline-color: hsla(200, 100%, 70%, 0.3);
|
||||||
|
--link-underline-visited-color: hsla(250, 100%, 70%, 0.3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,6 +56,11 @@
|
|||||||
text-decoration-thickness: 0.125rem;
|
text-decoration-thickness: 0.125rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
a:visited {
|
||||||
|
color: var(--link-visited-color);
|
||||||
|
text-decoration-color: var(--link-visited-color);
|
||||||
|
}
|
||||||
|
|
||||||
a:hover {
|
a:hover {
|
||||||
filter: brightness(117.5%);
|
filter: brightness(117.5%);
|
||||||
}
|
}
|
||||||
@@ -88,6 +97,9 @@
|
|||||||
margin: 20px 10px;
|
margin: 20px 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.unsupported-demos li {
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
@@ -96,21 +108,21 @@
|
|||||||
<p>
|
<p>
|
||||||
This page lists
|
This page lists
|
||||||
<a href="https://github.com/godotengine/godot-demo-projects">official Godot demo projects</a>
|
<a href="https://github.com/godotengine/godot-demo-projects">official Godot demo projects</a>
|
||||||
exported to HTML5 for testing purposes. These projects are deployed automatically
|
exported to the web for testing purposes. These projects are deployed automatically
|
||||||
on every commit on the <code>master</code> branch of the repository.
|
on every commit on the <code>master</code> branch of the repository.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
The HTML5 exports on this page are provided for demonstration purposes only.
|
The web exports on this page are provided for demonstration purposes only.
|
||||||
Some of these demos may not function or render correctly on HTML5,
|
Some of these demos may not function or render correctly on the web platform,
|
||||||
especially on mobile devices.
|
especially on mobile devices.
|
||||||
For best performance, it's recommended to
|
For best performance, it's recommended to
|
||||||
<a href="https://godotengine.org/download">download</a> a native editor
|
<a href="https://godotengine.org/download/">download</a> a native editor
|
||||||
and run the demo project by importing its files in the project manager.
|
and run the demo project by importing its files in the project manager.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
See the
|
See the
|
||||||
<a href="https://docs.godotengine.org/en/stable/getting_started/workflow/export/exporting_for_web.html">Exporting for the Web</a>
|
<a href="https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_web.html">Exporting for the Web</a>
|
||||||
documentation for information on exporting your own projects to HTML5.
|
documentation for information on exporting your own projects to the web.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>List of demos</h2>
|
<h2>List of demos</h2>
|
||||||
|
|||||||
28
.github/workflows/check_urls.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: 🌐 Check URLs
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-urls:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Restore lychee cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .lycheecache
|
||||||
|
key: cache-lychee-${{ github.sha }}
|
||||||
|
restore-keys: cache-lychee-
|
||||||
|
|
||||||
|
- name: Run lychee
|
||||||
|
uses: lycheeverse/lychee-action@v2
|
||||||
|
with:
|
||||||
|
args: >
|
||||||
|
--no-progress
|
||||||
|
--cache
|
||||||
|
--max-cache-age 1d
|
||||||
|
"**/*.md" "**/*.gd" "**/*.cs" "**/*.tscn" "**/*.tres" "**/*.html"
|
||||||
|
|
||||||
|
- name: Fail if there were link errors
|
||||||
|
run: exit ${{ steps.lc.outputs.exit_code }}
|
||||||
99
.github/workflows/export_html5.yml
vendored
@@ -1,99 +0,0 @@
|
|||||||
name: Export projects to HTML5 and deploy to GitHub Pages
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
env:
|
|
||||||
GODOT_VERSION: 3.2.3
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
export-html5:
|
|
||||||
name: Export projects to HTML5 and deploy to GitHub Pages
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
container:
|
|
||||||
image: barichello/godot-ci:3.2.3
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v2.3.4
|
|
||||||
|
|
||||||
- name: Setup
|
|
||||||
run: |
|
|
||||||
mkdir -p ~/.local/share/godot/templates/
|
|
||||||
mv /root/.local/share/godot/templates/$GODOT_VERSION.stable ~/.local/share/godot/templates/$GODOT_VERSION.stable
|
|
||||||
|
|
||||||
- name: Export projects to HTML5
|
|
||||||
run: |
|
|
||||||
apt-get update -qq && apt-get install -qqq imagemagick
|
|
||||||
|
|
||||||
# Don't export Mono demos (not supported yet), demos that can't be run in HTML5
|
|
||||||
# since they're platform-specific or demos that are currently broken in HTML5.
|
|
||||||
# Remember to update `.github/dist/footer.html` when updating the list of excluded demos.
|
|
||||||
rm -rf \
|
|
||||||
2d/hdr/ \
|
|
||||||
3d/voxel/ \
|
|
||||||
audio/device_changer/ \
|
|
||||||
loading/background_load/ \
|
|
||||||
loading/multiple_threads_loading/ \
|
|
||||||
loading/threads/ \
|
|
||||||
misc/matrix_transform/ \
|
|
||||||
mobile/android_iap/ \
|
|
||||||
mobile/sensors/ \
|
|
||||||
mono/ \
|
|
||||||
networking/ \
|
|
||||||
plugins/
|
|
||||||
|
|
||||||
for panorama in 3d/material_testers/backgrounds/*.hdr; do
|
|
||||||
# Decrease the resolution to get below the 20 MB per-file limit.
|
|
||||||
# Otherwise, the website can't be deployed as files larger than 20 MB
|
|
||||||
# can't be pushed to GitHub anymore.
|
|
||||||
mogrify -resize 75% "$panorama"
|
|
||||||
done
|
|
||||||
|
|
||||||
BASEDIR="$PWD"
|
|
||||||
|
|
||||||
# Use absolute paths so that we can `cd` without having to go back to the parent directory manually.
|
|
||||||
for demo in */*/; do
|
|
||||||
echo ""
|
|
||||||
echo "================================"
|
|
||||||
echo "Exporting demo $demo..."
|
|
||||||
echo "================================"
|
|
||||||
|
|
||||||
mkdir -p "$BASEDIR/.github/dist/$demo"
|
|
||||||
cd "$BASEDIR/$demo"
|
|
||||||
|
|
||||||
# Copy an export template preset file configured for HTML5 exporting.
|
|
||||||
# This way, we don't have to commit `export_presets.cfg` for each project.
|
|
||||||
cp "$BASEDIR/.github/dist/export_presets.cfg" .
|
|
||||||
godot --export "HTML5" "$BASEDIR/.github/dist/$demo/index.html"
|
|
||||||
|
|
||||||
# Replace the WASM file with a symbolic link to avoid duplicating files in the pushed branch.
|
|
||||||
# (WASM files are identical across projects, but not PCK or HTML files.)
|
|
||||||
mv -f "$BASEDIR/.github/dist/$demo/index.wasm" "$BASEDIR/.github/dist/index.wasm"
|
|
||||||
# The symlink must be relative as it needs to point to a file within the pushed repository.
|
|
||||||
ln -s "../../index.wasm" "$BASEDIR/.github/dist/$demo/index.wasm"
|
|
||||||
|
|
||||||
# Append the demo to the list of demos for the website.
|
|
||||||
PROJECT_NAME=$(cat project.godot | grep "config/name" | cut -d '"' -f 2 | tr -d "\n")
|
|
||||||
echo "<li><a href='$demo'><img width="64" height="64" src="$demo/favicon.png" alt=""><p>$PROJECT_NAME</p></a></li>" >> "$BASEDIR/.github/dist/demos.html"
|
|
||||||
done
|
|
||||||
|
|
||||||
cat "$BASEDIR/.github/dist/header.html" "$BASEDIR/.github/dist/demos.html" "$BASEDIR/.github/dist/footer.html" > "$BASEDIR/.github/dist/index.html"
|
|
||||||
|
|
||||||
# Clean up files that don't need to be deployed.
|
|
||||||
rm -f "$BASEDIR/.github/dist/header.html" "$BASEDIR/.github/dist/demos.html" "$BASEDIR/.github/dist/footer.html" "$BASEDIR/.github/dist/export_presets.cfg"
|
|
||||||
|
|
||||||
# Installing rsync is needed in order to deploy to GitHub Pages. Without it, the build will fail.
|
|
||||||
- name: Install rsync 📚
|
|
||||||
run: |
|
|
||||||
apt-get update -qq && apt-get install -qqq rsync
|
|
||||||
- name: Deploy to GitHub Pages 🚀
|
|
||||||
uses: JamesIves/github-pages-deploy-action@releases/v3
|
|
||||||
with:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
# The branch the action should deploy to.
|
|
||||||
BRANCH: gh-pages
|
|
||||||
# The folder the action should deploy.
|
|
||||||
FOLDER: .github/dist
|
|
||||||
# Artifacts are large; don't keep the branch's history.
|
|
||||||
SINGLE_COMMIT: true
|
|
||||||
128
.github/workflows/export_web.yml
vendored
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
name: Export projects to Web and deploy to GitHub Pages
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
env:
|
||||||
|
GODOT_VERSION: 4.5.1
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
export-html5:
|
||||||
|
if: github.repository == 'godotengine/godot-demo-projects'
|
||||||
|
name: Export projects to Web and deploy to GitHub Pages
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
container:
|
||||||
|
image: barichello/godot-ci:4.5.1
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Setup
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.local/share/godot/export_templates/
|
||||||
|
mv /root/.local/share/godot/export_templates/$GODOT_VERSION.stable ~/.local/share/godot/export_templates/$GODOT_VERSION.stable
|
||||||
|
|
||||||
|
- name: Export projects to Web
|
||||||
|
run: |
|
||||||
|
apt-get update -qq && apt-get install -qqq imagemagick
|
||||||
|
|
||||||
|
# Don't export Mono demos (not supported yet), demos that can't be run in Web
|
||||||
|
# since they're platform-specific or demos that are currently broken in Web.
|
||||||
|
# Remember to update `.github/dist/footer.html` when updating the list of excluded demos.
|
||||||
|
rm -rf \
|
||||||
|
2d/glow/ \
|
||||||
|
2d/navigation_mesh_chunks/ \
|
||||||
|
2d/physics_tests/ \
|
||||||
|
3d/labels_and_texts/ \
|
||||||
|
3d/decals/ \
|
||||||
|
3d/ik/ \
|
||||||
|
3d/navigation_mesh_chunks/ \
|
||||||
|
3d/occlusion_culling_mesh_lod/ \
|
||||||
|
3d/particles/ \
|
||||||
|
3d/physical_light_camera_units/ \
|
||||||
|
3d/physics_tests/ \
|
||||||
|
3d/variable_rate_shading/ \
|
||||||
|
3d/volumetric_fog/ \
|
||||||
|
3d/voxel/ \
|
||||||
|
audio/bpm_sync/ \
|
||||||
|
audio/device_changer/ \
|
||||||
|
audio/midi_piano/ \
|
||||||
|
audio/spectrum/ \
|
||||||
|
compute/ \
|
||||||
|
gui/msdf_font/ \
|
||||||
|
gui/translation/ \
|
||||||
|
loading/runtime_save_load \
|
||||||
|
misc/compute_shader_heightmap \
|
||||||
|
misc/large_world_coordinates/ \
|
||||||
|
misc/matrix_transform/ \
|
||||||
|
mobile/android_iap/ \
|
||||||
|
mobile/sensors/ \
|
||||||
|
mono/ \
|
||||||
|
networking/ \
|
||||||
|
plugins/ \
|
||||||
|
xr/openxr_character_centric_movement \
|
||||||
|
xr/openxr_composition_layers \
|
||||||
|
xr/openxr_hand_tracking_demo \
|
||||||
|
xr/openxr_origin_centric_movement
|
||||||
|
|
||||||
|
for panorama in 3d/material_testers/backgrounds/*.hdr; do
|
||||||
|
# Decrease the resolution to get below the 100 MB PCK size limit.
|
||||||
|
# Otherwise, the website can't be deployed as files larger than 100 MB
|
||||||
|
# can't be pushed to GitHub.
|
||||||
|
mogrify -resize 66.667% "$panorama"
|
||||||
|
done
|
||||||
|
|
||||||
|
BASEDIR="$PWD"
|
||||||
|
|
||||||
|
# Use absolute paths so that we can `cd` without having to go back to the parent directory manually.
|
||||||
|
for demo in */*/; do
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
echo "================================================================================"
|
||||||
|
echo "Exporting demo $demo..."
|
||||||
|
echo "================================================================================"
|
||||||
|
|
||||||
|
mkdir -p "$BASEDIR/.github/dist/$demo"
|
||||||
|
cd "$BASEDIR/$demo"
|
||||||
|
|
||||||
|
# Copy an export template preset file configured for Web exporting.
|
||||||
|
# This way, we don't have to commit `export_presets.cfg` for each project.
|
||||||
|
cp "$BASEDIR/.github/dist/export_presets.cfg" .
|
||||||
|
# Enable ETC2 texture importing, which is disabled by default (but required for web exports to work on mobile platforms).
|
||||||
|
echo "[rendering]\n\ntextures/vram_compression/import_etc2_astc=true" >> project.godot
|
||||||
|
|
||||||
|
# Enable WebXR Polyfill and WebXR Layers Polyfill for the WebXR demo.
|
||||||
|
if [ "$demo" == "xr/webxr/" ]; then
|
||||||
|
sed -i 's~^html/head_include=""$~html/head_include="<script src=\\"https://cdn.jsdelivr.net/npm/webxr-polyfill@latest/build/webxr-polyfill.min.js\\"></script>\n<script>\nvar polyfill = new WebXRPolyfill();\n</script>\n<script src=\\"https://cdn.jsdelivr.net/npm/webxr-layers-polyfill@latest/build/webxr-layers-polyfill.min.js\\"></script>\n<script>\nvar layersPolyfill = new WebXRLayersPolyfill();\n</script>"~g' export_presets.cfg
|
||||||
|
fi
|
||||||
|
|
||||||
|
godot --verbose --headless --export-release "Web" "$BASEDIR/.github/dist/$demo/index.html"
|
||||||
|
|
||||||
|
# Replace the WASM file with a symbolic link to avoid duplicating files in the pushed branch.
|
||||||
|
# (WASM files are identical across projects, but not PCK or HTML/JavaScript files.)
|
||||||
|
mv -f "$BASEDIR/.github/dist/$demo/index.wasm" "$BASEDIR/.github/dist/index.wasm"
|
||||||
|
# The symlink must be relative as it needs to point to a file within the pushed repository.
|
||||||
|
ln -s "../../index.wasm" "$BASEDIR/.github/dist/$demo/index.wasm"
|
||||||
|
|
||||||
|
# Append the demo to the list of demos for the website.
|
||||||
|
PROJECT_NAME=$(cat project.godot | grep "config/name" | cut -d '"' -f 2 | tr -d "\n")
|
||||||
|
echo "<li><a href='$demo'><img width="64" height="64" src="$demo/index.icon.png" alt=""><p>$PROJECT_NAME</p></a></li>" >> "$BASEDIR/.github/dist/demos.html"
|
||||||
|
done
|
||||||
|
|
||||||
|
cat "$BASEDIR/.github/dist/header.html" "$BASEDIR/.github/dist/demos.html" "$BASEDIR/.github/dist/footer.html" > "$BASEDIR/.github/dist/index.html"
|
||||||
|
|
||||||
|
# Clean up files that don't need to be deployed.
|
||||||
|
rm -f "$BASEDIR/.github/dist/header.html" "$BASEDIR/.github/dist/demos.html" "$BASEDIR/.github/dist/footer.html" "$BASEDIR/.github/dist/export_presets.cfg"
|
||||||
|
|
||||||
|
# Installing rsync is needed in order to deploy to GitHub Pages. Without it, the build will fail.
|
||||||
|
- name: Install rsync 📚
|
||||||
|
run: |
|
||||||
|
apt-get update -qq && apt-get install -qqq rsync
|
||||||
|
- name: Deploy to GitHub Pages 🚀
|
||||||
|
uses: JamesIves/github-pages-deploy-action@releases/v4
|
||||||
|
with:
|
||||||
|
# The folder the action should deploy.
|
||||||
|
folder: .github/dist
|
||||||
|
# Artifacts are large; don't keep the branch's history.
|
||||||
|
single-commit: true
|
||||||
4
.github/workflows/static_checks.yml
vendored
@@ -4,10 +4,10 @@ on: [push, pull_request]
|
|||||||
jobs:
|
jobs:
|
||||||
format:
|
format:
|
||||||
name: File formatting (file_format.sh)
|
name: File formatting (file_format.sh)
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
8
.gitignore
vendored
@@ -18,4 +18,12 @@ mono_crash.*.json
|
|||||||
|
|
||||||
# System/tool-specific ignores
|
# System/tool-specific ignores
|
||||||
.directory
|
.directory
|
||||||
|
.DS_Store
|
||||||
*~
|
*~
|
||||||
|
*.blend1
|
||||||
|
|
||||||
|
# Jetbrains IDE files
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Ignore addon plugins
|
||||||
|
3d/sprite3d/addons
|
||||||
|
|||||||
31
.lycheeignore
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
# Don't read Godot's own URL schemes as web URLs.
|
||||||
|
user:\/\/.*
|
||||||
|
res:\/\/.*
|
||||||
|
uid:\/\/.*
|
||||||
|
|
||||||
|
# Don't read WebSockets or TCP URLs as web URLs.
|
||||||
|
ws(s?):\/\/.*
|
||||||
|
tcp:\/\/.*
|
||||||
|
|
||||||
|
# Security checks prevent checking the URLs of these websites automatically,
|
||||||
|
# typically returning 403 errors.
|
||||||
|
.*asecuritysite\.com.*
|
||||||
|
.*intel\.com.*
|
||||||
|
.*reddit\.com.*
|
||||||
|
|
||||||
|
# Don't check URLs from these websites due to frequent rate limits (error 429) or timeouts.
|
||||||
|
.*adobe\.com.*
|
||||||
|
.*gamedevartisan\.com.*
|
||||||
|
.*github\.com.*
|
||||||
|
.*gnu\.org.*
|
||||||
|
.*loopit\.dk.*
|
||||||
|
.*meta\.com.*
|
||||||
|
.*shadertoy\.com.*
|
||||||
|
.*sourceforge\.io.*
|
||||||
|
|
||||||
|
# Not a valid URL with the GET method, which lychee always sends.
|
||||||
|
# Mentioned in the class reference.
|
||||||
|
.*httpbin\.org\/post
|
||||||
|
|
||||||
|
# Class reference mentions `example.com/index.php` in an example, which is 404.
|
||||||
|
.*example\.com.*
|
||||||
@@ -3,6 +3,6 @@
|
|||||||
These demos are all 2D, but otherwise do not have a common theme.
|
These demos are all 2D, but otherwise do not have a common theme.
|
||||||
|
|
||||||
Languages: Most have GDScript, some have
|
Languages: Most have GDScript, some have
|
||||||
[GDSL](https://docs.godotengine.org/en/latest/tutorials/shaders/shader_reference/shading_language.html)
|
[Godot shader language](https://docs.godotengine.org/en/latest/tutorials/shaders/shader_reference/shading_language.html)
|
||||||
|
|
||||||
Renderers: 6 of them are GLES 3, but most are GLES 2
|
Renderers: Glow for 2D and Physics Platformer use Forward+, 2D Particles uses Mobile, and the rest use Compatibility
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ in the documentation for more information.
|
|||||||
|
|
||||||
Language: GDScript
|
Language: GDScript
|
||||||
|
|
||||||
Renderer: GLES 2
|
Renderer: Compatibility
|
||||||
|
|
||||||
|
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2711
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/bullet.png-ff1424653e10246c11e3724e402c519e.stex"
|
uid="uid://b1yd0wl8kt2i7"
|
||||||
|
path="res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://bullet.png"
|
source_file="res://bullet.png"
|
||||||
dest_files=[ "res://.import/bullet.png-ff1424653e10246c11e3724e402c519e.stex" ]
|
dest_files=["res://.godot/imported/bullet.png-ff1424653e10246c11e3724e402c519e.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=true
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
# This demo is an example of controling a high number of 2D objects with logic
|
# This demo is an example of controlling a high number of 2D objects with logic
|
||||||
# and collision without using nodes in the scene. This technique is a lot more
|
# and collision without using nodes in the scene. This technique is a lot more
|
||||||
# efficient than using instancing and nodes, but requires more programming and
|
# efficient than using instancing and nodes, but requires more programming and
|
||||||
# is less visual. Bullets are managed together in the `bullets.gd` script.
|
# is less visual. Bullets are managed together in the `bullets.gd` script.
|
||||||
@@ -8,79 +8,81 @@ const BULLET_COUNT = 500
|
|||||||
const SPEED_MIN = 20
|
const SPEED_MIN = 20
|
||||||
const SPEED_MAX = 80
|
const SPEED_MAX = 80
|
||||||
|
|
||||||
const bullet_image = preload("res://bullet.png")
|
const bullet_image := preload("res://bullet.png")
|
||||||
|
|
||||||
var bullets = []
|
var bullets := []
|
||||||
var shape
|
var shape := RID()
|
||||||
|
|
||||||
|
|
||||||
class Bullet:
|
class Bullet:
|
||||||
var position = Vector2()
|
var position := Vector2()
|
||||||
var speed = 1.0
|
var speed := 1.0
|
||||||
# The body is stored as a RID, which is an "opaque" way to access resources.
|
# The body is stored as an RID, which is an "opaque" way to access resources.
|
||||||
# With large amounts of objects (thousands or more), it can be significantly
|
# With large amounts of objects (thousands or more), it can be significantly
|
||||||
# faster to use RIDs compared to a high-level approach.
|
# faster to use RIDs compared to a high-level approach.
|
||||||
var body = RID()
|
var body := RID()
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready() -> void:
|
||||||
randomize()
|
shape = PhysicsServer2D.circle_shape_create()
|
||||||
|
|
||||||
shape = Physics2DServer.circle_shape_create()
|
|
||||||
# Set the collision shape's radius for each bullet in pixels.
|
# Set the collision shape's radius for each bullet in pixels.
|
||||||
Physics2DServer.shape_set_data(shape, 8)
|
PhysicsServer2D.shape_set_data(shape, 8)
|
||||||
|
|
||||||
for _i in BULLET_COUNT:
|
for _i in BULLET_COUNT:
|
||||||
var bullet = Bullet.new()
|
var bullet := Bullet.new()
|
||||||
# Give each bullet its own speed.
|
# Give each bullet its own random speed.
|
||||||
bullet.speed = rand_range(SPEED_MIN, SPEED_MAX)
|
bullet.speed = randf_range(SPEED_MIN, SPEED_MAX)
|
||||||
bullet.body = Physics2DServer.body_create()
|
bullet.body = PhysicsServer2D.body_create()
|
||||||
|
|
||||||
Physics2DServer.body_set_space(bullet.body, get_world_2d().get_space())
|
PhysicsServer2D.body_set_space(bullet.body, get_world_2d().get_space())
|
||||||
Physics2DServer.body_add_shape(bullet.body, shape)
|
PhysicsServer2D.body_add_shape(bullet.body, shape)
|
||||||
|
# Don't make bullets check collision with other bullets to improve performance.
|
||||||
|
PhysicsServer2D.body_set_collision_mask(bullet.body, 0)
|
||||||
|
|
||||||
# Place bullets randomly on the viewport and move bullets outside the
|
# Place bullets randomly on the viewport and move bullets outside the
|
||||||
# play area so that they fade in nicely.
|
# play area so that they fade in nicely.
|
||||||
bullet.position = Vector2(
|
bullet.position = Vector2(
|
||||||
rand_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,
|
randf_range(0, get_viewport_rect().size.x) + get_viewport_rect().size.x,
|
||||||
rand_range(0, get_viewport_rect().size.y)
|
randf_range(0, get_viewport_rect().size.y)
|
||||||
)
|
)
|
||||||
var transform2d = Transform2D()
|
var transform2d := Transform2D()
|
||||||
transform2d.origin = bullet.position
|
transform2d.origin = bullet.position
|
||||||
Physics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)
|
PhysicsServer2D.body_set_state(bullet.body, PhysicsServer2D.BODY_STATE_TRANSFORM, transform2d)
|
||||||
|
|
||||||
bullets.push_back(bullet)
|
bullets.push_back(bullet)
|
||||||
|
|
||||||
|
|
||||||
func _process(delta):
|
func _process(_delta: float) -> void:
|
||||||
var transform2d = Transform2D()
|
# Order the CanvasItem to update every frame.
|
||||||
for bullet in bullets:
|
queue_redraw()
|
||||||
|
|
||||||
|
|
||||||
|
func _physics_process(delta: float) -> void:
|
||||||
|
var transform2d := Transform2D()
|
||||||
|
var offset := get_viewport_rect().size.x + 16
|
||||||
|
for bullet: Bullet in bullets:
|
||||||
bullet.position.x -= bullet.speed * delta
|
bullet.position.x -= bullet.speed * delta
|
||||||
|
|
||||||
if bullet.position.x < -16:
|
if bullet.position.x < -16:
|
||||||
# The bullet has left the screen; move it back to the right.
|
# Move the bullet back to the right when it left the screen.
|
||||||
bullet.position.x = get_viewport_rect().size.x + 16
|
bullet.position.x = offset
|
||||||
|
|
||||||
transform2d.origin = bullet.position
|
transform2d.origin = bullet.position
|
||||||
|
PhysicsServer2D.body_set_state(bullet.body, PhysicsServer2D.BODY_STATE_TRANSFORM, transform2d)
|
||||||
Physics2DServer.body_set_state(bullet.body, Physics2DServer.BODY_STATE_TRANSFORM, transform2d)
|
|
||||||
|
|
||||||
# Order the CanvasItem to update since bullets are moving every frame.
|
|
||||||
update()
|
|
||||||
|
|
||||||
|
|
||||||
# Instead of drawing each bullet individually in a script attached to each bullet,
|
# Instead of drawing each bullet individually in a script attached to each bullet,
|
||||||
# we are drawing *all* the bullets at once here.
|
# we are drawing *all* the bullets at once here.
|
||||||
func _draw():
|
func _draw() -> void:
|
||||||
var offset = -bullet_image.get_size() * 0.5
|
var offset := -bullet_image.get_size() * 0.5
|
||||||
for bullet in bullets:
|
for bullet: Bullet in bullets:
|
||||||
draw_texture(bullet_image, bullet.position + offset)
|
draw_texture(bullet_image, bullet.position + offset)
|
||||||
|
|
||||||
|
|
||||||
# Perform cleanup operations (required to exit without error messages in the console).
|
# Perform cleanup operations (required to exit without error messages in the console).
|
||||||
func _exit_tree():
|
func _exit_tree() -> void:
|
||||||
for bullet in bullets:
|
for bullet: Bullet in bullets:
|
||||||
Physics2DServer.free_rid(bullet.body)
|
PhysicsServer2D.free_rid(bullet.body)
|
||||||
|
|
||||||
Physics2DServer.free_rid(shape)
|
PhysicsServer2D.free_rid(shape)
|
||||||
bullets.clear()
|
bullets.clear()
|
||||||
|
|||||||
1
2d/bullet_shower/bullets.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://e3fsq0i746o1
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/face_happy.png-38d387d31ec13459f749c93ce3d75d80.stex"
|
uid="uid://c33jd3nwdqtb4"
|
||||||
|
path="res://.godot/imported/face_happy.png-38d387d31ec13459f749c93ce3d75d80.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://face_happy.png"
|
source_file="res://face_happy.png"
|
||||||
dest_files=[ "res://.import/face_happy.png-38d387d31ec13459f749c93ce3d75d80.stex" ]
|
dest_files=["res://.godot/imported/face_happy.png-38d387d31ec13459f749c93ce3d75d80.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=true
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/face_sad.png-0ac7165eab24f595aba17a746a66c550.stex"
|
uid="uid://b63ok8dbyysfs"
|
||||||
|
path="res://.godot/imported/face_sad.png-0ac7165eab24f595aba17a746a66c550.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://face_sad.png"
|
source_file="res://face_sad.png"
|
||||||
dest_files=[ "res://.import/face_sad.png-0ac7165eab24f595aba17a746a66c550.stex" ]
|
dest_files=["res://.godot/imported/face_sad.png-0ac7165eab24f595aba17a746a66c550.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=true
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.9 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="StreamTexture"
|
|
||||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://icon.png"
|
|
||||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.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
|
|
||||||
BIN
2d/bullet_shower/icon.webp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
40
2d/bullet_shower/icon.webp.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://44incao8gryo"
|
||||||
|
path="res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.webp"
|
||||||
|
dest_files=["res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
@@ -1,33 +1,37 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
# This demo is an example of controling a high number of 2D objects with logic
|
# This demo is an example of controlling a high number of 2D objects with logic
|
||||||
# and collision without using nodes in the scene. This technique is a lot more
|
# and collision without using nodes in the scene. This technique is a lot more
|
||||||
# efficient than using instancing and nodes, but requires more programming and
|
# efficient than using instancing and nodes, but requires more programming and
|
||||||
# is less visual. Bullets are managed together in the `bullets.gd` script.
|
# is less visual. Bullets are managed together in the `bullets.gd` script.
|
||||||
|
|
||||||
# The number of bullets currently touched by the player.
|
## The number of bullets currently touched by the player.
|
||||||
var touching = 0
|
var touching: int = 0
|
||||||
|
|
||||||
onready var sprite = $AnimatedSprite
|
@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
func _ready() -> void:
|
||||||
# The player follows the mouse cursor automatically, so there's no point
|
# The player follows the mouse cursor automatically, so there's no point
|
||||||
# in displaying the mouse cursor.
|
# in displaying the mouse cursor.
|
||||||
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
|
||||||
|
|
||||||
|
|
||||||
func _input(event):
|
func _input(input_event: InputEvent) -> void:
|
||||||
if event is InputEventMouseMotion:
|
# Getting the movement of the mouse so the sprite can follow its position.
|
||||||
position = event.position - Vector2(0, 16)
|
if input_event is InputEventMouseMotion:
|
||||||
|
position = input_event.position - Vector2(0, 16)
|
||||||
|
|
||||||
|
|
||||||
func _on_body_shape_entered(_body_id, _body, _body_shape, _local_shape):
|
func _on_body_shape_entered(_body_id: RID, _body: Node2D, _body_shape_index: int, _local_shape_index: int) -> void:
|
||||||
|
# Player got touched by a bullet so sprite changes to sad face.
|
||||||
touching += 1
|
touching += 1
|
||||||
if touching >= 1:
|
if touching >= 1:
|
||||||
sprite.frame = 1
|
sprite.frame = 1
|
||||||
|
|
||||||
|
|
||||||
func _on_body_shape_exited(_body_id, _body, _body_shape, _local_shape):
|
func _on_body_shape_exited(_body_id: RID, _body: Node2D, _body_shape_index: int, _local_shape_index: int) -> void:
|
||||||
touching -= 1
|
touching -= 1
|
||||||
|
# When non of the bullets are touching the player,
|
||||||
|
# sprite changes to happy face.
|
||||||
if touching == 0:
|
if touching == 0:
|
||||||
sprite.frame = 0
|
sprite.frame = 0
|
||||||
|
|||||||
1
2d/bullet_shower/player.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://eu1k1ulu68o2
|
||||||
@@ -6,36 +6,31 @@
|
|||||||
; [section] ; section goes between []
|
; [section] ; section goes between []
|
||||||
; param=value ; assign values to parameters
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
config_version=4
|
config_version=5
|
||||||
|
|
||||||
_global_script_classes=[ ]
|
|
||||||
_global_script_class_icons={
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
config/name="Bullet Shower"
|
config/name="Bullet Shower"
|
||||||
config/description="Demonstrates how to manage large amounts of objects efficiently using low-level Servers."
|
config/description="Demonstrates how to manage large amounts of objects efficiently using low-level Servers."
|
||||||
|
config/tags=PackedStringArray("2d", "demo", "official", "performance")
|
||||||
run/main_scene="res://shower.tscn"
|
run/main_scene="res://shower.tscn"
|
||||||
config/icon="res://icon.png"
|
config/features=PackedStringArray("4.5")
|
||||||
|
config/icon="res://icon.webp"
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
|
||||||
|
gdscript/warnings/untyped_declaration=1
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/dpi/allow_hidpi=true
|
window/stretch/mode="canvas_items"
|
||||||
window/stretch/mode="2d"
|
|
||||||
window/stretch/aspect="expand"
|
window/stretch/aspect="expand"
|
||||||
|
|
||||||
[physics]
|
[layer_names]
|
||||||
|
|
||||||
2d/cell_size=64
|
2d_physics/layer_1="Player"
|
||||||
common/enable_pause_aware_picking=true
|
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
quality/driver/driver_name="GLES2"
|
renderer/rendering_method="gl_compatibility"
|
||||||
quality/intended_usage/framebuffer_allocation=0
|
renderer/rendering_method.mobile="gl_compatibility"
|
||||||
quality/intended_usage/framebuffer_allocation.mobile=0
|
|
||||||
vram_compression/import_etc=true
|
|
||||||
vram_compression/import_etc2=false
|
|
||||||
environment/default_clear_color=Color( 0.133333, 0.133333, 0.2, 1 )
|
|
||||||
|
|||||||
@@ -1,33 +1,40 @@
|
|||||||
[gd_scene load_steps=7 format=2]
|
[gd_scene load_steps=7 format=3 uid="uid://dxq1b4cth265d"]
|
||||||
|
|
||||||
[ext_resource path="res://bullets.gd" type="Script" id=2]
|
[ext_resource type="Script" uid="uid://e3fsq0i746o1" path="res://bullets.gd" id="2"]
|
||||||
[ext_resource path="res://face_happy.png" type="Texture" id=3]
|
[ext_resource type="Texture2D" uid="uid://c33jd3nwdqtb4" path="res://face_happy.png" id="3"]
|
||||||
[ext_resource path="res://face_sad.png" type="Texture" id=4]
|
[ext_resource type="Texture2D" uid="uid://b63ok8dbyysfs" path="res://face_sad.png" id="4"]
|
||||||
[ext_resource path="res://player.gd" type="Script" id=5]
|
[ext_resource type="Script" uid="uid://eu1k1ulu68o2" path="res://player.gd" id="5"]
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=1]
|
[sub_resource type="SpriteFrames" id="1"]
|
||||||
animations = [ {
|
animations = [{
|
||||||
"frames": [ ExtResource( 3 ), ExtResource( 4 ) ],
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("3")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4")
|
||||||
|
}],
|
||||||
"loop": true,
|
"loop": true,
|
||||||
"name": "default",
|
"name": &"default",
|
||||||
"speed": 5.0
|
"speed": 5.0
|
||||||
} ]
|
}]
|
||||||
|
|
||||||
[sub_resource type="CircleShape2D" id=2]
|
[sub_resource type="CircleShape2D" id="2"]
|
||||||
radius = 27.0
|
radius = 27.0
|
||||||
|
|
||||||
[node name="Shower" type="Node2D"]
|
[node name="Shower" type="Node2D"]
|
||||||
|
|
||||||
[node name="Bullets" type="Node2D" parent="."]
|
[node name="Bullets" type="Node2D" parent="."]
|
||||||
script = ExtResource( 2 )
|
script = ExtResource("2")
|
||||||
|
|
||||||
[node name="Player" type="Area2D" parent="."]
|
[node name="Player" type="Area2D" parent="."]
|
||||||
script = ExtResource( 5 )
|
script = ExtResource("5")
|
||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="Player"]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="Player"]
|
||||||
frames = SubResource( 1 )
|
sprite_frames = SubResource("1")
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Player"]
|
||||||
shape = SubResource( 2 )
|
shape = SubResource("2")
|
||||||
|
|
||||||
[connection signal="body_shape_entered" from="Player" to="Player" method="_on_body_shape_entered"]
|
[connection signal="body_shape_entered" from="Player" to="Player" method="_on_body_shape_entered"]
|
||||||
[connection signal="body_shape_exited" from="Player" to="Player" method="_on_body_shape_exited"]
|
[connection signal="body_shape_exited" from="Player" to="Player" method="_on_body_shape_exited"]
|
||||||
|
|||||||
23
2d/custom_drawing/README.md
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
# Custom drawing in 2D
|
||||||
|
|
||||||
|
A demo showing how to draw 2D elements in Godot without using nodes. This can be done
|
||||||
|
to create procedural graphics, perform debug drawing to help troubleshoot issues in
|
||||||
|
game logic, or to improve performance by not creating a node for every visible element.
|
||||||
|
|
||||||
|
Antialiasing can be performed using two approaches: either by enabling the `antialiasing`
|
||||||
|
parameter provided by some of the CanvasItem `draw_*` methods, or by enabling 2D MSAA
|
||||||
|
in the Project Settings. 2D MSAA is generally slower, but it works with any kind of line-based
|
||||||
|
or polygon-based 2D drawing, even for `draw_*` methods that don't support an `antialiasing`
|
||||||
|
parameter. Note that 2D MSAA is only available in the Forward+ and Mobile
|
||||||
|
renderers, not Compatibility.
|
||||||
|
|
||||||
|
See [Custom drawing in 2D](https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html)
|
||||||
|
in the documentation for more information.
|
||||||
|
|
||||||
|
Language: GDScript
|
||||||
|
|
||||||
|
Renderer: Mobile
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|

|
||||||
43
2d/custom_drawing/animation.gd
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
|
||||||
|
@tool
|
||||||
|
extends Panel
|
||||||
|
|
||||||
|
var use_antialiasing: bool = false
|
||||||
|
|
||||||
|
var time := 0.0
|
||||||
|
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
# Increment a counter variable that we use in `_draw()`.
|
||||||
|
time += delta
|
||||||
|
# Force redrawing on every processed frame, so that the animation can visibly progress.
|
||||||
|
# Only do this when the node is visible in tree, so that we don't force continuous redrawing
|
||||||
|
# when not needed (low-processor usage mode is enabled in this demo).
|
||||||
|
if is_visible_in_tree():
|
||||||
|
queue_redraw()
|
||||||
|
|
||||||
|
|
||||||
|
func _draw() -> void:
|
||||||
|
var margin := Vector2(240, 70)
|
||||||
|
var offset := Vector2()
|
||||||
|
|
||||||
|
# Line width of `-1.0` is only usable with draw antialiasing disabled,
|
||||||
|
# as it uses hardware line drawing as opposed to polygon-based line drawing.
|
||||||
|
# Automatically use polygon-based line drawing when needed to avoid runtime warnings.
|
||||||
|
# We also use a line width of `0.5` instead of `1.0` to better match the appearance
|
||||||
|
# of non-antialiased line drawing, as draw antialiasing tends to make lines look thicker.
|
||||||
|
var line_width_thin := 0.5 if use_antialiasing else -1.0
|
||||||
|
|
||||||
|
# Draw an animated arc to simulate a circular progress bar.
|
||||||
|
# The start angle is set so the arc starts from the top.
|
||||||
|
const POINT_COUNT = 48
|
||||||
|
var progress := wrapf(time, 0.0, 1.0)
|
||||||
|
draw_arc(
|
||||||
|
margin + offset,
|
||||||
|
50.0,
|
||||||
|
0.75 * TAU,
|
||||||
|
(0.75 + progress) * TAU,
|
||||||
|
POINT_COUNT,
|
||||||
|
Color.MEDIUM_AQUAMARINE,
|
||||||
|
line_width_thin,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
1
2d/custom_drawing/animation.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://m1872t0qa0i4
|
||||||
38
2d/custom_drawing/animation_slice.gd
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
|
||||||
|
var use_antialiasing: bool = false
|
||||||
|
|
||||||
|
|
||||||
|
func _draw() -> void:
|
||||||
|
var margin := Vector2(240, 70)
|
||||||
|
var offset := Vector2(0, 150)
|
||||||
|
# This is an example of using draw commands to create animations.
|
||||||
|
# For "continuous" animations, you can use a timer within `_draw()` and call `queue_redraw()`
|
||||||
|
# in `_process()` to redraw every frame.
|
||||||
|
# Animation length in seconds. The animation will loop after the specified duration.
|
||||||
|
const ANIMATION_LENGTH = 2.0
|
||||||
|
# 5 frames per second.
|
||||||
|
const ANIMATION_FRAMES = 10
|
||||||
|
|
||||||
|
# Declare an animation frame with randomized rotation and color for each frame.
|
||||||
|
# `draw_animation_slice()` makes it so the following draw commands are only visible
|
||||||
|
# on screen when the current time is within the animation slice.
|
||||||
|
# NOTE: Pause does not affect animations drawn by `draw_animation_slice()`
|
||||||
|
# (they will keep playing).
|
||||||
|
for frame in ANIMATION_FRAMES:
|
||||||
|
# `remap()` is useful to determine the time slice in which a frame is visible.
|
||||||
|
# For example, on the 2nd frame, `slice_begin` is `0.2` and `slice_end` is `0.4`.
|
||||||
|
var slice_begin := remap(frame, 0, ANIMATION_FRAMES, 0, ANIMATION_LENGTH)
|
||||||
|
var slice_end := remap(frame + 1, 0, ANIMATION_FRAMES, 0, ANIMATION_LENGTH)
|
||||||
|
draw_animation_slice(ANIMATION_LENGTH, slice_begin, slice_end)
|
||||||
|
draw_set_transform(margin + offset, deg_to_rad(randf_range(-5.0, 5.0)))
|
||||||
|
draw_rect(
|
||||||
|
Rect2(Vector2(), Vector2(100, 50)),
|
||||||
|
Color.from_hsv(randf(), 0.4, 1.0),
|
||||||
|
true,
|
||||||
|
-1.0,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
|
||||||
|
draw_end_animation()
|
||||||
1
2d/custom_drawing/animation_slice.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dxbst4jd731sx
|
||||||
14
2d/custom_drawing/custom_drawing.gd
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
extends Control
|
||||||
|
|
||||||
|
|
||||||
|
func _on_msaa_2d_item_selected(index: int) -> void:
|
||||||
|
get_viewport().msaa_2d = index as Viewport.MSAA
|
||||||
|
|
||||||
|
|
||||||
|
func _on_draw_antialiasing_toggled(toggled_on: bool) -> void:
|
||||||
|
var nodes: Array[Node] = %TabContainer.get_children()
|
||||||
|
nodes.push_back(%AnimationSlice)
|
||||||
|
for tab: Control in nodes:
|
||||||
|
tab.use_antialiasing = toggled_on
|
||||||
|
# Force all tabs to redraw so that the antialiasing updates.
|
||||||
|
tab.queue_redraw()
|
||||||
1
2d/custom_drawing/custom_drawing.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://k86266poffsc
|
||||||
272
2d/custom_drawing/custom_drawing.tscn
Normal file
@@ -0,0 +1,272 @@
|
|||||||
|
[gd_scene load_steps=10 format=3 uid="uid://e3ko2k5vfsph"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://k86266poffsc" path="res://custom_drawing.gd" id="1_rtndo"]
|
||||||
|
[ext_resource type="Script" uid="uid://bs2i4k2suatwx" path="res://lines.gd" id="2_exx0l"]
|
||||||
|
[ext_resource type="Script" uid="uid://kr0artw8tmec" path="res://rectangles.gd" id="3_yrx86"]
|
||||||
|
[ext_resource type="Script" uid="uid://bavbrayrl4aqv" path="res://polygons.gd" id="4_obj11"]
|
||||||
|
[ext_resource type="Script" uid="uid://dmgkvc33ohsn1" path="res://textures.gd" id="5_84cac"]
|
||||||
|
[ext_resource type="Script" uid="uid://cmgvk2l7icywj" path="res://meshes.gd" id="5_exx0l"]
|
||||||
|
[ext_resource type="Script" uid="uid://by5ufa6o3liw" path="res://text.gd" id="6_4w081"]
|
||||||
|
[ext_resource type="Script" uid="uid://m1872t0qa0i4" path="res://animation.gd" id="8_yrx86"]
|
||||||
|
[ext_resource type="Script" uid="uid://dxbst4jd731sx" path="res://animation_slice.gd" id="9_obj11"]
|
||||||
|
|
||||||
|
[node name="CustomDrawing" type="Control"]
|
||||||
|
layout_mode = 3
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("1_rtndo")
|
||||||
|
|
||||||
|
[node name="TabContainer" type="TabContainer" parent="."]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
current_tab = 0
|
||||||
|
|
||||||
|
[node name="Lines" type="Panel" parent="TabContainer"]
|
||||||
|
layout_mode = 2
|
||||||
|
script = ExtResource("2_exx0l")
|
||||||
|
metadata/_tab_index = 0
|
||||||
|
|
||||||
|
[node name="DrawLine" type="Label" parent="TabContainer/Lines"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 172.0
|
||||||
|
offset_bottom = 97.0
|
||||||
|
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
text = "draw_line()
|
||||||
|
draw_dashed_line()"
|
||||||
|
|
||||||
|
[node name="DrawCircle" type="Label" parent="TabContainer/Lines"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 154.0
|
||||||
|
offset_right = 122.0
|
||||||
|
offset_bottom = 177.0
|
||||||
|
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
text = "draw_circle()"
|
||||||
|
|
||||||
|
[node name="DrawArc" type="Label" parent="TabContainer/Lines"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 264.0
|
||||||
|
offset_right = 109.0
|
||||||
|
offset_bottom = 287.0
|
||||||
|
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
text = "draw_arc()"
|
||||||
|
|
||||||
|
[node name="Rectangles" type="Panel" parent="TabContainer"]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 2
|
||||||
|
script = ExtResource("3_yrx86")
|
||||||
|
metadata/_tab_index = 1
|
||||||
|
|
||||||
|
[node name="DrawRect" type="Label" parent="TabContainer/Rectangles"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 109.0
|
||||||
|
offset_bottom = 71.0
|
||||||
|
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
text = "draw_rect()"
|
||||||
|
|
||||||
|
[node name="DrawStyleBox" type="Label" parent="TabContainer/Rectangles"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 296.0
|
||||||
|
offset_right = 153.0
|
||||||
|
offset_bottom = 319.0
|
||||||
|
text = "draw_style_box()"
|
||||||
|
|
||||||
|
[node name="Polygons" type="Panel" parent="TabContainer"]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 2
|
||||||
|
script = ExtResource("4_obj11")
|
||||||
|
metadata/_tab_index = 2
|
||||||
|
|
||||||
|
[node name="DrawPrimitive" type="Label" parent="TabContainer/Polygons"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 207.0
|
||||||
|
offset_bottom = 97.0
|
||||||
|
text = "draw_primitive()"
|
||||||
|
|
||||||
|
[node name="DrawPolygon" type="Label" parent="TabContainer/Polygons"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 168.0
|
||||||
|
offset_right = 207.0
|
||||||
|
offset_bottom = 217.0
|
||||||
|
text = "draw_polygon()
|
||||||
|
draw_colored_polygon()"
|
||||||
|
|
||||||
|
[node name="DrawPolyline" type="Label" parent="TabContainer/Polygons"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 264.0
|
||||||
|
offset_right = 195.0
|
||||||
|
offset_bottom = 313.0
|
||||||
|
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
text = "draw_polyline()
|
||||||
|
draw_polyline_colors()"
|
||||||
|
|
||||||
|
[node name="DrawMultiline" type="Label" parent="TabContainer/Polygons"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 392.0
|
||||||
|
offset_right = 203.0
|
||||||
|
offset_bottom = 441.0
|
||||||
|
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
text = "draw_multiline()
|
||||||
|
draw_multiline_colors()"
|
||||||
|
|
||||||
|
[node name="Meshes" type="Panel" parent="TabContainer"]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 2
|
||||||
|
script = ExtResource("5_exx0l")
|
||||||
|
metadata/_tab_index = 3
|
||||||
|
|
||||||
|
[node name="DrawMesh" type="Label" parent="TabContainer/Meshes"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 207.0
|
||||||
|
offset_bottom = 97.0
|
||||||
|
text = "draw_mesh()"
|
||||||
|
|
||||||
|
[node name="DrawMultiMesh" type="Label" parent="TabContainer/Meshes"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 208.0
|
||||||
|
offset_right = 207.0
|
||||||
|
offset_bottom = 257.0
|
||||||
|
text = "draw_multimesh()"
|
||||||
|
|
||||||
|
[node name="Textures" type="Panel" parent="TabContainer"]
|
||||||
|
visible = false
|
||||||
|
texture_repeat = 2
|
||||||
|
layout_mode = 2
|
||||||
|
script = ExtResource("5_84cac")
|
||||||
|
metadata/_tab_index = 4
|
||||||
|
|
||||||
|
[node name="DrawTexture" type="Label" parent="TabContainer/Textures"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 175.0
|
||||||
|
offset_bottom = 97.0
|
||||||
|
text = "draw_texture()
|
||||||
|
draw_texture_rect()"
|
||||||
|
|
||||||
|
[node name="DrawTextureRectRegion" type="Label" parent="TabContainer/Textures"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 392.0
|
||||||
|
offset_right = 231.0
|
||||||
|
offset_bottom = 415.0
|
||||||
|
text = "draw_texture_rect_region()"
|
||||||
|
|
||||||
|
[node name="Text" type="Panel" parent="TabContainer"]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 2
|
||||||
|
script = ExtResource("6_4w081")
|
||||||
|
metadata/_tab_index = 5
|
||||||
|
|
||||||
|
[node name="DrawChar" type="Label" parent="TabContainer/Text"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 125.0
|
||||||
|
offset_bottom = 97.0
|
||||||
|
text = "draw_char()
|
||||||
|
draw_string()"
|
||||||
|
|
||||||
|
[node name="Animation" type="Panel" parent="TabContainer"]
|
||||||
|
visible = false
|
||||||
|
layout_mode = 2
|
||||||
|
script = ExtResource("8_yrx86")
|
||||||
|
metadata/_tab_index = 6
|
||||||
|
|
||||||
|
[node name="DrawArcTime" type="Label" parent="TabContainer/Animation"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 125.0
|
||||||
|
offset_bottom = 97.0
|
||||||
|
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
text = "draw_arc()
|
||||||
|
+ time variable"
|
||||||
|
|
||||||
|
[node name="DrawAnimationSlice" type="Label" parent="TabContainer/Animation"]
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = 216.0
|
||||||
|
offset_right = 201.0
|
||||||
|
offset_bottom = 265.0
|
||||||
|
text = "draw_animation_slice()"
|
||||||
|
|
||||||
|
[node name="AnimationSlice" type="Control" parent="TabContainer/Animation"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
script = ExtResource("9_obj11")
|
||||||
|
|
||||||
|
[node name="Options" type="HBoxContainer" parent="."]
|
||||||
|
layout_mode = 1
|
||||||
|
anchors_preset = 2
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_left = 24.0
|
||||||
|
offset_top = -64.0
|
||||||
|
offset_right = 441.0
|
||||||
|
offset_bottom = -24.0
|
||||||
|
grow_vertical = 0
|
||||||
|
theme_override_constants/separation = 20
|
||||||
|
|
||||||
|
[node name="MSAA2DLabel" type="Label" parent="Options"]
|
||||||
|
layout_mode = 2
|
||||||
|
text = "MSAA 2D"
|
||||||
|
|
||||||
|
[node name="MSAA2DOptionButton" type="OptionButton" parent="Options"]
|
||||||
|
layout_mode = 2
|
||||||
|
selected = 0
|
||||||
|
item_count = 4
|
||||||
|
popup/item_0/text = "Disabled"
|
||||||
|
popup/item_0/id = 0
|
||||||
|
popup/item_1/text = "2×"
|
||||||
|
popup/item_1/id = 1
|
||||||
|
popup/item_2/text = "4×"
|
||||||
|
popup/item_2/id = 2
|
||||||
|
popup/item_3/text = "8×"
|
||||||
|
popup/item_3/id = 3
|
||||||
|
|
||||||
|
[node name="VSeparator" type="VSeparator" parent="Options"]
|
||||||
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="DrawAntialiasing" type="CheckButton" parent="Options"]
|
||||||
|
layout_mode = 2
|
||||||
|
tooltip_text = "Performs antialiasing by adding a feathered outline
|
||||||
|
to lines that are drawn in 2D. This is generally faster to render
|
||||||
|
than 2D MSAA, but not all draw commands support it.
|
||||||
|
|
||||||
|
Commands that support draw antialiasing are
|
||||||
|
highlighted in green."
|
||||||
|
theme_override_colors/font_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
theme_override_colors/font_focus_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
theme_override_colors/font_pressed_color = Color(0.501961, 1, 0.501961, 1)
|
||||||
|
text = "Draw Antialiasing"
|
||||||
|
|
||||||
|
[connection signal="item_selected" from="Options/MSAA2DOptionButton" to="." method="_on_msaa_2d_item_selected"]
|
||||||
|
[connection signal="toggled" from="Options/DrawAntialiasing" to="." method="_on_draw_antialiasing_toggled"]
|
||||||
1
2d/custom_drawing/icon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><path d="m15.999738 8a7.9997377 7.9997377 0 0 0 -7.999738 7.999738v67.99777c11.999607 3.999869 7.999738-7.999738 15.999475-7.999738v-51.998295h79.997375v17.599423a19.319367 19.319367 0 0 1 15.99948 3.999869v-29.599029a7.9997377 7.9997377 0 0 0 -7.99974-7.999738zm10.879643 81.43733c-2.263926 1.351955-4.127865 3.727878-5.159831 6.919773-3.327891 10.215667-19.3353659-7.519754-7.567752 16.071477 3.719878 7.44775 15.295499 9.61568 22.679257 5.78381a15.375496 15.375496 0 0 0 6.639782-20.439334c-4.623848-9.263696-11.59962-11.287629-16.591456-8.327726zm17.775417-5.599817 10.175666 19.959347 56.550146-28.815056a11.319629 11.319629 0 0 0 -10.07167-20.271336zm27.343104-43.838562v7.999737h-7.999738v7.999738h-15.999476v7.999738h-7.999737v7.999738h-7.999738v7.999737h1.999935l53.998229-27.783089v-4.215862h-7.999738v-7.999737z" fill="#808080" stroke-width=".999999"/></svg>
|
||||||
|
After Width: | Height: | Size: 935 B |
43
2d/custom_drawing/icon.svg.import
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cfri1nx5avo7w"
|
||||||
|
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.svg"
|
||||||
|
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
|
svg/scale=1.0
|
||||||
|
editor/scale_with_editor_scale=false
|
||||||
|
editor/convert_colors_with_editor_theme=false
|
||||||
89
2d/custom_drawing/lines.gd
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
|
||||||
|
@tool
|
||||||
|
extends Panel
|
||||||
|
|
||||||
|
var use_antialiasing: bool = false
|
||||||
|
|
||||||
|
|
||||||
|
func _draw() -> void:
|
||||||
|
var margin := Vector2(200, 50)
|
||||||
|
|
||||||
|
# Line width of `-1.0` is only usable with draw antialiasing disabled,
|
||||||
|
# as it uses hardware line drawing as opposed to polygon-based line drawing.
|
||||||
|
# Automatically use polygon-based line drawing when needed to avoid runtime warnings.
|
||||||
|
# We also use a line width of `0.5` instead of `1.0` to better match the appearance
|
||||||
|
# of non-antialiased line drawing, as draw antialiasing tends to make lines look thicker.
|
||||||
|
var line_width_thin := 0.5 if use_antialiasing else -1.0
|
||||||
|
|
||||||
|
# Make thick lines 1 pixel thinner when draw antialiasing is enabled,
|
||||||
|
# as draw antialiasing tends to make lines look thicker.
|
||||||
|
var antialiasing_width_offset := 1.0 if use_antialiasing else 0.0
|
||||||
|
|
||||||
|
var offset := Vector2()
|
||||||
|
var line_length := Vector2(140, 35)
|
||||||
|
draw_line(margin + offset, margin + offset + line_length, Color.GREEN, line_width_thin, use_antialiasing)
|
||||||
|
offset += Vector2(line_length.x + 15, 0)
|
||||||
|
draw_line(margin + offset, margin + offset + line_length, Color.GREEN, 2.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
offset += Vector2(line_length.x + 15, 0)
|
||||||
|
draw_line(margin + offset, margin + offset + line_length, Color.GREEN, 6.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
offset += Vector2(line_length.x + 15, 0)
|
||||||
|
draw_dashed_line(margin + offset, margin + offset + line_length, Color.CYAN, line_width_thin, 5.0, true, use_antialiasing)
|
||||||
|
offset += Vector2(line_length.x + 15, 0)
|
||||||
|
draw_dashed_line(margin + offset, margin + offset + line_length, Color.CYAN, 2.0 - antialiasing_width_offset, 10.0, true, use_antialiasing)
|
||||||
|
offset += Vector2(line_length.x + 15, 0)
|
||||||
|
draw_dashed_line(margin + offset, margin + offset + line_length, Color.CYAN, 6.0 - antialiasing_width_offset, 15.0, true, use_antialiasing)
|
||||||
|
|
||||||
|
|
||||||
|
offset = Vector2(40, 120)
|
||||||
|
draw_circle(margin + offset, 40, Color.ORANGE, false, line_width_thin, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(100, 0)
|
||||||
|
draw_circle(margin + offset, 40, Color.ORANGE, false, 2.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(100, 0)
|
||||||
|
draw_circle(margin + offset, 40, Color.ORANGE, false, 6.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
# Draw a filled circle. The width parameter is ignored for filled circles (it's set to `-1.0` to avoid warnings).
|
||||||
|
# We also reduce the radius by half the antialiasing width offset.
|
||||||
|
# Otherwise, the circle becomes very slightly larger when draw antialiasing is enabled.
|
||||||
|
offset += Vector2(100, 0)
|
||||||
|
draw_circle(margin + offset, 40 - antialiasing_width_offset * 0.5, Color.ORANGE, true, -1.0, use_antialiasing)
|
||||||
|
|
||||||
|
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
|
||||||
|
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
|
||||||
|
# that don't offer dedicated parameters for this (such as `draw_primitive()` not having a position parameter).
|
||||||
|
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
|
||||||
|
#
|
||||||
|
# Draw a horizontally stretched circle.
|
||||||
|
offset += Vector2(200, 0)
|
||||||
|
draw_set_transform(margin + offset, 0.0, Vector2(3.0, 1.0))
|
||||||
|
draw_circle(Vector2(), 40, Color.ORANGE, false, line_width_thin, use_antialiasing)
|
||||||
|
draw_set_transform(Vector2())
|
||||||
|
|
||||||
|
# Draw a quarter circle (`TAU` represents a full turn in radians).
|
||||||
|
const POINT_COUNT_HIGH = 24
|
||||||
|
offset = Vector2(0, 200)
|
||||||
|
draw_arc(margin + offset, 60, 0, 0.25 * TAU, POINT_COUNT_HIGH, Color.YELLOW, line_width_thin, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(100, 0)
|
||||||
|
draw_arc(margin + offset, 60, 0, 0.25 * TAU, POINT_COUNT_HIGH, Color.YELLOW, 2.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(100, 0)
|
||||||
|
draw_arc(margin + offset, 60, 0, 0.25 * TAU, POINT_COUNT_HIGH, Color.YELLOW, 6.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
# Draw a three quarters of a circle with a low point count, which gives it an angular look.
|
||||||
|
const POINT_COUNT_LOW = 7
|
||||||
|
offset += Vector2(125, 30)
|
||||||
|
draw_arc(margin + offset, 40, -0.25 * TAU, 0.5 * TAU, POINT_COUNT_LOW, Color.YELLOW, line_width_thin, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(100, 0)
|
||||||
|
draw_arc(margin + offset, 40, -0.25 * TAU, 0.5 * TAU, POINT_COUNT_LOW, Color.YELLOW, 2.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(100, 0)
|
||||||
|
draw_arc(margin + offset, 40, -0.25 * TAU, 0.5 * TAU, POINT_COUNT_LOW, Color.YELLOW, 6.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
# Draw a horizontally stretched arc.
|
||||||
|
offset += Vector2(200, 0)
|
||||||
|
draw_set_transform(margin + offset, 0.0, Vector2(3.0, 1.0))
|
||||||
|
draw_arc(Vector2(), 40, -0.25 * TAU, 0.5 * TAU, POINT_COUNT_LOW, Color.YELLOW, line_width_thin, use_antialiasing)
|
||||||
|
draw_set_transform(Vector2())
|
||||||
1
2d/custom_drawing/lines.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bs2i4k2suatwx
|
||||||
63
2d/custom_drawing/meshes.gd
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
|
||||||
|
@tool
|
||||||
|
extends Panel
|
||||||
|
|
||||||
|
# You must hold a reference to the Resources either as member variables or within an Array or Dictionary.
|
||||||
|
# Otherwise, they get freed automatically and the renderer won't be able to draw them.
|
||||||
|
var text_mesh := TextMesh.new()
|
||||||
|
var noise_texture := NoiseTexture2D.new()
|
||||||
|
var gradient_texture := GradientTexture2D.new()
|
||||||
|
var sphere_mesh := SphereMesh.new()
|
||||||
|
var multi_mesh := MultiMesh.new()
|
||||||
|
|
||||||
|
func _ready() -> void:
|
||||||
|
text_mesh.text = "TextMesh"
|
||||||
|
# In 2D, 1 unit equals 1 pixel, so the default size at which PrimitiveMeshes are displayed is tiny.
|
||||||
|
# Use much larger mesh size to compensate, or use `draw_set_transform()` before using `draw_mesh()`
|
||||||
|
# to scale the draw command.
|
||||||
|
text_mesh.pixel_size = 2.5
|
||||||
|
|
||||||
|
noise_texture.seamless = true
|
||||||
|
noise_texture.as_normal_map = true
|
||||||
|
noise_texture.noise = FastNoiseLite.new()
|
||||||
|
|
||||||
|
gradient_texture.gradient = Gradient.new()
|
||||||
|
|
||||||
|
sphere_mesh.height = 80.0
|
||||||
|
sphere_mesh.radius = 40.0
|
||||||
|
|
||||||
|
multi_mesh.use_colors = true
|
||||||
|
multi_mesh.instance_count = 5
|
||||||
|
multi_mesh.set_instance_transform_2d(0, Transform2D(0.0, Vector2(0, 0)))
|
||||||
|
multi_mesh.set_instance_color(0, Color(1, 0.7, 0.7))
|
||||||
|
multi_mesh.set_instance_transform_2d(1, Transform2D(0.0, Vector2(0, 100)))
|
||||||
|
multi_mesh.set_instance_color(1, Color(0.7, 1, 0.7))
|
||||||
|
multi_mesh.set_instance_transform_2d(2, Transform2D(0.0, Vector2(100, 100)))
|
||||||
|
multi_mesh.set_instance_color(2, Color(0.7, 0.7, 1))
|
||||||
|
multi_mesh.set_instance_transform_2d(3, Transform2D(0.0, Vector2(100, 0)))
|
||||||
|
multi_mesh.set_instance_color(3, Color(1, 1, 0.7))
|
||||||
|
multi_mesh.set_instance_transform_2d(4, Transform2D(0.0, Vector2(50, 50)))
|
||||||
|
multi_mesh.set_instance_color(4, Color(0.7, 1, 1))
|
||||||
|
multi_mesh.mesh = sphere_mesh
|
||||||
|
|
||||||
|
|
||||||
|
func _draw() -> void:
|
||||||
|
const margin := Vector2(300, 70)
|
||||||
|
var offset := Vector2()
|
||||||
|
|
||||||
|
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
|
||||||
|
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
|
||||||
|
# that don't offer dedicated parameters for this (such as `draw_primitive()` not having a position parameter).
|
||||||
|
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
|
||||||
|
#
|
||||||
|
# Flip drawing on the Y axis so the text appears upright.
|
||||||
|
draw_set_transform(margin + offset, 0.0, Vector2(1, -1))
|
||||||
|
draw_mesh(text_mesh, noise_texture)
|
||||||
|
|
||||||
|
offset += Vector2(150, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_mesh(sphere_mesh, noise_texture)
|
||||||
|
|
||||||
|
offset = Vector2(0, 120)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_multimesh(multi_mesh, gradient_texture)
|
||||||
1
2d/custom_drawing/meshes.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cmgvk2l7icywj
|
||||||
126
2d/custom_drawing/polygons.gd
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
|
||||||
|
@tool
|
||||||
|
extends Panel
|
||||||
|
|
||||||
|
var use_antialiasing: bool = false
|
||||||
|
|
||||||
|
|
||||||
|
func _draw() -> void:
|
||||||
|
var margin := Vector2(240, 40)
|
||||||
|
|
||||||
|
# Line width of `-1.0` is only usable with draw antialiasing disabled,
|
||||||
|
# as it uses hardware line drawing as opposed to polygon-based line drawing.
|
||||||
|
# Automatically use polygon-based line drawing when needed to avoid runtime warnings.
|
||||||
|
# We also use a line width of `0.5` instead of `1.0` to better match the appearance
|
||||||
|
# of non-antialiased line drawing, as draw antialiasing tends to make lines look thicker.
|
||||||
|
var line_width_thin := 0.5 if use_antialiasing else -1.0
|
||||||
|
|
||||||
|
# Make thick lines 1 pixel thinner when draw antialiasing is enabled,
|
||||||
|
# as draw antialiasing tends to make lines look thicker.
|
||||||
|
var antialiasing_width_offset := 1.0 if use_antialiasing else 0.0
|
||||||
|
|
||||||
|
var points := PackedVector2Array([
|
||||||
|
Vector2(0, 0),
|
||||||
|
Vector2(0, 60),
|
||||||
|
Vector2(60, 90),
|
||||||
|
Vector2(60, 0),
|
||||||
|
Vector2(40, 25),
|
||||||
|
Vector2(10, 40),
|
||||||
|
])
|
||||||
|
var colors := PackedColorArray([
|
||||||
|
Color.WHITE,
|
||||||
|
Color.RED,
|
||||||
|
Color.GREEN,
|
||||||
|
Color.BLUE,
|
||||||
|
Color.MAGENTA,
|
||||||
|
Color.MAGENTA,
|
||||||
|
])
|
||||||
|
|
||||||
|
var offset := Vector2()
|
||||||
|
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
|
||||||
|
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
|
||||||
|
# that don't offer dedicated parameters for this (such as `draw_primitive()` not having a position parameter).
|
||||||
|
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_primitive(points.slice(0, 1), colors.slice(0, 1), PackedVector2Array())
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_primitive(points.slice(0, 2), colors.slice(0, 2), PackedVector2Array())
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_primitive(points.slice(0, 3), colors.slice(0, 3), PackedVector2Array())
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_primitive(points.slice(0, 4), colors.slice(0, 4), PackedVector2Array())
|
||||||
|
|
||||||
|
# Draw a polygon with multiple colors that are interpolated between each point.
|
||||||
|
# Colors are specified in the same order as the points' positions, but in a different array.
|
||||||
|
offset = Vector2(0, 120)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_polygon(points, colors)
|
||||||
|
|
||||||
|
# Draw a polygon with a single color. Only a points array is needed in this case.
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_colored_polygon(points, Color.YELLOW)
|
||||||
|
|
||||||
|
# Draw a polygon-based line. Each segment is connected to the previous one, which means
|
||||||
|
# `draw_polyline()` always draws a contiguous line.
|
||||||
|
offset = Vector2(0, 240)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_polyline(points, Color.SKY_BLUE, line_width_thin, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_polyline(points, Color.SKY_BLUE, 2.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_polyline(points, Color.SKY_BLUE, 6.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_polyline_colors(points, colors, line_width_thin, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_polyline_colors(points, colors, 2.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_polyline_colors(points, colors, 6.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
# Draw multiple lines in a single draw command. Unlike `draw_polyline()`,
|
||||||
|
# lines are not connected to the last segment.
|
||||||
|
# This is faster than calling `draw_line()` several times and should be preferred
|
||||||
|
# when drawing dozens of lines or more at once.
|
||||||
|
offset = Vector2(0, 360)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_multiline(points, Color.SKY_BLUE, line_width_thin, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_multiline(points, Color.SKY_BLUE, 2.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_multiline(points, Color.SKY_BLUE, 6.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
# `draw_multiline_colors()` makes it possible to draw lines of different colors in a single
|
||||||
|
# draw command, although gradients are not possible this way (unlike `draw_polygon()` and `draw_polyline()`).
|
||||||
|
# This means the number of supplied colors must be equal to the number of segments, which means
|
||||||
|
# we have to only pass a subset of the colors array in this example.
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_multiline_colors(points, colors.slice(0, 3), line_width_thin, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_multiline_colors(points, colors.slice(0, 3), 2.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
|
|
||||||
|
offset += Vector2(90, 0)
|
||||||
|
draw_set_transform(margin + offset)
|
||||||
|
draw_multiline_colors(points, colors.slice(0, 3), 6.0 - antialiasing_width_offset, use_antialiasing)
|
||||||
1
2d/custom_drawing/polygons.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://bavbrayrl4aqv
|
||||||
31
2d/custom_drawing/project.godot
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
; Engine configuration file.
|
||||||
|
; It's best edited using the editor UI and not directly,
|
||||||
|
; since the parameters that go here are not all obvious.
|
||||||
|
;
|
||||||
|
; Format:
|
||||||
|
; [section] ; section goes between []
|
||||||
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
|
config_version=5
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="Custom Drawing in 2D"
|
||||||
|
config/description="A demo showing how to draw 2D elements in Godot without using nodes."
|
||||||
|
run/main_scene="uid://btxwm0qudsn3t"
|
||||||
|
config/features=PackedStringArray("4.5", "Mobile")
|
||||||
|
run/low_processor_mode=true
|
||||||
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
|
||||||
|
gdscript/warnings/untyped_declaration=1
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/stretch/mode="canvas_items"
|
||||||
|
window/stretch/aspect="expand"
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
renderer/rendering_method="mobile"
|
||||||
146
2d/custom_drawing/rectangles.gd
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
|
||||||
|
@tool
|
||||||
|
extends Panel
|
||||||
|
|
||||||
|
var use_antialiasing: bool = false
|
||||||
|
|
||||||
|
|
||||||
|
func _draw() -> void:
|
||||||
|
var margin := Vector2(200, 40)
|
||||||
|
|
||||||
|
# Line width of `-1.0` is only usable with draw antialiasing disabled,
|
||||||
|
# as it uses hardware line drawing as opposed to polygon-based line drawing.
|
||||||
|
# Automatically use polygon-based line drawing when needed to avoid runtime warnings.
|
||||||
|
# We also use a line width of `0.5` instead of `1.0` to better match the appearance
|
||||||
|
# of non-antialiased line drawing, as draw antialiasing tends to make lines look thicker.
|
||||||
|
var line_width_thin := 0.5 if use_antialiasing else -1.0
|
||||||
|
|
||||||
|
# Make thick lines 1 pixel thinner when draw antialiasing is enabled,
|
||||||
|
# as draw antialiasing tends to make lines look thicker.
|
||||||
|
var antialiasing_width_offset := 1.0 if use_antialiasing else 0.0
|
||||||
|
|
||||||
|
var offset := Vector2()
|
||||||
|
draw_rect(
|
||||||
|
Rect2(margin + offset, Vector2(100, 50)),
|
||||||
|
Color.PURPLE,
|
||||||
|
false,
|
||||||
|
line_width_thin,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
|
||||||
|
offset += Vector2(120, 0)
|
||||||
|
draw_rect(
|
||||||
|
Rect2(margin + offset, Vector2(100, 50)),
|
||||||
|
Color.PURPLE,
|
||||||
|
false,
|
||||||
|
2.0 - antialiasing_width_offset,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
|
||||||
|
offset += Vector2(120, 0)
|
||||||
|
draw_rect(
|
||||||
|
Rect2(margin + offset, Vector2(100, 50)),
|
||||||
|
Color.PURPLE,
|
||||||
|
false,
|
||||||
|
6.0 - antialiasing_width_offset,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
|
||||||
|
# Draw a filled rectangle. The width parameter is ignored for filled rectangles (it's set to `-1.0` to avoid warnings).
|
||||||
|
# We also reduce the rectangle's size by half the antialiasing width offset.
|
||||||
|
# Otherwise, the rectangle becomes very slightly larger when draw antialiasing is enabled.
|
||||||
|
offset += Vector2(120, 0)
|
||||||
|
draw_rect(
|
||||||
|
Rect2(margin + offset, Vector2(100, 50)).grow(-antialiasing_width_offset * 0.5),
|
||||||
|
Color.PURPLE,
|
||||||
|
true,
|
||||||
|
-1.0,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
|
||||||
|
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
|
||||||
|
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
|
||||||
|
# that don't offer dedicated parameters for this (such as `draw_rect()` not having a rotation parameter).
|
||||||
|
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
|
||||||
|
offset += Vector2(170, 0)
|
||||||
|
draw_set_transform(margin + offset, deg_to_rad(22.5))
|
||||||
|
draw_rect(
|
||||||
|
Rect2(Vector2(), Vector2(100, 50)),
|
||||||
|
Color.PURPLE,
|
||||||
|
false,
|
||||||
|
line_width_thin,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
offset += Vector2(120, 0)
|
||||||
|
draw_set_transform(margin + offset, deg_to_rad(22.5))
|
||||||
|
draw_rect(
|
||||||
|
Rect2(Vector2(), Vector2(100, 50)),
|
||||||
|
Color.PURPLE,
|
||||||
|
false,
|
||||||
|
2.0 - antialiasing_width_offset,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
offset += Vector2(120, 0)
|
||||||
|
draw_set_transform(margin + offset, deg_to_rad(22.5))
|
||||||
|
draw_rect(
|
||||||
|
Rect2(Vector2(), Vector2(100, 50)),
|
||||||
|
Color.PURPLE,
|
||||||
|
false,
|
||||||
|
6.0 - antialiasing_width_offset,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
|
||||||
|
# `draw_set_transform_matrix()` is a more advanced counterpart of `draw_set_transform()`.
|
||||||
|
# It can be used to apply transforms that are not supported by `draw_set_transform()`, such as
|
||||||
|
# skewing.
|
||||||
|
offset = Vector2(20, 60)
|
||||||
|
var custom_transform := get_transform().translated(margin + offset)
|
||||||
|
# Perform horizontal skewing (the rectangle will appear "slanted").
|
||||||
|
custom_transform.y.x -= 0.5
|
||||||
|
draw_set_transform_matrix(custom_transform)
|
||||||
|
draw_rect(
|
||||||
|
Rect2(Vector2(), Vector2(100, 50)),
|
||||||
|
Color.PURPLE,
|
||||||
|
false,
|
||||||
|
6.0 - antialiasing_width_offset,
|
||||||
|
use_antialiasing
|
||||||
|
)
|
||||||
|
draw_set_transform(Vector2())
|
||||||
|
|
||||||
|
offset = Vector2(0, 250)
|
||||||
|
var style_box_flat := StyleBoxFlat.new()
|
||||||
|
style_box_flat.set_border_width_all(4)
|
||||||
|
style_box_flat.set_corner_radius_all(8)
|
||||||
|
style_box_flat.shadow_size = 1
|
||||||
|
style_box_flat.shadow_offset = Vector2(4, 4)
|
||||||
|
style_box_flat.shadow_color = Color.RED
|
||||||
|
style_box_flat.anti_aliasing = use_antialiasing
|
||||||
|
draw_style_box(style_box_flat, Rect2(margin + offset, Vector2(100, 50)))
|
||||||
|
|
||||||
|
offset += Vector2(130, 0)
|
||||||
|
var style_box_flat_2 := StyleBoxFlat.new()
|
||||||
|
style_box_flat_2.draw_center = false
|
||||||
|
style_box_flat_2.set_border_width_all(4)
|
||||||
|
style_box_flat_2.set_corner_radius_all(8)
|
||||||
|
style_box_flat_2.corner_detail = 1
|
||||||
|
style_box_flat_2.border_color = Color.GREEN
|
||||||
|
style_box_flat_2.anti_aliasing = use_antialiasing
|
||||||
|
draw_style_box(style_box_flat_2, Rect2(margin + offset, Vector2(100, 50)))
|
||||||
|
|
||||||
|
offset += Vector2(160, 0)
|
||||||
|
var style_box_flat_3 := StyleBoxFlat.new()
|
||||||
|
style_box_flat_3.draw_center = false
|
||||||
|
style_box_flat_3.set_border_width_all(4)
|
||||||
|
style_box_flat_3.set_corner_radius_all(8)
|
||||||
|
style_box_flat_3.border_color = Color.CYAN
|
||||||
|
style_box_flat_3.shadow_size = 40
|
||||||
|
style_box_flat_3.shadow_offset = Vector2()
|
||||||
|
style_box_flat_3.shadow_color = Color.CORNFLOWER_BLUE
|
||||||
|
style_box_flat_3.anti_aliasing = use_antialiasing
|
||||||
|
custom_transform = get_transform().translated(margin + offset)
|
||||||
|
# Perform vertical skewing (the rectangle will appear "slanted").
|
||||||
|
custom_transform.x.y -= 0.5
|
||||||
|
draw_set_transform_matrix(custom_transform)
|
||||||
|
draw_style_box(style_box_flat_3, Rect2(Vector2(), Vector2(100, 50)))
|
||||||
|
|
||||||
|
draw_set_transform(Vector2())
|
||||||
1
2d/custom_drawing/rectangles.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://kr0artw8tmec
|
||||||
BIN
2d/custom_drawing/screenshots/custom_drawing.webp
Normal file
|
After Width: | Height: | Size: 47 KiB |
60
2d/custom_drawing/text.gd
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
|
||||||
|
@tool
|
||||||
|
extends Panel
|
||||||
|
|
||||||
|
var use_antialiasing: bool = false
|
||||||
|
|
||||||
|
|
||||||
|
func _draw() -> void:
|
||||||
|
var font := get_theme_default_font()
|
||||||
|
const FONT_SIZE = 24
|
||||||
|
const STRING = "Hello world!"
|
||||||
|
var margin := Vector2(240, 60)
|
||||||
|
|
||||||
|
var offset := Vector2()
|
||||||
|
var advance := Vector2()
|
||||||
|
for character in STRING:
|
||||||
|
# Draw each character with a random pastel color.
|
||||||
|
# Notice how the advance calculated on the loop's previous iteration is used as an offset here.
|
||||||
|
draw_char(font, margin + offset + advance, character, FONT_SIZE, Color.from_hsv(randf(), 0.4, 1.0))
|
||||||
|
|
||||||
|
# Get the glyph index of the character we've just drawn, so we can retrieve the glyph advance.
|
||||||
|
# This determines the spacing between glyphs so the next character is positioned correctly.
|
||||||
|
var glyph_idx := TextServerManager.get_primary_interface().font_get_glyph_index(
|
||||||
|
get_theme_default_font().get_rids()[0],
|
||||||
|
FONT_SIZE,
|
||||||
|
character.unicode_at(0),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
advance.x += TextServerManager.get_primary_interface().font_get_glyph_advance(
|
||||||
|
get_theme_default_font().get_rids()[0],
|
||||||
|
FONT_SIZE,
|
||||||
|
glyph_idx
|
||||||
|
).x
|
||||||
|
|
||||||
|
offset += Vector2(0, 32)
|
||||||
|
# When drawing a font outline, it must be drawn *before* the main text.
|
||||||
|
# This way, the outline appears behind the main text.
|
||||||
|
draw_string_outline(
|
||||||
|
font,
|
||||||
|
margin + offset,
|
||||||
|
STRING,
|
||||||
|
HORIZONTAL_ALIGNMENT_LEFT,
|
||||||
|
-1,
|
||||||
|
FONT_SIZE,
|
||||||
|
12,
|
||||||
|
Color.ORANGE.darkened(0.6)
|
||||||
|
)
|
||||||
|
# NOTE: Use `draw_multiline_string()` to draw strings that contain line breaks (`\n`) or with
|
||||||
|
# automatic line wrapping based on the specified width.
|
||||||
|
# A width of `-1` is used here, which means "no limit". If width is limited, the end of the string
|
||||||
|
# will be cut off if it doesn't fit within the specified width.
|
||||||
|
draw_string(
|
||||||
|
font,
|
||||||
|
margin + offset,
|
||||||
|
STRING,
|
||||||
|
HORIZONTAL_ALIGNMENT_LEFT,
|
||||||
|
-1,
|
||||||
|
FONT_SIZE,
|
||||||
|
Color.YELLOW
|
||||||
|
)
|
||||||
1
2d/custom_drawing/text.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://by5ufa6o3liw
|
||||||
67
2d/custom_drawing/textures.gd
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# This is a `@tool` script so that the custom 2D drawing can be seen in the editor.
|
||||||
|
@tool
|
||||||
|
extends Panel
|
||||||
|
|
||||||
|
var use_antialiasing: bool = false
|
||||||
|
|
||||||
|
func _draw() -> void:
|
||||||
|
const ICON = preload("res://icon.svg")
|
||||||
|
var margin := Vector2(260, 40)
|
||||||
|
|
||||||
|
var offset := Vector2()
|
||||||
|
# Draw a texture.
|
||||||
|
draw_texture(ICON, margin + offset, Color.WHITE)
|
||||||
|
|
||||||
|
# `draw_set_transform()` is a stateful command: it affects *all* `draw_` methods within this
|
||||||
|
# `_draw()` function after it. This can be used to translate, rotate, or scale `draw_` methods
|
||||||
|
# that don't offer dedicated parameters for this (such as `draw_rect()` not having a rotation parameter).
|
||||||
|
# To reset back to the initial transform, call `draw_set_transform(Vector2())`.
|
||||||
|
#
|
||||||
|
# Draw a rotated texture at half the scale of its original pixel size.
|
||||||
|
offset += Vector2(200, 20)
|
||||||
|
draw_set_transform(margin + offset, deg_to_rad(45.0), Vector2(0.5, 0.5))
|
||||||
|
draw_texture(ICON, Vector2(), Color.WHITE)
|
||||||
|
draw_set_transform(Vector2())
|
||||||
|
|
||||||
|
# Draw a stretched texture. In this example, the icon is 128×128 so it will be drawn at 2× scale.
|
||||||
|
offset += Vector2(70, -20)
|
||||||
|
draw_texture_rect(
|
||||||
|
ICON,
|
||||||
|
Rect2(margin + offset, Vector2(256, 256)),
|
||||||
|
false,
|
||||||
|
Color.GREEN
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Draw a tiled texture. In this example, the icon is 128×128 so it will be drawn twice on each axis.
|
||||||
|
offset += Vector2(270, 0)
|
||||||
|
draw_texture_rect(
|
||||||
|
ICON,
|
||||||
|
Rect2(margin + offset, Vector2(256, 256)),
|
||||||
|
true,
|
||||||
|
Color.GREEN
|
||||||
|
)
|
||||||
|
|
||||||
|
offset = Vector2(0, 300)
|
||||||
|
|
||||||
|
draw_texture_rect_region(
|
||||||
|
ICON,
|
||||||
|
Rect2(margin + offset, Vector2(128, 128)),
|
||||||
|
Rect2(Vector2(32, 32), Vector2(64, 64)),
|
||||||
|
Color.VIOLET
|
||||||
|
)
|
||||||
|
|
||||||
|
# Draw a tiled texture from a region that is larger than the original texture size (128×128).
|
||||||
|
# Transposing is enabled, which will rotate the image by 90 degrees counter-clockwise.
|
||||||
|
# (For more advanced transforms, use `draw_set_transform()` before calling `draw_texture_rect_region()`.)
|
||||||
|
#
|
||||||
|
# For tiling to work with this approach, the CanvasItem in which this `_draw()` method is called
|
||||||
|
# must have its Repeat property set to Enabled in the inspector.
|
||||||
|
offset += Vector2(140, 0)
|
||||||
|
draw_texture_rect_region(
|
||||||
|
ICON,
|
||||||
|
Rect2(margin + offset, Vector2(128, 128)),
|
||||||
|
Rect2(Vector2(), Vector2(512, 512)),
|
||||||
|
Color.VIOLET,
|
||||||
|
true
|
||||||
|
)
|
||||||
1
2d/custom_drawing/textures.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://dmgkvc33ohsn1
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
extends CanvasLayer
|
|
||||||
|
|
||||||
signal start_game
|
|
||||||
|
|
||||||
func show_message(text):
|
|
||||||
$MessageLabel.text = text
|
|
||||||
$MessageLabel.show()
|
|
||||||
$MessageTimer.start()
|
|
||||||
|
|
||||||
|
|
||||||
func show_game_over():
|
|
||||||
show_message("Game Over")
|
|
||||||
yield($MessageTimer, "timeout")
|
|
||||||
$MessageLabel.text = "Dodge the\nCreeps"
|
|
||||||
$MessageLabel.show()
|
|
||||||
yield(get_tree().create_timer(1), "timeout")
|
|
||||||
$StartButton.show()
|
|
||||||
|
|
||||||
|
|
||||||
func update_score(score):
|
|
||||||
$ScoreLabel.text = str(score)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_StartButton_pressed():
|
|
||||||
$StartButton.hide()
|
|
||||||
emit_signal("start_game")
|
|
||||||
|
|
||||||
|
|
||||||
func _on_MessageTimer_timeout():
|
|
||||||
$MessageLabel.hide()
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
[gd_scene load_steps=7 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://HUD.gd" type="Script" id=1]
|
|
||||||
[ext_resource path="res://fonts/Xolonium-Regular.ttf" type="DynamicFontData" id=2]
|
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=1]
|
|
||||||
size = 64
|
|
||||||
font_data = ExtResource( 2 )
|
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=2]
|
|
||||||
size = 64
|
|
||||||
font_data = ExtResource( 2 )
|
|
||||||
|
|
||||||
[sub_resource type="InputEventAction" id=3]
|
|
||||||
action = "ui_select"
|
|
||||||
|
|
||||||
[sub_resource type="ShortCut" id=4]
|
|
||||||
shortcut = SubResource( 3 )
|
|
||||||
|
|
||||||
[node name="HUD" type="CanvasLayer"]
|
|
||||||
script = ExtResource( 1 )
|
|
||||||
|
|
||||||
[node name="ScoreLabel" type="Label" parent="."]
|
|
||||||
anchor_right = 1.0
|
|
||||||
margin_bottom = 78.0
|
|
||||||
custom_fonts/font = SubResource( 1 )
|
|
||||||
text = "0"
|
|
||||||
align = 1
|
|
||||||
|
|
||||||
[node name="MessageLabel" type="Label" parent="."]
|
|
||||||
anchor_top = 0.5
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 0.5
|
|
||||||
margin_top = -79.5
|
|
||||||
margin_bottom = 79.5
|
|
||||||
custom_fonts/font = SubResource( 1 )
|
|
||||||
text = "Dodge the
|
|
||||||
Creeps"
|
|
||||||
align = 1
|
|
||||||
|
|
||||||
[node name="StartButton" type="Button" parent="."]
|
|
||||||
anchor_left = 0.5
|
|
||||||
anchor_top = 1.0
|
|
||||||
anchor_right = 0.5
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
margin_left = -90.0
|
|
||||||
margin_top = -200.0
|
|
||||||
margin_right = 90.0
|
|
||||||
margin_bottom = -100.0
|
|
||||||
custom_fonts/font = SubResource( 2 )
|
|
||||||
shortcut = SubResource( 4 )
|
|
||||||
text = "Start"
|
|
||||||
|
|
||||||
[node name="MessageTimer" type="Timer" parent="."]
|
|
||||||
one_shot = true
|
|
||||||
[connection signal="pressed" from="StartButton" to="." method="_on_StartButton_pressed"]
|
|
||||||
[connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"]
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
extends Node
|
|
||||||
|
|
||||||
export(PackedScene) var mob_scene
|
|
||||||
var score
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
randomize()
|
|
||||||
|
|
||||||
|
|
||||||
func game_over():
|
|
||||||
$ScoreTimer.stop()
|
|
||||||
$MobTimer.stop()
|
|
||||||
$HUD.show_game_over()
|
|
||||||
$Music.stop()
|
|
||||||
$DeathSound.play()
|
|
||||||
|
|
||||||
|
|
||||||
func new_game():
|
|
||||||
get_tree().call_group("mobs", "queue_free")
|
|
||||||
score = 0
|
|
||||||
$Player.start($StartPosition.position)
|
|
||||||
$StartTimer.start()
|
|
||||||
$HUD.update_score(score)
|
|
||||||
$HUD.show_message("Get Ready")
|
|
||||||
$Music.play()
|
|
||||||
|
|
||||||
|
|
||||||
func _on_MobTimer_timeout():
|
|
||||||
# Choose a random location on Path2D.
|
|
||||||
var mob_spawn_location = get_node("MobPath/MobSpawnLocation")
|
|
||||||
mob_spawn_location.offset = randi()
|
|
||||||
|
|
||||||
# Create a Mob instance and add it to the scene.
|
|
||||||
var mob = mob_scene.instance()
|
|
||||||
add_child(mob)
|
|
||||||
|
|
||||||
# Set the mob's direction perpendicular to the path direction.
|
|
||||||
var direction = mob_spawn_location.rotation + PI / 2
|
|
||||||
|
|
||||||
# Set the mob's position to a random location.
|
|
||||||
mob.position = mob_spawn_location.position
|
|
||||||
|
|
||||||
# Add some randomness to the direction.
|
|
||||||
direction += rand_range(-PI / 4, PI / 4)
|
|
||||||
mob.rotation = direction
|
|
||||||
|
|
||||||
# Choose the velocity.
|
|
||||||
var velocity = Vector2(rand_range(mob.min_speed, mob.max_speed), 0)
|
|
||||||
mob.linear_velocity = velocity.rotated(direction)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_ScoreTimer_timeout():
|
|
||||||
score += 1
|
|
||||||
$HUD.update_score(score)
|
|
||||||
|
|
||||||
|
|
||||||
func _on_StartTimer_timeout():
|
|
||||||
$MobTimer.start()
|
|
||||||
$ScoreTimer.start()
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
[gd_scene load_steps=8 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://Main.gd" type="Script" id=1]
|
|
||||||
[ext_resource path="res://Mob.tscn" type="PackedScene" id=2]
|
|
||||||
[ext_resource path="res://Player.tscn" type="PackedScene" id=3]
|
|
||||||
[ext_resource path="res://HUD.tscn" type="PackedScene" id=4]
|
|
||||||
[ext_resource path="res://art/House In a Forest Loop.ogg" type="AudioStream" id=5]
|
|
||||||
[ext_resource path="res://art/gameover.wav" type="AudioStream" id=6]
|
|
||||||
|
|
||||||
[sub_resource type="Curve2D" id=1]
|
|
||||||
_data = {
|
|
||||||
"points": PoolVector2Array( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 480, 720, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0 )
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="Main" type="Node"]
|
|
||||||
script = ExtResource( 1 )
|
|
||||||
mob_scene = ExtResource( 2 )
|
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="."]
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
color = Color( 0.219608, 0.372549, 0.380392, 1 )
|
|
||||||
|
|
||||||
[node name="Player" parent="." instance=ExtResource( 3 )]
|
|
||||||
|
|
||||||
[node name="MobTimer" type="Timer" parent="."]
|
|
||||||
wait_time = 0.5
|
|
||||||
|
|
||||||
[node name="ScoreTimer" type="Timer" parent="."]
|
|
||||||
|
|
||||||
[node name="StartTimer" type="Timer" parent="."]
|
|
||||||
wait_time = 2.0
|
|
||||||
one_shot = true
|
|
||||||
|
|
||||||
[node name="StartPosition" type="Position2D" parent="."]
|
|
||||||
position = Vector2( 240, 450 )
|
|
||||||
|
|
||||||
[node name="MobPath" type="Path2D" parent="."]
|
|
||||||
curve = SubResource( 1 )
|
|
||||||
|
|
||||||
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"]
|
|
||||||
|
|
||||||
[node name="HUD" parent="." instance=ExtResource( 4 )]
|
|
||||||
|
|
||||||
[node name="Music" type="AudioStreamPlayer" parent="."]
|
|
||||||
stream = ExtResource( 5 )
|
|
||||||
|
|
||||||
[node name="DeathSound" type="AudioStreamPlayer" parent="."]
|
|
||||||
stream = ExtResource( 6 )
|
|
||||||
[connection signal="hit" from="Player" to="." method="game_over"]
|
|
||||||
[connection signal="timeout" from="MobTimer" to="." method="_on_MobTimer_timeout"]
|
|
||||||
[connection signal="timeout" from="ScoreTimer" to="." method="_on_ScoreTimer_timeout"]
|
|
||||||
[connection signal="timeout" from="StartTimer" to="." method="_on_StartTimer_timeout"]
|
|
||||||
[connection signal="start_game" from="HUD" to="." method="new_game"]
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
extends RigidBody2D
|
|
||||||
|
|
||||||
#warning-ignore-all:unused_class_variable
|
|
||||||
export var min_speed = 150
|
|
||||||
export var max_speed = 250
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
$AnimatedSprite.playing = true
|
|
||||||
var mob_types = $AnimatedSprite.frames.get_animation_names()
|
|
||||||
$AnimatedSprite.animation = mob_types[randi() % mob_types.size()]
|
|
||||||
|
|
||||||
|
|
||||||
func _on_VisibilityNotifier2D_screen_exited():
|
|
||||||
queue_free()
|
|
||||||
|
|
||||||
|
|
||||||
func _on_start_game():
|
|
||||||
queue_free()
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
[gd_scene load_steps=10 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://Mob.gd" type="Script" id=1]
|
|
||||||
[ext_resource path="res://art/enemyFlyingAlt_1.png" type="Texture" id=2]
|
|
||||||
[ext_resource path="res://art/enemyFlyingAlt_2.png" type="Texture" id=3]
|
|
||||||
[ext_resource path="res://art/enemyWalking_1.png" type="Texture" id=4]
|
|
||||||
[ext_resource path="res://art/enemyWalking_2.png" type="Texture" id=5]
|
|
||||||
[ext_resource path="res://art/enemySwimming_1.png" type="Texture" id=6]
|
|
||||||
[ext_resource path="res://art/enemySwimming_2.png" type="Texture" id=7]
|
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=1]
|
|
||||||
animations = [ {
|
|
||||||
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "fly",
|
|
||||||
"speed": 3.0
|
|
||||||
}, {
|
|
||||||
"frames": [ ExtResource( 6 ), ExtResource( 7 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "swim",
|
|
||||||
"speed": 4.0
|
|
||||||
}, {
|
|
||||||
"frames": [ ExtResource( 4 ), ExtResource( 5 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "walk",
|
|
||||||
"speed": 4.0
|
|
||||||
} ]
|
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=2]
|
|
||||||
radius = 35.2706
|
|
||||||
height = 23.3281
|
|
||||||
|
|
||||||
[node name="Mob" type="RigidBody2D" groups=[
|
|
||||||
"mobs",
|
|
||||||
]]
|
|
||||||
collision_mask = 0
|
|
||||||
gravity_scale = 0.0
|
|
||||||
script = ExtResource( 1 )
|
|
||||||
__meta__ = {
|
|
||||||
"_edit_group_": true
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
|
||||||
scale = Vector2( 0.75, 0.75 )
|
|
||||||
frames = SubResource( 1 )
|
|
||||||
animation = "walk"
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
rotation = 1.5708
|
|
||||||
shape = SubResource( 2 )
|
|
||||||
|
|
||||||
[node name="VisibilityNotifier2D" type="VisibilityNotifier2D" parent="."]
|
|
||||||
[connection signal="screen_exited" from="VisibilityNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
extends Area2D
|
|
||||||
|
|
||||||
signal hit
|
|
||||||
|
|
||||||
export var speed = 400 # How fast the player will move (pixels/sec).
|
|
||||||
var screen_size # Size of the game window.
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
screen_size = get_viewport_rect().size
|
|
||||||
hide()
|
|
||||||
|
|
||||||
|
|
||||||
func _process(delta):
|
|
||||||
var velocity = Vector2.ZERO # The player's movement vector.
|
|
||||||
if Input.is_action_pressed("move_right"):
|
|
||||||
velocity.x += 1
|
|
||||||
if Input.is_action_pressed("move_left"):
|
|
||||||
velocity.x -= 1
|
|
||||||
if Input.is_action_pressed("move_down"):
|
|
||||||
velocity.y += 1
|
|
||||||
if Input.is_action_pressed("move_up"):
|
|
||||||
velocity.y -= 1
|
|
||||||
|
|
||||||
if velocity.length() > 0:
|
|
||||||
velocity = velocity.normalized() * speed
|
|
||||||
$AnimatedSprite.play()
|
|
||||||
else:
|
|
||||||
$AnimatedSprite.stop()
|
|
||||||
|
|
||||||
position += velocity * delta
|
|
||||||
position.x = clamp(position.x, 0, screen_size.x)
|
|
||||||
position.y = clamp(position.y, 0, screen_size.y)
|
|
||||||
|
|
||||||
if velocity.x != 0:
|
|
||||||
$AnimatedSprite.animation = "right"
|
|
||||||
$AnimatedSprite.flip_v = false
|
|
||||||
$AnimatedSprite.flip_h = velocity.x < 0
|
|
||||||
elif velocity.y != 0:
|
|
||||||
$AnimatedSprite.animation = "up"
|
|
||||||
$AnimatedSprite.flip_v = velocity.y > 0
|
|
||||||
|
|
||||||
|
|
||||||
func start(pos):
|
|
||||||
position = pos
|
|
||||||
show()
|
|
||||||
$CollisionShape2D.disabled = false
|
|
||||||
|
|
||||||
|
|
||||||
func _on_Player_body_entered(_body):
|
|
||||||
hide() # Player disappears after being hit.
|
|
||||||
emit_signal("hit")
|
|
||||||
# Must be deferred as we can't change physics properties on a physics callback.
|
|
||||||
$CollisionShape2D.set_deferred("disabled", true)
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
[gd_scene load_steps=13 format=2]
|
|
||||||
|
|
||||||
[ext_resource path="res://Player.gd" type="Script" id=1]
|
|
||||||
[ext_resource path="res://art/playerGrey_walk1.png" type="Texture" id=2]
|
|
||||||
[ext_resource path="res://art/playerGrey_walk2.png" type="Texture" id=3]
|
|
||||||
[ext_resource path="res://art/playerGrey_up1.png" type="Texture" id=4]
|
|
||||||
[ext_resource path="res://art/playerGrey_up2.png" type="Texture" id=5]
|
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id=1]
|
|
||||||
animations = [ {
|
|
||||||
"frames": [ ExtResource( 2 ), ExtResource( 3 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "right",
|
|
||||||
"speed": 5.0
|
|
||||||
}, {
|
|
||||||
"frames": [ ExtResource( 4 ), ExtResource( 5 ) ],
|
|
||||||
"loop": true,
|
|
||||||
"name": "up",
|
|
||||||
"speed": 5.0
|
|
||||||
} ]
|
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape2D" id=2]
|
|
||||||
radius = 26.1701
|
|
||||||
height = 14.822
|
|
||||||
|
|
||||||
[sub_resource type="Gradient" id=3]
|
|
||||||
colors = PoolColorArray( 1, 1, 1, 0.501961, 1, 1, 1, 0 )
|
|
||||||
|
|
||||||
[sub_resource type="GradientTexture" id=4]
|
|
||||||
gradient = SubResource( 3 )
|
|
||||||
|
|
||||||
[sub_resource type="Curve" id=5]
|
|
||||||
_data = [ Vector2( 0.00501098, 0.5 ), 0.0, 0.0, 0, 0, Vector2( 0.994989, 0.324 ), 0.0, 0.0, 0, 0 ]
|
|
||||||
|
|
||||||
[sub_resource type="CurveTexture" id=6]
|
|
||||||
curve = SubResource( 5 )
|
|
||||||
|
|
||||||
[sub_resource type="ParticlesMaterial" id=7]
|
|
||||||
flag_disable_z = true
|
|
||||||
gravity = Vector3( 0, 0, 0 )
|
|
||||||
initial_velocity = 1.0
|
|
||||||
orbit_velocity = 0.0
|
|
||||||
orbit_velocity_random = 0.0
|
|
||||||
scale = 0.75
|
|
||||||
scale_curve = SubResource( 6 )
|
|
||||||
color_ramp = SubResource( 4 )
|
|
||||||
|
|
||||||
[node name="Player" type="Area2D"]
|
|
||||||
z_index = 10
|
|
||||||
script = ExtResource( 1 )
|
|
||||||
__meta__ = {
|
|
||||||
"_edit_group_": true
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite" parent="."]
|
|
||||||
scale = Vector2( 0.5, 0.5 )
|
|
||||||
frames = SubResource( 1 )
|
|
||||||
animation = "right"
|
|
||||||
|
|
||||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
|
||||||
shape = SubResource( 2 )
|
|
||||||
|
|
||||||
[node name="Trail" type="Particles2D" parent="."]
|
|
||||||
z_index = -1
|
|
||||||
amount = 10
|
|
||||||
speed_scale = 2.0
|
|
||||||
local_coords = false
|
|
||||||
process_material = SubResource( 7 )
|
|
||||||
texture = ExtResource( 2 )
|
|
||||||
[connection signal="body_entered" from="." to="." method="_on_Player_body_entered"]
|
|
||||||
@@ -4,26 +4,30 @@ This is a simple game where your character must move
|
|||||||
and avoid the enemies for as long as possible.
|
and avoid the enemies for as long as possible.
|
||||||
|
|
||||||
This is a finished version of the game featured in the
|
This is a finished version of the game featured in the
|
||||||
["Your first game"](https://docs.godotengine.org/en/latest/getting_started/step_by_step/your_first_game.html)
|
["Your first 2D game"](https://docs.godotengine.org/en/latest/getting_started/first_2d_game/index.html)
|
||||||
tutorial in the documentation. For more details,
|
tutorial in the documentation. For more details,
|
||||||
consider following the tutorial in the documentation.
|
consider following the tutorial in the documentation.
|
||||||
|
|
||||||
Language: GDScript
|
Language: GDScript
|
||||||
|
|
||||||
Renderer: GLES 3 (particles are not available in GLES 2)
|
Renderer: Compatibility
|
||||||
|
|
||||||
Note: There is a C# version available [here](https://github.com/godotengine/godot-demo-projects/tree/master/mono/dodge_the_creeps).
|
> [!NOTE]
|
||||||
|
>
|
||||||
|
> There is a C# version available [here](https://github.com/godotengine/godot-demo-projects/tree/master/mono/dodge_the_creeps).
|
||||||
|
|
||||||
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/515
|
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2712
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Copying
|
## Copying
|
||||||
|
|
||||||
`art/House In a Forest Loop.ogg` Copyright © 2012 [HorrorPen](https://opengameart.org/users/horrorpen), [CC-BY 3.0: Attribution](http://creativecommons.org/licenses/by/3.0/). Source: https://opengameart.org/content/loop-house-in-a-forest
|
`art/House In a Forest Loop.ogg` Copyright © 2012 [HorrorPen](https://opengameart.org/users/horrorpen), [CC-BY 3.0: Attribution](https://creativecommons.org/licenses/by/3.0/). Source: https://opengameart.org/content/loop-house-in-a-forest
|
||||||
|
|
||||||
Images are from "Abstract Platformer". Created in 2016 by kenney.nl, [CC0 1.0 Universal](http://creativecommons.org/publicdomain/zero/1.0/). Source: https://www.kenney.nl/assets/abstract-platformer
|
Images are from "Abstract Platformer". Created in 2016 by kenney.nl, [CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/). Source: https://www.kenney.nl/assets/abstract-platformer
|
||||||
|
|
||||||
Font is "Xolonium". Copyright © 2011-2016 Severin Meyer <sev.ch@web.de>, with Reserved Font Name Xolonium, SIL open font license version 1.1. Details are in `fonts/LICENSE.txt`.
|
Font is "Xolonium". Copyright © 2011-2016 Severin Meyer <sev.ch@web.de>, with Reserved Font Name Xolonium, SIL open font license version 1.1. Details are in `fonts/LICENSE.txt`.
|
||||||
|
|||||||
@@ -1,15 +1,19 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="ogg_vorbis"
|
importer="oggvorbisstr"
|
||||||
type="AudioStreamOGGVorbis"
|
type="AudioStreamOggVorbis"
|
||||||
path="res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr"
|
uid="uid://sgfduhhw4pno"
|
||||||
|
path="res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/House In a Forest Loop.ogg"
|
source_file="res://art/House In a Forest Loop.ogg"
|
||||||
dest_files=[ "res://.import/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggstr" ]
|
dest_files=["res://.godot/imported/House In a Forest Loop.ogg-1a6a72ae843ad792b7039931227e8d50.oggvorbisstr"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
loop=true
|
loop=true
|
||||||
loop_offset=0
|
loop_offset=0.0
|
||||||
|
bpm=0.0
|
||||||
|
beat_count=0
|
||||||
|
bar_beats=4
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex"
|
uid="uid://dun74wipekpfq"
|
||||||
|
path="res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/enemyFlyingAlt_1.png"
|
source_file="res://art/enemyFlyingAlt_1.png"
|
||||||
dest_files=[ "res://.import/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.stex" ]
|
dest_files=["res://.godot/imported/enemyFlyingAlt_1.png-559f599b16c69b112c1b53f6332e9489.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex"
|
uid="uid://vusf51hepduk"
|
||||||
|
path="res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/enemyFlyingAlt_2.png"
|
source_file="res://art/enemyFlyingAlt_2.png"
|
||||||
dest_files=[ "res://.import/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.stex" ]
|
dest_files=["res://.godot/imported/enemyFlyingAlt_2.png-31dc7310eda6e1b721224f3cd932c076.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex"
|
uid="uid://d182mv7y80xqy"
|
||||||
|
path="res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/enemySwimming_1.png"
|
source_file="res://art/enemySwimming_1.png"
|
||||||
dest_files=[ "res://.import/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.stex" ]
|
dest_files=["res://.godot/imported/enemySwimming_1.png-dd0e11759dc3d624c8a704f6e98a3d80.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex"
|
uid="uid://dmgglhdyowipd"
|
||||||
|
path="res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/enemySwimming_2.png"
|
source_file="res://art/enemySwimming_2.png"
|
||||||
dest_files=[ "res://.import/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.stex" ]
|
dest_files=["res://.godot/imported/enemySwimming_2.png-4c0cbc0732264c4ea3290340bd4a0a62.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex"
|
uid="uid://dgwhuvn7qb4iy"
|
||||||
|
path="res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/enemyWalking_1.png"
|
source_file="res://art/enemyWalking_1.png"
|
||||||
dest_files=[ "res://.import/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.stex" ]
|
dest_files=["res://.godot/imported/enemyWalking_1.png-5af6eedbe61b701677d490ffdc1e6471.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex"
|
uid="uid://dyw702efe6meu"
|
||||||
|
path="res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/enemyWalking_2.png"
|
source_file="res://art/enemyWalking_2.png"
|
||||||
dest_files=[ "res://.import/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.stex" ]
|
dest_files=["res://.godot/imported/enemyWalking_2.png-67c480ed60c35e95f5acb0436246b935.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="wav"
|
importer="wav"
|
||||||
type="AudioStreamSample"
|
type="AudioStreamWAV"
|
||||||
path="res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"
|
uid="uid://td2mgko63p61"
|
||||||
|
path="res://.godot/imported/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/gameover.wav"
|
source_file="res://art/gameover.wav"
|
||||||
dest_files=[ "res://.import/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample" ]
|
dest_files=["res://.godot/imported/gameover.wav-98c95c744b35280048c2bd093cf8a356.sample"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
@@ -17,5 +18,7 @@ force/max_rate=false
|
|||||||
force/max_rate_hz=44100
|
force/max_rate_hz=44100
|
||||||
edit/trim=true
|
edit/trim=true
|
||||||
edit/normalize=true
|
edit/normalize=true
|
||||||
edit/loop=false
|
edit/loop_mode=0
|
||||||
compress/mode=0
|
edit/loop_begin=0
|
||||||
|
edit/loop_end=-1
|
||||||
|
compress/mode=2
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex"
|
uid="uid://bcow5c46vixno"
|
||||||
|
path="res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/playerGrey_up1.png"
|
source_file="res://art/playerGrey_up1.png"
|
||||||
dest_files=[ "res://.import/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.stex" ]
|
dest_files=["res://.godot/imported/playerGrey_up1.png-6bd114d0a6beac91f48e3a7314d44564.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex"
|
uid="uid://dw3lwgwhpbfx8"
|
||||||
|
path="res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/playerGrey_up2.png"
|
source_file="res://art/playerGrey_up2.png"
|
||||||
dest_files=[ "res://.import/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.stex" ]
|
dest_files=["res://.godot/imported/playerGrey_up2.png-d6aba85f5f2675ebc7045efa7552ee79.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex"
|
uid="uid://b2aofu01vxvea"
|
||||||
|
path="res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/playerGrey_walk1.png"
|
source_file="res://art/playerGrey_walk1.png"
|
||||||
dest_files=[ "res://.import/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.stex" ]
|
dest_files=["res://.godot/imported/playerGrey_walk1.png-c4773fe7a7bf85d7ab732eb4458c2742.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
[remap]
|
[remap]
|
||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="StreamTexture"
|
type="CompressedTexture2D"
|
||||||
path="res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex"
|
uid="uid://ddjou2q6gxlfr"
|
||||||
|
path="res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
@@ -10,25 +11,30 @@ metadata={
|
|||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://art/playerGrey_walk2.png"
|
source_file="res://art/playerGrey_walk2.png"
|
||||||
dest_files=[ "res://.import/playerGrey_walk2.png-34d2d916366100182d08037c51884043.stex" ]
|
dest_files=["res://.godot/imported/playerGrey_walk2.png-34d2d916366100182d08037c51884043.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=0
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_mode=0
|
compress/uastc_level=0
|
||||||
compress/bptc_ldr=0
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
flags/repeat=0
|
compress/channel_pack=0
|
||||||
flags/filter=false
|
mipmaps/generate=false
|
||||||
flags/mipmaps=false
|
mipmaps/limit=-1
|
||||||
flags/anisotropic=false
|
roughness/mode=0
|
||||||
flags/srgb=2
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
process/fix_alpha_border=true
|
process/fix_alpha_border=true
|
||||||
process/premult_alpha=false
|
process/premult_alpha=false
|
||||||
process/HDR_as_SRGB=false
|
process/normal_map_invert_y=false
|
||||||
process/invert_color=false
|
process/hdr_as_srgb=false
|
||||||
stream=false
|
process/hdr_clamp_exposure=false
|
||||||
size_limit=0
|
process/size_limit=0
|
||||||
detect_3d=true
|
detect_3d/compress_to=1
|
||||||
svg/scale=1.0
|
|
||||||
|
|||||||
36
2d/dodge_the_creeps/fonts/Xolonium-Regular.ttf.import
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="font_data_dynamic"
|
||||||
|
type="FontFile"
|
||||||
|
uid="uid://bgv586r20ps8e"
|
||||||
|
path="res://.godot/imported/Xolonium-Regular.ttf-bc2981e3069cff4c34dd7c8e2bb73fba.fontdata"
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://fonts/Xolonium-Regular.ttf"
|
||||||
|
dest_files=["res://.godot/imported/Xolonium-Regular.ttf-bc2981e3069cff4c34dd7c8e2bb73fba.fontdata"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
Rendering=null
|
||||||
|
antialiasing=1
|
||||||
|
generate_mipmaps=false
|
||||||
|
disable_embedded_bitmaps=true
|
||||||
|
multichannel_signed_distance_field=false
|
||||||
|
msdf_pixel_range=8
|
||||||
|
msdf_size=48
|
||||||
|
allow_system_fallback=true
|
||||||
|
force_autohinter=false
|
||||||
|
modulate_color_glyphs=false
|
||||||
|
hinting=1
|
||||||
|
subpixel_positioning=4
|
||||||
|
keep_rounding_remainders=true
|
||||||
|
oversampling=0.0
|
||||||
|
Fallbacks=null
|
||||||
|
fallbacks=[]
|
||||||
|
Compress=null
|
||||||
|
compress=true
|
||||||
|
preload=[]
|
||||||
|
language_support={}
|
||||||
|
script_support={}
|
||||||
|
opentype_features={}
|
||||||
30
2d/dodge_the_creeps/hud.gd
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
extends CanvasLayer
|
||||||
|
|
||||||
|
signal start_game
|
||||||
|
|
||||||
|
func show_message(text):
|
||||||
|
$MessageLabel.text = text
|
||||||
|
$MessageLabel.show()
|
||||||
|
$MessageTimer.start()
|
||||||
|
|
||||||
|
|
||||||
|
func show_game_over():
|
||||||
|
show_message("Game Over")
|
||||||
|
await $MessageTimer.timeout
|
||||||
|
$MessageLabel.text = "Dodge the\nCreeps"
|
||||||
|
$MessageLabel.show()
|
||||||
|
await get_tree().create_timer(1).timeout
|
||||||
|
$StartButton.show()
|
||||||
|
|
||||||
|
|
||||||
|
func update_score(score):
|
||||||
|
$ScoreLabel.text = str(score)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_StartButton_pressed():
|
||||||
|
$StartButton.hide()
|
||||||
|
start_game.emit()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_MessageTimer_timeout():
|
||||||
|
$MessageLabel.hide()
|
||||||
1
2d/dodge_the_creeps/hud.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c1g57034r2c0
|
||||||
61
2d/dodge_the_creeps/hud.tscn
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
[gd_scene load_steps=5 format=3 uid="uid://b0efehuavobda"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://c1g57034r2c0" path="res://hud.gd" id="1"]
|
||||||
|
[ext_resource type="FontFile" uid="uid://bgv586r20ps8e" path="res://fonts/Xolonium-Regular.ttf" id="2_2jm3i"]
|
||||||
|
|
||||||
|
[sub_resource type="InputEventAction" id="InputEventAction_fopy7"]
|
||||||
|
action = &"start_game"
|
||||||
|
|
||||||
|
[sub_resource type="Shortcut" id="4"]
|
||||||
|
events = [SubResource("InputEventAction_fopy7")]
|
||||||
|
|
||||||
|
[node name="HUD" type="CanvasLayer"]
|
||||||
|
script = ExtResource("1")
|
||||||
|
|
||||||
|
[node name="ScoreLabel" type="Label" parent="."]
|
||||||
|
anchors_preset = 10
|
||||||
|
anchor_right = 1.0
|
||||||
|
offset_bottom = 78.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
theme_override_fonts/font = ExtResource("2_2jm3i")
|
||||||
|
theme_override_font_sizes/font_size = 60
|
||||||
|
text = "0"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="MessageLabel" type="Label" parent="."]
|
||||||
|
anchors_preset = 14
|
||||||
|
anchor_top = 0.5
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 0.5
|
||||||
|
offset_top = -79.5
|
||||||
|
offset_bottom = 79.5
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
theme_override_fonts/font = ExtResource("2_2jm3i")
|
||||||
|
theme_override_font_sizes/font_size = 60
|
||||||
|
text = "Dodge the
|
||||||
|
Creeps"
|
||||||
|
horizontal_alignment = 1
|
||||||
|
|
||||||
|
[node name="StartButton" type="Button" parent="."]
|
||||||
|
anchors_preset = 7
|
||||||
|
anchor_left = 0.5
|
||||||
|
anchor_top = 1.0
|
||||||
|
anchor_right = 0.5
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
offset_left = -90.0
|
||||||
|
offset_top = -200.0
|
||||||
|
offset_right = 90.0
|
||||||
|
offset_bottom = -100.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 0
|
||||||
|
theme_override_fonts/font = ExtResource("2_2jm3i")
|
||||||
|
theme_override_font_sizes/font_size = 60
|
||||||
|
shortcut = SubResource("4")
|
||||||
|
text = "Start"
|
||||||
|
|
||||||
|
[node name="MessageTimer" type="Timer" parent="."]
|
||||||
|
one_shot = true
|
||||||
|
|
||||||
|
[connection signal="pressed" from="StartButton" to="." method="_on_StartButton_pressed"]
|
||||||
|
[connection signal="timeout" from="MessageTimer" to="." method="_on_MessageTimer_timeout"]
|
||||||
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,34 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="StreamTexture"
|
|
||||||
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://icon.png"
|
|
||||||
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.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
|
|
||||||
BIN
2d/dodge_the_creeps/icon.webp
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
40
2d/dodge_the_creeps/icon.webp.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://dfklrdtaun0xt"
|
||||||
|
path="res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.webp"
|
||||||
|
dest_files=["res://.godot/imported/icon.webp-e94f9a68b0f625a567a797079e4d325f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
57
2d/dodge_the_creeps/main.gd
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var mob_scene: PackedScene
|
||||||
|
var score
|
||||||
|
|
||||||
|
func game_over():
|
||||||
|
$ScoreTimer.stop()
|
||||||
|
$MobTimer.stop()
|
||||||
|
$HUD.show_game_over()
|
||||||
|
$Music.stop()
|
||||||
|
$DeathSound.play()
|
||||||
|
|
||||||
|
|
||||||
|
func new_game():
|
||||||
|
get_tree().call_group(&"mobs", &"queue_free")
|
||||||
|
score = 0
|
||||||
|
$Player.start($StartPosition.position)
|
||||||
|
$StartTimer.start()
|
||||||
|
$HUD.update_score(score)
|
||||||
|
$HUD.show_message("Get Ready")
|
||||||
|
$Music.play()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_MobTimer_timeout():
|
||||||
|
# Create a new instance of the Mob scene.
|
||||||
|
var mob = mob_scene.instantiate()
|
||||||
|
|
||||||
|
# Choose a random location on Path2D.
|
||||||
|
var mob_spawn_location = get_node(^"MobPath/MobSpawnLocation")
|
||||||
|
mob_spawn_location.progress = randi()
|
||||||
|
|
||||||
|
# Set the mob's position to a random location.
|
||||||
|
mob.position = mob_spawn_location.position
|
||||||
|
|
||||||
|
# Set the mob's direction perpendicular to the path direction.
|
||||||
|
var direction = mob_spawn_location.rotation + PI / 2
|
||||||
|
|
||||||
|
# Add some randomness to the direction.
|
||||||
|
direction += randf_range(-PI / 4, PI / 4)
|
||||||
|
mob.rotation = direction
|
||||||
|
|
||||||
|
# Choose the velocity for the mob.
|
||||||
|
var velocity = Vector2(randf_range(150.0, 250.0), 0.0)
|
||||||
|
mob.linear_velocity = velocity.rotated(direction)
|
||||||
|
|
||||||
|
# Spawn the mob by adding it to the Main scene.
|
||||||
|
add_child(mob)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_ScoreTimer_timeout():
|
||||||
|
score += 1
|
||||||
|
$HUD.update_score(score)
|
||||||
|
|
||||||
|
|
||||||
|
func _on_StartTimer_timeout():
|
||||||
|
$MobTimer.start()
|
||||||
|
$ScoreTimer.start()
|
||||||
1
2d/dodge_the_creeps/main.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c4wt6ace7hycd
|
||||||
59
2d/dodge_the_creeps/main.tscn
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
[gd_scene load_steps=8 format=3 uid="uid://bggkaprn62fwm"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://c4wt6ace7hycd" path="res://main.gd" id="1_0r6n5"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://cao351pllxqpa" path="res://mob.tscn" id="2_50pww"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://bwhlkliwp13p4" path="res://player.tscn" id="3_veqnc"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://b0efehuavobda" path="res://hud.tscn" id="4_0qnje"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://sgfduhhw4pno" path="res://art/House In a Forest Loop.ogg" id="5_55d8h"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://td2mgko63p61" path="res://art/gameover.wav" id="6_hp1r0"]
|
||||||
|
|
||||||
|
[sub_resource type="Curve2D" id="1"]
|
||||||
|
_data = {
|
||||||
|
"points": PackedVector2Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 0, 0, 0, 0, 0, 480, 720, 0, 0, 0, 0, 0, 720, 0, 0, 0, 0, 0, 0)
|
||||||
|
}
|
||||||
|
point_count = 5
|
||||||
|
|
||||||
|
[node name="Main" type="Node"]
|
||||||
|
script = ExtResource("1_0r6n5")
|
||||||
|
mob_scene = ExtResource("2_50pww")
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="."]
|
||||||
|
anchors_preset = 15
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
color = Color(0.219608, 0.372549, 0.380392, 1)
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("3_veqnc")]
|
||||||
|
|
||||||
|
[node name="MobTimer" type="Timer" parent="."]
|
||||||
|
wait_time = 0.5
|
||||||
|
|
||||||
|
[node name="ScoreTimer" type="Timer" parent="."]
|
||||||
|
|
||||||
|
[node name="StartTimer" type="Timer" parent="."]
|
||||||
|
wait_time = 2.0
|
||||||
|
one_shot = true
|
||||||
|
|
||||||
|
[node name="StartPosition" type="Marker2D" parent="."]
|
||||||
|
position = Vector2(240, 450)
|
||||||
|
|
||||||
|
[node name="MobPath" type="Path2D" parent="."]
|
||||||
|
curve = SubResource("1")
|
||||||
|
|
||||||
|
[node name="MobSpawnLocation" type="PathFollow2D" parent="MobPath"]
|
||||||
|
|
||||||
|
[node name="HUD" parent="." instance=ExtResource("4_0qnje")]
|
||||||
|
|
||||||
|
[node name="Music" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = ExtResource("5_55d8h")
|
||||||
|
|
||||||
|
[node name="DeathSound" type="AudioStreamPlayer" parent="."]
|
||||||
|
stream = ExtResource("6_hp1r0")
|
||||||
|
|
||||||
|
[connection signal="hit" from="Player" to="." method="game_over"]
|
||||||
|
[connection signal="timeout" from="MobTimer" to="." method="_on_MobTimer_timeout"]
|
||||||
|
[connection signal="timeout" from="ScoreTimer" to="." method="_on_ScoreTimer_timeout"]
|
||||||
|
[connection signal="timeout" from="StartTimer" to="." method="_on_StartTimer_timeout"]
|
||||||
|
[connection signal="start_game" from="HUD" to="." method="new_game"]
|
||||||
10
2d/dodge_the_creeps/mob.gd
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
extends RigidBody2D
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
var mob_types = Array($AnimatedSprite2D.sprite_frames.get_animation_names())
|
||||||
|
$AnimatedSprite2D.animation = mob_types.pick_random()
|
||||||
|
$AnimatedSprite2D.play()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_VisibilityNotifier2D_screen_exited():
|
||||||
|
queue_free()
|
||||||
1
2d/dodge_the_creeps/mob.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://cypxpb8arjrqt
|
||||||
67
2d/dodge_the_creeps/mob.tscn
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
[gd_scene load_steps=10 format=3 uid="uid://cao351pllxqpa"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://cypxpb8arjrqt" path="res://mob.gd" id="1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dun74wipekpfq" path="res://art/enemyFlyingAlt_1.png" id="2"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://vusf51hepduk" path="res://art/enemyFlyingAlt_2.png" id="3"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dgwhuvn7qb4iy" path="res://art/enemyWalking_1.png" id="4"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dyw702efe6meu" path="res://art/enemyWalking_2.png" id="5"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d182mv7y80xqy" path="res://art/enemySwimming_1.png" id="6"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dmgglhdyowipd" path="res://art/enemySwimming_2.png" id="7"]
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="1"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("2")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("3")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"fly",
|
||||||
|
"speed": 3.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("6")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("7")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"swim",
|
||||||
|
"speed": 4.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("5")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"walk",
|
||||||
|
"speed": 4.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id="2"]
|
||||||
|
radius = 37.0
|
||||||
|
height = 100.0
|
||||||
|
|
||||||
|
[node name="Mob" type="RigidBody2D" groups=["mobs"]]
|
||||||
|
collision_mask = 0
|
||||||
|
gravity_scale = 0.0
|
||||||
|
script = ExtResource("1")
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
|
scale = Vector2(0.75, 0.75)
|
||||||
|
sprite_frames = SubResource("1")
|
||||||
|
animation = &"walk"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
rotation = 1.5708
|
||||||
|
shape = SubResource("2")
|
||||||
|
|
||||||
|
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="."]
|
||||||
|
|
||||||
|
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_VisibilityNotifier2D_screen_exited"]
|
||||||
54
2d/dodge_the_creeps/player.gd
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
extends Area2D
|
||||||
|
|
||||||
|
signal hit
|
||||||
|
|
||||||
|
@export var speed = 400 # How fast the player will move (pixels/sec).
|
||||||
|
var screen_size # Size of the game window.
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
screen_size = get_viewport_rect().size
|
||||||
|
hide()
|
||||||
|
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
var velocity = Vector2.ZERO # The player's movement vector.
|
||||||
|
if Input.is_action_pressed(&"move_right"):
|
||||||
|
velocity.x += 1
|
||||||
|
if Input.is_action_pressed(&"move_left"):
|
||||||
|
velocity.x -= 1
|
||||||
|
if Input.is_action_pressed(&"move_down"):
|
||||||
|
velocity.y += 1
|
||||||
|
if Input.is_action_pressed(&"move_up"):
|
||||||
|
velocity.y -= 1
|
||||||
|
|
||||||
|
if velocity.length() > 0:
|
||||||
|
velocity = velocity.normalized() * speed
|
||||||
|
$AnimatedSprite2D.play()
|
||||||
|
else:
|
||||||
|
$AnimatedSprite2D.stop()
|
||||||
|
|
||||||
|
position += velocity * delta
|
||||||
|
position = position.clamp(Vector2.ZERO, screen_size)
|
||||||
|
|
||||||
|
if velocity.x != 0:
|
||||||
|
$AnimatedSprite2D.animation = &"right"
|
||||||
|
$AnimatedSprite2D.flip_v = false
|
||||||
|
$Trail.rotation = 0
|
||||||
|
$AnimatedSprite2D.flip_h = velocity.x < 0
|
||||||
|
elif velocity.y != 0:
|
||||||
|
$AnimatedSprite2D.animation = &"up"
|
||||||
|
rotation = PI if velocity.y > 0 else 0
|
||||||
|
|
||||||
|
|
||||||
|
func start(pos):
|
||||||
|
position = pos
|
||||||
|
rotation = 0
|
||||||
|
show()
|
||||||
|
$CollisionShape2D.disabled = false
|
||||||
|
|
||||||
|
|
||||||
|
func _on_body_entered(_body):
|
||||||
|
hide() # Player disappears after being hit.
|
||||||
|
hit.emit()
|
||||||
|
# Must be deferred as we can't change physics properties on a physics callback.
|
||||||
|
$CollisionShape2D.set_deferred(&"disabled", true)
|
||||||
1
2d/dodge_the_creeps/player.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://6s0lxctks3qn
|
||||||
75
2d/dodge_the_creeps/player.tscn
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
[gd_scene load_steps=13 format=3 uid="uid://bwhlkliwp13p4"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://6s0lxctks3qn" path="res://player.gd" id="1"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b2aofu01vxvea" path="res://art/playerGrey_walk1.png" id="2"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ddjou2q6gxlfr" path="res://art/playerGrey_walk2.png" id="3"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bcow5c46vixno" path="res://art/playerGrey_up1.png" id="4"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dw3lwgwhpbfx8" path="res://art/playerGrey_up2.png" id="5"]
|
||||||
|
|
||||||
|
[sub_resource type="SpriteFrames" id="1"]
|
||||||
|
animations = [{
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("2")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("3")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"right",
|
||||||
|
"speed": 5.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("4")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("5")
|
||||||
|
}],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"up",
|
||||||
|
"speed": 5.0
|
||||||
|
}]
|
||||||
|
|
||||||
|
[sub_resource type="CapsuleShape2D" id="2"]
|
||||||
|
radius = 27.0
|
||||||
|
height = 68.0
|
||||||
|
|
||||||
|
[sub_resource type="Gradient" id="3"]
|
||||||
|
colors = PackedColorArray(1, 1, 1, 0.501961, 1, 1, 1, 0)
|
||||||
|
|
||||||
|
[sub_resource type="GradientTexture1D" id="4"]
|
||||||
|
gradient = SubResource("3")
|
||||||
|
|
||||||
|
[sub_resource type="Curve" id="5"]
|
||||||
|
_data = [Vector2(0.00501098, 0.5), 0.0, 0.0, 0, 0, Vector2(0.994989, 0.324), 0.0, 0.0, 0, 0]
|
||||||
|
point_count = 2
|
||||||
|
|
||||||
|
[sub_resource type="CurveTexture" id="6"]
|
||||||
|
curve = SubResource("5")
|
||||||
|
|
||||||
|
[sub_resource type="ParticleProcessMaterial" id="7"]
|
||||||
|
gravity = Vector3(0, 0, 0)
|
||||||
|
scale_curve = SubResource("6")
|
||||||
|
color_ramp = SubResource("4")
|
||||||
|
|
||||||
|
[node name="Player" type="Area2D"]
|
||||||
|
z_index = 10
|
||||||
|
script = ExtResource("1")
|
||||||
|
|
||||||
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
|
scale = Vector2(0.5, 0.5)
|
||||||
|
sprite_frames = SubResource("1")
|
||||||
|
animation = &"right"
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource("2")
|
||||||
|
|
||||||
|
[node name="Trail" type="GPUParticles2D" parent="."]
|
||||||
|
z_index = -1
|
||||||
|
amount = 10
|
||||||
|
texture = ExtResource("2")
|
||||||
|
speed_scale = 2.0
|
||||||
|
process_material = SubResource("7")
|
||||||
|
|
||||||
|
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||||
@@ -6,12 +6,7 @@
|
|||||||
; [section] ; section goes between []
|
; [section] ; section goes between []
|
||||||
; param=value ; assign values to parameters
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
config_version=4
|
config_version=5
|
||||||
|
|
||||||
_global_script_classes=[ ]
|
|
||||||
_global_script_class_icons={
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[application]
|
[application]
|
||||||
|
|
||||||
@@ -19,48 +14,64 @@ config/name="Dodge the Creeps"
|
|||||||
config/description="This is a simple game where your character must move
|
config/description="This is a simple game where your character must move
|
||||||
and avoid the enemies for as long as possible.
|
and avoid the enemies for as long as possible.
|
||||||
|
|
||||||
This is a finished version of the game featured in the 'Your first game'
|
This is a finished version of the game featured in the 'Your first 2D game'
|
||||||
tutorial in the documentation. For more details, consider
|
tutorial in the documentation. For more details, consider
|
||||||
following the tutorial in the documentation."
|
following the tutorial in the documentation."
|
||||||
run/main_scene="res://Main.tscn"
|
config/tags=PackedStringArray("2d", "demo", "official")
|
||||||
config/icon="res://icon.png"
|
run/main_scene="res://main.tscn"
|
||||||
|
config/features=PackedStringArray("4.5")
|
||||||
|
config/icon="res://icon.webp"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
window/size/width=480
|
window/size/viewport_width=480
|
||||||
window/size/height=720
|
window/size/viewport_height=720
|
||||||
|
window/size/window_width_override=480
|
||||||
|
window/size/window_height_override=720
|
||||||
|
window/stretch/mode="canvas_items"
|
||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
move_left={
|
move_left={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.2,
|
||||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194319,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
move_right={
|
move_right={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.2,
|
||||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194321,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
move_up={
|
move_up={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.2,
|
||||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194320,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
move_down={
|
move_down={
|
||||||
"deadzone": 0.5,
|
"deadzone": 0.2,
|
||||||
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194322,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||||
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
start_game={
|
||||||
|
"deadzone": 0.2,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":4194309,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
renderer/rendering_method="gl_compatibility"
|
||||||
|
renderer/rendering_method.mobile="gl_compatibility"
|
||||||
|
|||||||
BIN
2d/dodge_the_creeps/screenshots/dodge.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
20
2d/dynamic_tilemap_layers/README.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Dynamic TileMap Layers
|
||||||
|
|
||||||
|
Example of how to make a fake wall using TileMap's
|
||||||
|
`_tile_data_runtime_update()` method. It shows how
|
||||||
|
to disable collisions per layer.
|
||||||
|
|
||||||
|
Language: GDScript
|
||||||
|
|
||||||
|
Renderer: Compatibility
|
||||||
|
|
||||||
|
Check out this demo on the asset library: https://godotengine.org/asset-library/asset/2713
|
||||||
|
|
||||||
|
## Note
|
||||||
|
|
||||||
|
The new TileMapLayer introduced in Godot 4.3 allows disabling collisions for a layer dynamically using a checkbox in the inspector.
|
||||||
|
For earlier Godot versions use the procedure described here.
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|

|
||||||
BIN
2d/dynamic_tilemap_layers/icon.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
40
2d/dynamic_tilemap_layers/icon.png.import
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bu5nu8i7xk5ot"
|
||||||
|
path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.png"
|
||||||
|
dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
BIN
2d/dynamic_tilemap_layers/level/obstacle.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |