Thanks for the quick replies!!
@RogueCommanderIX - Yes, I've seen it. I'm using it for ideas. As my physics/collision is already "premade", I want to try to program as much as I can on my own... I know XNA for the most part does most of the programming for me- its
a little bit of a sense of accomplishment for me to program as much as I can. Thanks tho! :)
@sterlingware - Q1) My current camera class I haven't exactly built up much yet has an update as such:
public void Update(int width, int height)
scale *= 1.01f;
else if (Keyboard.GetState().IsKeyDown(Keys.C))
scale /= 1.01f;
offset -= 5;
else if (Keyboard.GetState().IsKeyDown(Keys.D))
offset += 5;
camera_Pos.X = offset + (width - (width * scale)) / 2;
camera_Pos.Y = (height - (height * scale)) / 2;
transform = Matrix.CreateScale(scale) * Matrix.CreateTranslation(new Vector3(camera_Pos.X, camera_Pos.Y, 0));
Basically, 'Z' zooms in, 'C' zooms out, 'A' moves the screen to the left (or in other words- scrolls you to the right), and 'D' does the opposite. width/height is the screen size passed in to it. "transform" is returned via a getter,
and thrown into my spriteBatch.begin(). I know I need to handle this a little better in terms of getting the screen size- but for now, I want to get the basics and math down... then I can worry about cleaning it up and organizing. I haven't had
time to try to implement your formula or to mess around with it, but do you still think your worldposition formula you provided would work fine?
Q2) I just re-read my question and I can see how it would confuse a little- Basically, I have a "structure". The structure is nothing but a large and heavy body/geom. I also have various scraps/smaller parts/upgrades/weapons/etc...
I want to drag those smaller parts onto the structure, and have them stick to it. I'm thinking I should use a weld joint to do as such. I don't have a problem dragging/dropping for the most part as I'm just using the method in the simplesample
(creating a spring at the click point). I'm thinking it would be something like-
if mouse == dragging a geom && geom collides with other geom
weldjointlist.add(new weldjoint at collision points)
set the weldjoint breakpoint // to allow dragging off, but needing a little bit of pull just to make sure its intentional
basically- I suppose I might need a little bit of clarification on obtaining the exact collision points.
Once I can get this thing out of the way of dragging/dropping the objects and letting them "snap" onto the structure (i suppose something like "world of goo" where the gooballs would "snap" onto the structure, and they can be
pulled off with a little bit of force is another way to look at it), I know I can easily implement enough to get a good proof-of-concept done. Then, the rest of my game would be nothing but creating maps, artwork, scripts for levels, and polishing it