Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / 2D box drawing in a Loop

Author
Message
Shawn D
20
Years of Service
User Offline
Joined: 15th Jan 2004
Location:
Posted: 2nd Feb 2004 01:46
Can someone please help me with this code. I wanna have a red currsor controled by the keyboard, but the screen just wont refresh when i try to change it. Its like it only gets rendered once and i cant chage it after that. Thanks

ShawnD
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 2nd Feb 2004 02:30 Edited at: 2nd Feb 2004 02:45
OK, some minor adjustments:



1) You did not reset X to zero when redrawing the board....

Line 41: X = 0

...so when X was too high the board ended up being off the screen.


2) You didn't set a limit for CursorY...

Line 37: if CursorY = 8 then CursorY = 7

...that also went zooming off the screen.

3) As you are continuiosly redrawing the board, I've moved "Draw Cursor" out of the while/endwhile loop


If you can follow this alternative code, then perhaps this could be of use to you.


Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.

Login to post a reply

Server time is: 2024-05-13 15:53:07
Your offset time is: 2024-05-13 15:53:07