Valhalla Legends Forums Archive | C/C++ Programming | Using arrow keys

AuthorMessageTime
MoNksBaNe_Agahnim
I found the hexdecimal code for using the arrow keys, how would i plug it in to make an X that appears on the screen (know how to output an "x" hehe) be able to move the X around the screen?

[edit]:change of subject
November 17, 2003, 12:08 AM
Spht
Variables X and Y store the location of "X." When KeyDown is pressed, Y += 1; when KeyUp is pressed, Y -= 1; when KeyRight is pressed, X += 1; when KeyLeft is pressed, X -= 1.

When you're done that, draw an "X" (how to do that depends on what you're using) at the coordinates X, Y.
November 17, 2003, 2:28 AM
Eibro
See: SetConsoleCursorPosition()
November 17, 2003, 2:30 AM
iago
[quote author=Spht link=board=30;threadid=3658;start=0#msg29634 date=1069036100]
Variables X and Y store the location of "X." When KeyDown is pressed, Y += 1; when KeyUp is pressed, Y -= 1; when KeyRight is pressed, X += 1; when KeyLeft is pressed, X -= 1.

When you're done that, draw an "X" (how to do that depends on what you're using) at the coordinates X, Y.
[/quote]

I think he was more concerned about how to draw the x in c++ :P
November 17, 2003, 8:45 AM
Spht
[quote author=iago link=board=30;threadid=3658;start=0#msg29658 date=1069058742]
[quote author=Spht link=board=30;threadid=3658;start=0#msg29634 date=1069036100]
Variables X and Y store the location of "X." When KeyDown is pressed, Y += 1; when KeyUp is pressed, Y -= 1; when KeyRight is pressed, X += 1; when KeyLeft is pressed, X -= 1.

When you're done that, draw an "X" (how to do that depends on what you're using) at the coordinates X, Y.
[/quote]

I think he was more concerned about how to draw the x in c++ :P
[/quote]

Redundant help is better than no help.
November 17, 2003, 6:28 PM

Search