0
\$\begingroup\$

I ran through the first training on XNA where you make a shooter game. They did some thing that I would not do and I want to use their starting point to learn more things.

I want to try better collision and adding a menu. I saw something online with the sonic physics where they have a frame by frame of sonic moving 1 pixel. See picture below.

I am new to development, but I have been programming for years now. What would you guys suggest to try these different things out.

How would I simulate a similar frame by frame testing as they do in the above picture?

Thanks!

\$\endgroup\$
2
  • \$\begingroup\$ Do you want to implement collision boxes that are independent of the boundaries of the texture? \$\endgroup\$
    – Emir Lima
    Apr 12 '12 at 14:17
  • \$\begingroup\$ I don't know much about it currently, I am using the rectangle collision and I want to move to something that i more pixel accurate. My big thing with there tutorial is that the box they use once you add the animation is throws off the movable area of the screen, I was hoping to pinpoint what was causing that. \$\endgroup\$
    – kwelch
    Apr 12 '12 at 14:22
0
\$\begingroup\$

What you need is another rectangle that represents the "contact body" of the sprite, different from the rectangle that represent the drawing surface of the sprite. It's the principles of the bounding boxes.

In my 2D fighting game, for example, I have one different bounding box per keyframe of the animations.

\$\endgroup\$
2
  • \$\begingroup\$ Where should I put the code for that? In the draw of player/enemy? \$\endgroup\$
    – kwelch
    Apr 12 '12 at 18:56
  • \$\begingroup\$ The hit test goes to this another rectangle. And the rectangle that contains the boundaries of the whole sprite is used only for the drawing. \$\endgroup\$
    – Emir Lima
    Apr 13 '12 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.