Skip to content

dori-04/Traffic-Light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 

Repository files navigation

Animation

  • ์–ธ์–ด: ํ”„๋กœ์„ธ์‹ฑ
  1. setup() ํ•จ์ˆ˜์—์„œ noCursor()๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ๊ธฐ๋ณธ ๋งˆ์šฐ์Šค ํฌ์ธํ„ฐ๋ฅผ ์ˆจ๊น๋‹ˆ๋‹ค. ๋งˆ์šฐ์Šค ํฌ์ธํŠธ๋Š” ์ž๋™์ฐจ๋กœ ๋Œ€์ฒดํ•ฉ๋‹ˆ๋‹ค.
  2. draw() ํ•จ์ˆ˜์—์„œ ๋ฐฐ๊ฒฝ, ๋„๋กœ, ํšก๋‹จ๋ณด๋„, ์‹ ํ˜ธ๋“ฑ, ๊ทธ๋ฆฌ๊ณ  ์ž๋™์ฐจ๋ฅผ ๊ทธ๋ฆฝ๋‹ˆ๋‹ค.
  3. drawRoad() ํ•จ์ˆ˜๋Š” ํ™”๋ฉด ์ค‘์•™์— ์ˆ˜์ง ๋„๋กœ๋ฅผ ๊ทธ๋ฆฝ๋‹ˆ๋‹ค.
  4. drawCrosswalk() ํ•จ์ˆ˜๋Š” ํ™”๋ฉด ์ค‘์•™์— ํšก๋‹จ๋ณด๋„๋ฅผ ๊ฐ€๋กœ๋กœ ๊ทธ๋ฆฝ๋‹ˆ๋‹ค. ์ด๋•Œ stroke() ํ•จ์ˆ˜๋กœ ์ธํ•ด ์‹ ํ˜ธ๋“ฑ๊ณผ ์ž๋™์ฐจ์—๋„ ์˜ํ–ฅ์ด ๊ฐ”๋Š”๋ฐ, ํšก๋‹จ๋ณด๋„๋ฅผ ๊ทธ๋ฆฐ ๋’ค์— noStroke()๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ•ด๊ฒฐํ•ฉ๋‹ˆ๋‹ค.
  5. drawTrafficLight() ํ•จ์ˆ˜๋Š” ์˜ค๋ฅธ์ชฝ ์ƒ๋‹จ์— ์‹ ํ˜ธ๋“ฑ์„ ๊ทธ๋ฆฝ๋‹ˆ๋‹ค.
  6. drawCar() ํ•จ์ˆ˜๋Š” ์ฃผ์–ด์ง„ ์œ„์น˜์— ์ž๋™์ฐจ๋ฅผ ๊ทธ๋ฆฌ๋ฉฐ, ์ž๋™์ฐจ๊ฐ€ ๋„๋กœ ๋‚ด์— ์œ„์น˜ํ•˜๋„๋ก ์ œํ•œํ•ฉ๋‹ˆ๋‹ค.
  7. draw() ํ•จ์ˆ˜์—์„œ ๋„๋กœ ์ค‘์‹ฌ(x ์ขŒํ‘œ 200)๊ณผ ๋งˆ์šฐ์Šค ์œ„์น˜ ๊ฐ„์˜ ๊ฑฐ๋ฆฌ๋ฅผ ๊ณ„์‚ฐํ•˜๊ณ , ๊ฑฐ๋ฆฌ์— ๋”ฐ๋ผ ์‹ ํ˜ธ๋“ฑ์˜ ์ƒํƒœ๋ฅผ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published