Tiny Cursor Key Snippet

Previous topic - Next topic

spicypixel

Code (glbasic) Select

// .-------------------------------.
// | Check Cursor Keys             |
// '-------------------------------'
dx = KEY(205)-KEY(203)
dy = KEY(208)-KEY(200)
INC x,dx ; INC y,dy
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

bigsofty

Nice, lots of directions from only 3 lines!  :D
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Ruidesco


kanonet

Old, but still good. =D
http://www.glbasic.com/forum/index.php?topic=1019.0

Btw i like the 2-line version more.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

spicypixel

Quote from: kanonet on 2011-Oct-11
Old, but still good. =D
http://www.glbasic.com/forum/index.php?topic=1019.0

Btw i like the 2-line version more.

Haha love it too :) Uber Optimisation :D
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.