Sunday 15 June 2014

c# - Colour spiral not working in XNA -


I am creating a simple process that will make a color changing spiral so that I can test a series of variables and some Can learn c # However, although I have not found any problems in the code, when I debug it, I come back with an empty blue screen. Any code can be found for all the variables required for the ball point here:

  vector 2 tripops; & Lt; Color & gt; Tricol; & Lt; Vector2 & gt; Datatripos; & Lt; Integer & gt; Count; Color current col; Float triangle; Flit Tristle; Int three-speed; Int screenwidth; Int screenhit; Intake count; Texture 2D Ball; Int colourchangespeed; Safe Override Zero Load Content () {// Create a new SpriteBeach, which can be used to attract texture; Tripos = new vector 2 (screenwidth / 2, screenhit / 2); Trisal = 1; Tri_angle = 1; Tri_speed = 1; Colourchangespeed = 1; Ball = content Load and lieutenant; Texture2D> ("Ball"); Currentcol = new color (0, 0, 0); Addtocount = 0; Statistics = New List & lt; Vector 2 & gt; (); Tricol = new list & lt; Color & gt; (); }   

This update is called by the method:

  Private zero posgen () {Tripos.X + = (float) Math.Sin (MathHelper. ToRadians (Tri_angle)) * Tri_speed; Trippo Y + = (float) monastery. Cos (Mathhalper. Tudiadian (Triangle)) * Tri-speed; Tri_angle ++; } Private zero colchanger () {currentcol.r + = (byte) colourchangespeed; If (currentcol.r == 255) {currentcol.r = 0; Currentcol.G + = (byte) color displayed; } If (currentcol.g == 255) {currentcol.g = 0; Currentcol.B + = (byte) colourchangespeed; } If (currentcol.b == 255) {currentcol.b = 0; }} Private Zero Datadown () {addtocount ++; Tricol.Add (currentcol); Datatripos.Add (tripos); Count.Add (addtocount); }   

The Draw method has been called by:

  Private Zero Draftry (foreach (Vector 2 data in figures) {spritebatch.Draw (ball, Data, zero, present code, 0, new vector 2 (5, 5), trisal, spray effect., 0); }}   

If you want full code in advance ask.

Thank you in advance.

Your mona.

Check that you call dataadd () Are there.

As a precaution, should be declared as a byte instead of Colourchangespeed a int because you are only casting a byte anyway Are there. When you check the color values, then the current value is & gt; = 255 as colourchangespeed is not 1.

Write good questions: Whatever is unrelated, remove it everything.

No comments:

Post a Comment