Hello, so,
I have ran into an issue where, I’m trying to add collisions into my game, to do this I need to have a relative rectangle,
so, in a simple case it works,
_spriteBatch.Draw(DoomWalkUp1, PlayerHitbox, Color.White);
when i test this with intersections, it works fine, however when I apply it to my main character, he doesn’t even spawn in, nor does he move or anything, (I debug his coordinates)
Main which doesn’t work -
_spriteBatch.Draw(CurrentFrame, CharacterPosition, PlayerHitbox, Color.White, 0f, new Vector2(DoomWalkUp1.Width/2, DoomWalkUp1.Height/2),
Vector2.One, SpriteEffects.None, 0f);
Main which works -
_spriteBatch.Draw(CurrentFrame, CharacterPosition, null, Color.White, 0f, new Vector2(DoomWalkUp1.Width/2, DoomWalkUp1.Height/2),
Vector2.One, SpriteEffects.None, 0f);
notice how in the one that works, I do not use a source rectangle, and instead I use ‘null’
where the source rectangle is declared in load content
PlayerHitbox = new Rectangle(CharacterPosX, CharacterPosY, 46, 58);
So, does anyone know how to apply the rectangle to the main character without causing issues?