1. Grass_spawn ์— Grass ๊ฐ€ ์ธ์Šคํ„ด์Šค ๋œ ์ƒํƒœ๋กœ ์‹œ์ž‘ํ•จ


GS

ใ„ดG



2. ์‹ ํ˜ธ Hurtbox ๊ฐ€ ์™€์„œ


Grass ์— GrassEffect ๋ฅผ ์ธ์Šคํ„ด์Šคํ•˜๊ณ 


์‹ ํ˜ธ grassDestroyed ๋ฅผ ๋ณด๋‚ด๊ณ 


Grass GrassEffect ๊ฐ™์ด queue_free ๋จ


GS

ใ„ดG

ใ„ดGE


->


GS



3. ์‹ ํ˜ธ grassDestroyed ๋ฅผ ๋ฐ›์€ Grass_spawn ์€ Grass ๋ฅผ ๋‹ค์‹œ ์ธ์Šคํ„ด์Šคํ•จ


GS

ใ„ดG`



1-2-3-2-3-2-3-... ์ด๋ ‡๊ฒŒ ๋งŒ๋“ค๊ณ ์‹ถ์€๋ฐ


1-2-3-2 ์—์„œ ๋ฉˆ์ถฐ



๋งˆ์ง€๋ง‰ 2๋ฒˆ์—์„œ


์‹ ํ˜ธ Hurtbox ๊ฐ€ ์™€์„œ


Grass_spawn ์— GrassEffect ๋ฅผ ์ธ์Šคํ„ด์Šคํ•˜๊ณ 


Grass GrassEffect ๊ฐ™์ด queue_free ๋จ


์ด๊ฑด ๋‹ค ๋˜๋Š”๋ฐ



print("์„น์Šค") ์ด๋Ÿฐ๊ฑฐ ๋ผ์›Œ๋ณด๋‹ˆ๊นŒ


2๋ฒˆ์—์„œ ์‹ ํ˜ธ grassDestoryed ๊ฐ€ ์•ˆ๋ณด๋‚ด์ง€๊ฑฐ๋‚˜


3๋ฒˆ์—์„œ ์•ˆ๋ฐ›์•„์ง


์‹ ํ˜ธ ๋‹ค์‹œ ๋ณด๋‚ด๊ฑฐ๋‚˜ ๋ฐ›์œผ๋ ค๋ฉด ๋‹ค๋ฅธ ์ฝ”๋“œ ์จ์•ผ๋˜์„œ ์ดˆ๊ธฐํ™”ํ•ด์•ผ๋˜๋Š”๊ฑฐ ์ž‡์Œ?


02


Grass.gd


viewimage.php?id=2abcdd23dad63db0&no=24b0d769e1d32ca73cec85fa11d028318672c324147e3f6f5673e300c8e3092fc24cdbad703662d378ae19acbbce03b2215d5114f71adc4a953d25876e575e96404fe3ed


Grass_spawn.gd


viewimage.php?id=2abcdd23dad63db0&no=24b0d769e1d32ca73cec85fa11d028318672c324147e3f6f5673e300c8e3092fc24cdbad703662d378ae19acbbce03b2215d5114f71adc4ace6f218863550ac08804bb86



1๋ฒˆ์งค emit_signal("grassDestroyed") ๊ฐ€ ์•ˆ๋˜๊ฑฐ๋‚˜


2๋ฒˆ์งค func _on_Grass_grassDestroyed(): ๊ฐ€ ์•ˆ๋Œ


destoryed ๋˜์ž‡๋Š” ์˜คํƒ€๋Š” ๋‹ค ๊ณ ์นจ