Game Development Reference
In-Depth Information
Adding keyboard control code
Next you'll add the code to the I]ej[?d]n]_pan*]o file to make the character move. You'll recognize
the format you're using from other projects in the topic, but some of the specifics are new. Add the
new code carefully! (If you don't feel like typing out all this code, you'll find the I]ej[?d]n]_pan*]o
file in the chapter's source files in the ?d]n]_pan?kjpnkh subfolder.)
1. Open the I]ej[?d]n]_pan*]o file and add the following code:
l]_g]ca
w
eilknpbh]od*`eolh]u*Ikrea?hel7
eilknpbh]od*arajpo*Gau^k]n`Arajp7
eilknpbh]od*qe*Gau^k]n`7
lq^he__h]ooI]ej[?d]n]_panatpaj`oIkrea?hel
w
lq^he_bqj_pekjI]ej[?d]n]_pan$%
w
ejep$%7
y
bqj_pekjejep$%6rke`
w
op]ca*]``ArajpHeopajan$Gau^k]n`Arajp*GAU[@KSJ(kjGau@ksj%7
y
bqj_pekjkjGau@ksj$arajp6Gau^k]n`Arajp%6rke`
w
eb$arajp*gau?k`a99Gau^k]n`*HABP%
w
lh]uan*t)9-,7
y
ahoaeb$arajp*gau?k`a99Gau^k]n`*NECDP%
w
lh]uan*t'9-,7
y
ahoaeb$arajp*gau?k`a99Gau^k]n`*@KSJ%
w
lh]uan*u'9-,7
y
ahoaeb$arajp*gau?k`a99Gau^k]n`*QL%
w
lh]uan*u)9-,7
y
y
y
y
2. Save the I]ej[?d]n]_pan*]o file and test the project.
 
Search Nedrilad ::




Custom Search