C++/Visual C++
- kaiel090x
-
kaiel090x
- Member since: Jun. 28, 2001
- Offline.
-
- Forum Stats
- Member
- Level 05
- Blank Slate
hey... i make collision detection and graphics and stuff like that with actionnscript easily, but i dont have a clue for c++/visual c++ and i know most of both of the languages.... if anyone could just explain the concept to me, i would be thankful
- Pecos
-
Pecos
- Member since: Dec. 29, 1999
- Offline.
-
- Forum Stats
- Member
- Level 03
- Blank Slate
At 7/6/01 11:39 AM, kaiel090x wrote: hey... i make collision detection and graphics and stuff like that with actionnscript easily, but i dont have a clue for c++/visual c++ and i know most of both of the languages.... if anyone could just explain the concept to me, i would be thankful
Not that it's anything you want to hear, but.. Visual C++ is not a language - it's an application.
- kaiel090x
-
kaiel090x
- Member since: Jun. 28, 2001
- Offline.
-
- Forum Stats
- Member
- Level 05
- Blank Slate
At 7/6/01 02:22 PM, MassiveBit wrote:At 7/6/01 11:39 AM, kaiel090x wrote: hey... i make collision detection and graphics and stuff like that with actionnscript easily, but i dont have a clue for c++/visual c++ and i know most of both of the languages.... if anyone could just explain the concept to me, i would be thankfulNot that it's anything you want to hear, but.. Visual C++ is not a language - it's an application.
you are right, but its considered a language when you using it for a specific purpose.
- LordAba
-
LordAba
- Member since: Nov. 2, 2000
- Offline.
-
- Forum Stats
- Member
- Level 10
- Blank Slate
At 7/6/01 11:39 AM, kaiel090x wrote: hey... i make collision detection and graphics and stuff like that with actionnscript easily, but i dont have a clue for c++/visual c++ and i know most of both of the languages.... if anyone could just explain the concept to me, i would be thankful
It's fairly advanced. You need to know DirectX to use it in a efficent way, unless you are really good. A good book on it is Andre LaMothe's Trick of the Windows Game Programming Gurus, by Sams publishing. But here is the basics: You blit the graphic to a back buffer created by DirectDraw. That object is represented in code as a bounding box(a box that represents where the object is). Then you compair that object with other objects. If the objects overlap, yoiu have collision.
It's kind of hard to get if you are just starting out in C++. You should learn classes or structs first, because that's how the objects are represented(or at least one of the easier ways). If you get how to do that, then the rest is just compairing x, y, and/or z axis'.
For example: to draw a rectangle of height 2, 2 at position x, y:
Draw_Rectangle(x, y, x+2, y+2, color);
And for collision on an object with coordinates x, y with another object:
if((x >= object2_x && x <= object2_x + object2width) && (y >= object2y && y <= object2y + object2height))
//collision!!!!
What may man within him hide, though angel on the outward side.

