- ํ์ด์ฌ์ ์ด์ฉํด์ ๊ฒ์์ ๋ง๋ค์ด๋ณด์!
The Game
- ๊ฒ์ ์๊ฐ
A game of Ants Vs. SomeBees consists of a series of turns. In each turn, new bees may enter the ant colony. Then, new ants are placed to defend their colony. Finally, all insects (ants, then bees) take individual actions. Bees either try to move toward the end of the tunnel or sting ants in their way. Ants perform a different action depending on their type, such as collecting more food or throwing leaves at the bees. The game ends either when a bee reaches the end of the tunnel (you lose), the bees destroy the QueenAnt if it exists (you lose), or the entire bee fleet has been vanquished (you win).๋งค turn๋ง๋ค ์๋ก์ด ๊ฟ๋ฒ์ด ๊ฐ๋ฏธ์ง๋จ์ ๋ค์ด๊ฐ ์ ์๋ค.
์๋ก์ด ๊ฐ๋ฏธ๋ฅผ ๋ฐฐ์นํด์ Colony๋ฅผ ๋ฐฉ์ดํ๋ค.
๋ชจ๋ ๊ณค์ถฉ์ ๊ฐ๋ณ ํ๋์ ์ทจํ๋ค.
๊ฟ๋ฒ์ ํฐ๋ ๋์ผ๋ก ์ด๋ํ๊ฑฐ๋ ๋ฐฉํดํ๋ ๊ฐ๋ฏธ๋ฅผ ์๋ค.
๊ฐ๋ฏธ๋ ๊ทธ ์ข
๋ฅ์ ๋ฐ๋ผ ๋ ๋ง์ ์์ ์์ง์ด๋ ๊ฟ๋ฒ์๊ฒ ๋๋ญ์ ๋์ง๋ ๋ฑ๊ณผ ๊ฐ์ ํ๋์ ํ๋ค.
์ด ๊ฒ์์ ๊ฟ๋ฒ์ด ํฐ๋ ๋์ ๋๋ฌํ๊ฑฐ๋(lose)
๊ฟ๋ฒ QueenAnt๊ฐ ์กด์ฌํ๋ฉด ์ด๋ฅผ ํ๊ดดํ๊ฑฐ๋(lose)
์ ์ฒด ๊ฟ๋ฒ์ด ์ ๋ณต๋์์ ๋(win) ๋๋๋ค.
- ํต์ฌ ๊ฐ๋
The Colony: ๊ฒ์์ด ์ผ์ด๋๋ ์ฅ์, ์ฌ๋ฌ ๊ฐ์ Places๋ก ์ด๋ฃจ์ด์ง๋ค. ํฐ๋๋ก ์๋ก ์ฐ๊ฒฐ๋์ด์ bee๋ค์ด ๊ทธ ์์ผ๋ก travelํ ์ ์์.
colony๋ ant๋ฅผ ํฐ๋์ ๋ฃ๊ธฐ ์ํด ์๋น๋ ์ ์๋ ์ ๋น๋์ food๊ฐ ์๋ค.
Places: place๋ ํฐ๋์์ ๋ค๋ฅธ place๋ก ์ฐ๊ฒฐํ๋ค. player๋ ํ๋์ ant๋ฅผ ๊ฐ๊ฐ์ place์ ๋ฃ์ ์ ์๋ค. ํ์ง๋ง, ํ๋์ place์๋ ๋งค์ฐ ๋ง์ bee๋ค์ด ์์ ์ ์๋ค.
The Hive: bee๋ค์ด ์์ฑ๋๋ ๊ณณ. bee๋ค์ ant colony์ ๋ค์ด๊ฐ๊ธฐ ์ํด beehive๋ฅผ ๋๊ฐ๋ค
Ants: player๋ colony์ ์ ํ๊ฐ๋ฅํ ์ข
๋ฅ์ค์ ๊ณ ๋ฅธ ants๋ฅผ ์์นํ๋ค. ๊ฐ ๊ฐ๋ฏธ์ ์ข
๋ฅ๋ ์๋ก๋ค๋ฅธ ํ๋์ ์ทจํ๋ฉฐ ์๋ก ๋ค๋ฅธ ์์ colony food๋ฅผ ์๊ตฌํ๋ค. ๋๊ฐ์ ๊ฐ์ฅ ๊ธฐ๋ณธ์ ์ธ ๊ฐ๋ฏธ ์ข
๋ฅ๋ HarvesterAnt(๊ฐ ํด๋ง๋ค colony์ 1๊ฐ์ food๋ฅผ ๋ํจ), ThrowerAnt(๊ฐ ํด๋ง๋ค bee์ leaf๋ฅผ ๋์ง)์ด๊ณ ๋๋ ๋ ๋ง์ด ๊ตฌํํ ๊ฒ์ด๋ค.
Bees: ๊ฒ์์์ bee๋ค์ํ๋ ์ด์ด๊ฐ ant colony๋ฅผ ์งํค๊ธฐ ์ํด ๋ฐฉ์ดํด์ผ ํ๋ ์ ๋ค์ด๋ค. ๋งค ํด๋ง๋ค ๊ฟ๋ฒ์ ๋ฐฉํด๋๋ ๊ฐ๋ฏธ๊ฐ ์์ผ๋ฉด ํฐ๋์ ๋ค์ ์ฅ์๋ก ์ด๋ํ๊ฑฐ๋, ๋ฐฉํดํ๋ ๊ฐ๋ฏธ๋ฅผ ์๋ค. ์ ์ด๋ ํ๋ง๋ฆฌ์ ๊ฟ๋ฒ์ด ํฐ๋ ๋์ ๋๋ฌํ๋ฉด ๊ฟ๋ฒ์ด ์ด๊ธด๋ค.
- ๊ฒ์ ๋ ์ด์์: ์๋ ์ฌ์ง์ GameState์ ์๊ฐํ์ด๋ค. ์์ผ๋ก ๋ฌธ์ ๋ฅผ ํด๊ฒฐํด ๋๊ฐ๋ฉด์ ์ด์ ๋น์ทํ ๋ค์ด์ด๊ทธ๋จ์ ๊ทธ๋ฆฌ๋ฉด์ ์ดํดํ๋๊ฑธ ์ถ์ฒํ๋ค.
- ๋ฉ์ธ ํด๋์ค๋ค
GameState: ๊ฒ์์ ๊ดํ ๊ธฐ๋ณธ ์ ๋ณด๋ค์ ๋ํ๋ด๋ ํด๋์ค
Place: ๊ณค์ถฉ๋ค ๋ณด๊ดํ๋ ํ ์ฅ์. ํ place๋ง๋ค ์ต๋1๋ง๋ฆฌ ant๊ฐ ์์ ์ ์๊ณ bee๋ ํ ์ฅ์์ ์ฌ๋ฌ๋ง๋ฆฌ ์์ ์ ์๋ค. place๊ฐ์ฒด๋ ์ผ์ชฝ ํฅํ๋ exit๋ ์ค๋ฅธ์ชฝ ํฅํ๋ entrance๊ฐ ์๋ค. ์ด ๋๊ฐ๋ place๊ฐ ์๋๋ค.
bee๋ place์ exit์ผ๋ก ์ด๋ํ๋ฉด์ ํฐ๋ ์ด๋ํจ
Hive: bee์์ํ๋ ๊ณณ
AntHomeBase: Ants๊ฐ ๋ฐฉ์ดํ๊ณ ์๋ ๊ณณ, ๋ฒ๋ค์ด ์ฌ๊ธฐ ์ค๋ฉด ๊ทธ๋ค์ด ์ด๊น
Insect: ant๋ bee์ ์์ํด๋์ค, health์์ฑ(๋จ์ health๋ํ๋), place์์ฑ(์ง๊ธ ์ด๋ ๊ณณ์ ์๋์ง๋ฅผ ๋ํ๋)์ ๊ฐ์ง๊ณ ์์. ๊ฐ ํด๋ง๋ค ๊ฒ์์ ๋ชจ๋ activeํ Insect๋ ๊ทธ๊ฒ์ ํน๋ณํ action์ ํจ.
damage ์์ฑ์ insectํด๋์ค์ ํด๋์ค ์์ฑ์ด๋ค
Ant: ants๋ฅผ ๋ํ๋, ๊ฐ ant ์๋ธํด๋์ค๋ ๋ค๋ฅธ ์ข
๋ฅ๋ค๊ณผ ๊ตฌ๋ถ์ง๋ ํน๋ณํ ์์ฑ์ด๋ action์ด ์๋ค. ex) HarvesterAnt๋ colony๋ฅผ ์ํด food๋ฅผ ๊ฐ์ ธ์ค๊ณ , ThrowerAnt๋ Bee๋ค์ ๊ณต๊ฒฉํ๋ค.
๊ฐ๊ฐ์ ant์ข
๋ฅ๋ ํ ์ข
๋ฅ์ ant์ ํ ์ ๋์ ๋ฐฐ์นํ๋ ๋ฐ ์ผ๋ง๋ ๋น์ฉ์ด ๋๋ ์ง๋ฅผ ๋ํ๋ด๋ food_cost์์ฑ์ ๊ฐ์ง๊ณ ์๋ค.
ant ์๋ธํด๋์ค์ damage์์ฑ์ ํด๋์ค์์ฑ์ด๋ค_์ด์ : ๊ฐ์ subclass์ ๋ชจ๋ ants๋ ๊ฐ์ damage๋ฅผ ๋ฐ๊ธฐ ๋๋ฌธ์
Bee: bee๋ฅผ ๋ํ๋ธ๋ค. ๊ฐ ํด๋ง๋ค bee๋ (๋ง์ฝ place๊ฐ ant์ ์ํด ๋งํ ์์ง ์๋ค๋ฉด)ํ์ฌ place์ exit์ผ๋ก ์์ง์ด๊ฑฐ๋ ๊ฐ์ place๋ฅผ ์ฐจ์งํ๊ณ ์๋ ants๋ฅผ ์๋ค.
- ๋ฌธ์ ์ดํด์ฌ๋ถ ์ง๋ฌธ
What do instances of Ant and instances of Bee have in common?
๋ต: Ants and Bees both have the attributes health, damage, and place
and the methods reduce_health and action
'๐โโ๏ธ ํ๋ > ํ๋ก์ ํธ ์์ ์ผ์ง' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
WeWish: K-Registry App (1) ํ๋ก์ ํธ ์์ (0) | 2023.01.03 |
---|---|
Project: Ants vs SomeBees(2) (0) | 2022.07.26 |
Project 2: CS 61A Autocorrected Typing Software(1) (0) | 2022.07.11 |
Phase 3: Strategies of the Game (0) | 2022.07.07 |
Hog(2): Playing the Game (0) | 2022.07.07 |