Author |
Message |
Catalyst

|
Posted: Thu May 08, 2003 10:33 pm Post subject: 2D Vector Class |
|
|
pretty basic but good for 2d movement
Description: |
|
 Download |
Filename: |
VectorClass.t |
Filesize: |
923 Bytes |
Downloaded: |
934 Time(s) |
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Homer_simpson

|
Posted: Thu May 08, 2003 10:56 pm Post subject: (No subject) |
|
|
it looks like a good class , but i've got a few problems... :
First of all i dunno what a vector is?
then i dunno what the function normalize and setangle do?
HELP!!!
|
|
|
|
|
 |
Catalyst

|
Posted: Thu May 08, 2003 11:04 pm Post subject: (No subject) |
|
|
a vector can be thought of in this case as an objects x and y speeds and thus its direction
seting the angle change the speed so that the object would go in the direction of the angle
normalizing reduce the vector down to a size of 1 (still move in the same direction. except slower
|
|
|
|
|
 |
Homer_simpson

|
Posted: Thu May 08, 2003 11:06 pm Post subject: (No subject) |
|
|
aaaaaaah... i c
i've done that in a different method i used boards friction to reduce the speed of ball but i still think yer method is better =/
|
|
|
|
|
 |
Homer_simpson

|
Posted: Thu May 08, 2003 11:11 pm Post subject: (No subject) |
|
|
ok now i understand but which one of the procedures in the class actually moves the vector?
|
|
|
|
|
 |
Catalyst

|
Posted: Fri May 09, 2003 6:14 am Post subject: (No subject) |
|
|
you dont move the vector, its used to move another object
|
|
|
|
|
 |
Homer_simpson

|
Posted: Fri May 09, 2003 11:55 am Post subject: (No subject) |
|
|
oh ic now i know what it exactly is ...
|
|
|
|
|
 |
nate

|
Posted: Fri May 09, 2003 4:34 pm Post subject: ???? |
|
|
What are you sapposed to do with the code u posted. I am not really fimiliar with class. Is there some code 2 input to make the file do something?
-Nate
|
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
Tony

|
Posted: Fri May 09, 2003 4:39 pm Post subject: (No subject) |
|
|
i think there's a tutorial around here on how to use classes... its that thing where you go ClassName -> procedure
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
 |
|