 # bigbanggames

Member

4

## Everything posted by bigbanggames

1. My player sprite holds its own speed as a Vector2, its own direction as a Vector2 so in the Update Method I set the player's position (a Vector2) to: Position += Direction * Speed;   I have a polygon sprites class that has a property that returns the left normal between the two points that make up a given line segment.   I thought I could just use player.Direction = Vector2.Reflect( player.Direction, lineSegment.LeftNormal); That did not work. I also tried using the Vector2.Negate(player.Direction); this also did not work.   I used the left normal because the polygons are wound clockwise.   Is the direction the player is traveling the same as the incidence angle? Why would this not be working?   thanks in advance!
2. ## Convex Polygon SAT Collision

I am working on a game using MonoGame. I need to use convex polygon to convex polygon and convex polygon to circle collisions. I have done some studying on The Separating Axis Theorem. I have a couple of general questions, mainly revolving around implementing this algorithm in C#.   I was planning  on storing a line segment of a polygon as a startingPoint and endingPoint using Vector2 data types. I was then going to implement the left normal as a Vector2.   1. Do I need to normalize the left normal before getting my projections? 2.Could I use a float for the left normal? Would this be easier or harder to implement? 3.Should I use a Vector2 for the polygon line segment?(instead of the of the two points as Vector2's)   thanks in advance!
3. ## Mask vs. BoundingBox Collision vs.....

I am making a 2D game in MonoGame. It revolves around keeping an orb on a path. My first idea was to create a mask using an array or a generic data structure. My second idea was to use sprites surrounding the path and then checking for collisions. I am sure some one here has worked on something similar. I was wondering which was a better approach or if there is an even better way to approach it? I understand asking which is "better" is a very subjective question, when I say "better" I mean: more efficient, easier to implement ( using XML for levels), and easier to extend. Here is an image I used to hash out the bounding box idea. The black is the path and the different gray boxes with red outlines would be the sprites used for collisions.     Thanks in advanced!
4. I am new to XNA. I am trying to make a basic fade out for some splash screens, credits screen etc. My thought was to bring the opacity value down in increments equal to 1 millisecond. So figuring that XNA tries to keep the fps around 60, I decrement the increment value by the elapsed game time in Millis. The animation is stopping with an opacity of 0.36......  Is the difference the amount of time the draw() method takes?   Plus the time this method takes? What am I missing?  Thanks in advance!  public string FadeOut(GameTime gameTime, float fadeTimeSeconds) { float totalTime = fadeTimeSeconds * 1000; dTime += gameTime.ElapsedGameTime.Milliseconds; tTime += dTime; this.Increment = this.Opacity / totalTime; if (tTime <= totalTime) { this.Opacity -= (this.Increment * dTime); dTime = 0; } return this.Opacity.ToString(); }//end of FadeOut()