Computer Science Canada How do i get the circle to move? |
Author: | DBZ [ Thu Nov 20, 2003 4:07 pm ] |
Post subject: | How do i get the circle to move? |
i need to move the circle in the middle of the screen faster and i just can't get the circle out of the left side of the screen. i have attatched my program for u to see the problem! Thanx. |
Author: | Mazer [ Thu Nov 20, 2003 4:42 pm ] | ||||||||
Post subject: | |||||||||
oh my... let's start with:
it seems to me, that you're trying to use this to clear the screen, because that's all it would be useful for. it's be better to use cls but at the beginning of the program it's useless because it doesn't have anything to clear.
it doesn't make much sense to use a procedure for only one line of code, but that's up to you to decide. the main problem here is that you're trying to use the row and column for the x and y coordinates of the center of the circle. that's what's causing the circle to just move around the bottom left corner. it'd be better to use x and y variables to keep track of the position of the circle on the screen in pixels.
that exit statement by itself isn't good for much because once it exits the inner loop, the column is < 1 or > 80 or the row < 1 or > 25 so you're going to be stuck in an endless loop. you should have some way to reset the variables after exiting that loop. also, you had the delay in the wrong spot. you should draw, delay, then clear the screen. try something like this:
it doesn't really look like a smoke motion, but maybe you can get something closer to what you wanted if you play around with it a bit. and feel free to ask me for help if you have trouble with any of that. |
Author: | Andy [ Fri Nov 21, 2003 6:59 pm ] |
Post subject: | |
wow, nick, you just love to show off your madd turing skillz eh? lol jk |
Author: | Tendulkar [ Thu Dec 04, 2003 10:26 pm ] |
Post subject: | Re: How do i get the circle to move? |
Here is your program ![]() |
Author: | Andy [ Thu Dec 04, 2003 10:29 pm ] |
Post subject: | |
DBZ do you go to massey? |