Computer Science Canada Multiple ball colision physics |
Author: | petree08 [ Fri Nov 10, 2006 12:17 pm ] | ||
Post subject: | Multiple ball colision physics | ||
Okay so a while a go i posted a ball physics thingy and it basically blew apple sauce. So i went home ant wrote this little thing it is sooo much better than my other one.
|
Author: | DemonZ [ Fri Nov 10, 2006 6:21 pm ] |
Post subject: | |
Very Nice.... This would be useful for a pool game. |
Author: | Windsurfer [ Fri Nov 10, 2006 7:54 pm ] |
Post subject: | |
The physics seem... weird. I'm going to be blunt here. All the balls move at the same speed. It doesn't matter what angle their collisions are, they move at the same speed, just different directions. That's not proper. Now for coding: Naming convention is nonexistent. In fact, some names are incorrect. "SIZE" should not be used to describe the number of balls, in my opinion. Also, although not a rule, it is common practice to name variables and arrays in all lowercase. Don't use parallel arrays, use records instead. Commenting should be used to explain code, not just disable a part of code. ...Good spacing. Keep that up. |
Author: | Cervantes [ Fri Nov 10, 2006 11:07 pm ] |
Post subject: | |
The telltale clue that something is wrong here is that if you give the system a little bit of energy at the start of the program by jostling a few balls, then move the white ball into the corner, what happens? Eventually all the balls are moving pretty fast. There's a lot of energy in the system. Way more than you gave the system in the beginning. |
Author: | TripleBla [ Mon Nov 13, 2006 1:58 pm ] |
Post subject: | |
Windsurfer wrote: I am jesus.
fixed. |
Author: | blaster009 [ Mon Nov 13, 2006 11:14 pm ] |
Post subject: | |
Windsurfer wrote: Now for coding: Naming convention is nonexistent. In fact, some names are incorrect. "SIZE" should not be used to describe the number of balls, in my opinion. Also, although not a rule, it is common practice to name variables and arrays in all lowercase. Common for who? I use camelCase. I personally find it a lot easier to read xSizeArrayForBunchOfRandomObjects than xsizearrayforbunchofrandomobjects (of course, I'd never really use a name that long...) As for size as the number, why not? It is HIS code, and if that's how he chooses to remember it, so be it. ![]() |
Author: | Clayton [ Mon Nov 13, 2006 11:21 pm ] |
Post subject: | |
I think he meant variable names not as MyArray, but as myArray for example. SIZE just doesn't really explain what it is. To me it tells me how big something is (ie the radius of the ball). EDIT: WOOHOO! 700th post |