Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need help with golf game.
Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
RGB255




PostPosted: Mon Oct 09, 2006 9:00 pm   Post subject: Need help with golf game.

Okay so I had to make a golf game for school and I have it completed but when I draw the ball I have to use a loop to fill it in and I use a timer to move the ball when the player hits it. I ball is supposed to appear to roll or slow to a stop but the ball looks like it shrinks and grows larger and shrinks and grows larger as it moves but doesn't when it has stoped. So is there a better way to draw an object because we can't use pictures for the ball. Sorry I don't have the code it's at school.
Sponsor
Sponsor
Sponsor
sponsor
Silent Avenger




PostPosted: Mon Oct 09, 2006 9:06 pm   Post subject: (No subject)

The problem is that every time you draw your ball when it moves it will start off small and grow bigger. I suggest you draw a ball that get's smaller so from the outside in and it will be less obvious. There is also another way to draw objects that are filled in. You can use the fill style of an object to fill in an enclosed object and this will eliminate the appearance of a "growing" golf ball.
RGB255




PostPosted: Mon Oct 09, 2006 9:12 pm   Post subject: (No subject)

Okay thanks. I'll try that as soon as I get to class tomorrow.
tifg




PostPosted: Wed Dec 20, 2006 10:13 pm   Post subject: (No subject)

what? there are other ways to fill a circle? lmao./.. the only way i kno is
fillstyle= w/e
fillcolor= w/e
...
wut code do u use for the otehr way?
nd how do u fill a random shape (ie u draw 4 enclosed lines nd fill the space inside)
Silent Avenger




PostPosted: Wed Dec 20, 2006 11:22 pm   Post subject: (No subject)

The other way to fill a circle is to use a loop like so:
code:
For x = 1 to 10 step 0.1
       form1.circle (10, 10), x, RGB(0, 0, 0)
next x

As you can see this will draw a hollow circle with the centre at point 10, 10. As the loop goes through the circle will get bigger and bigger and eventually draw a filled in circle. Also I'm sure there is a way to fill in a four sided shape either by changing the draw width of a line to make it fill in the shape you want or by drawing many lines and using mathematics to fill it in.
tifg




PostPosted: Wed Dec 20, 2006 11:26 pm   Post subject: (No subject)

Silent Avenger wrote:
The other way to fill a circle is to use a loop like so:
code:
For x = 1 to 10 step 0.1
       form1.circle (10, 10), x, RGB(0, 0, 0)
next x

As you can see this will draw a hollow circle with the centre at point 10, 10. As the loop goes through the circle will get bigger and bigger and eventually draw a filled in circle. Also I'm sure there is a way to fill in a four sided shape either by changing the draw width of a line to make it fill in the shape you want or by drawing many lines and using mathematics to fill it in.


oh i see.. i thought there was another code function for filling a circle...
and yea, now i just draw 3 or 4 lines very close together and have them move to their spots with a for loop w/o delay so the finished product looks solid.. but on some slow computers you can actually see the lines moving which sucks but o well
Display posts from previous:   
   Index -> Programming, Visual Basic and Other Basics -> Visual Basic Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: