Used methods in Tutorial part 2 - ilovethisid/Educational-Ascii-Game-engine GitHub Wiki

Tutorial part 2 : Player movement์—์„œ ์‚ฌ์šฉ๋œ EAG engine component๋“ค์„ ์†Œ๊ฐœํ•ฉ๋‹ˆ๋‹ค.

Table Of Contents

checkKey

updateLoop()๊ฐ€ ํ˜ธ์ถœ๋˜๊ธฐ ์ง์ „์— ์‹คํ–‰๋˜๋ฉฐ, KeyListener๋ฅผ ๊ตฌํ˜„ํ•˜๋Š” ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค.

checkMove

Rigidbody์˜ ์ด๋™์— ๊ด€๋ จ๋œ ๊ธฐ๋Šฅ๋“ค์„ ๊ตฌํ˜„ํ–ˆ์Šต๋‹ˆ๋‹ค.

KeyListener

Used methods

keycheck

bool keycheck(int key)

key code๋ฅผ ๋„˜๊ฒจ์ฃผ๋ฉด ํ˜„์žฌ ํ•ด๋‹น key๊ฐ€ ๋ˆŒ๋ ค์žˆ๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

Arguments
Name Value Description
key int ํ™•์ธํ•  ํ‚ค์˜ ์ฝ”๋“œ๊ฐ’

Rigidbody

Used methods

setVelocity

void Rigidbody::setVelocity(int x, int y)

Rigidbody์˜ ์†๋„๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. move()๋ฅผ ํ†ตํ•ด ์„ค์ •๋œ ์†๋„๋กœ Rigidbody๋ฅผ ์›€์ง์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Arguments
Name Value Description
x int ์„ค์ •ํ•  x์ถ• ๋ฐฉํ–ฅ ์†๋„
y int ์„ค์ •ํ•  y์ถ• ๋ฐฉํ–ฅ ์†๋„

Object

Used methods

move

void Object::move(vector<Object*>& objects)

์„ค์ •๋œ ์†๋„๋กœ Object๋ฅผ ์›€์ง์ž…๋‹ˆ๋‹ค.

Arguments
Name Value Description
objects vector<Object*> ์ฒ˜๋ฆฌํ•  Object๊ฐ€ ๋‹ด๊ธด vector
โš ๏ธ **GitHub.com Fallback** โš ๏ธ