Note that there are some explanatory texts on larger screens.

plurals
  1. POColour spiral not working in XNA
    primarykey
    data
    text
    <p>I am making a simple process which will create a colour changing spiral so I can test a range of variables and learn some C#. However, though I can not find a problem in the code, when I debug it, I am returned with a blank blue screen. Can any one find the problem. Here is all the code containing the variables needed for the ball point:</p> <pre><code> Vector2 Tripos; List&lt;Color&gt; Tricol; List&lt;Vector2&gt; datatripos; List&lt;int&gt; count; Color currentcol; float Tri_angle; float Triscale; int Tri_speed; int screenwidth; int screenheight; int addtocount; Texture2D Ball; int colourchangespeed; protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. Tripos = new Vector2(screenwidth / 2, screenheight / 2); Triscale = 1; Tri_angle = 1; Tri_speed = 1; colourchangespeed = 1; Ball = Content.Load&lt;Texture2D&gt;("ball"); currentcol = new Color(0, 0, 0); addtocount = 0; datatripos = new List&lt;Vector2&gt;(); Tricol = new List&lt;Color&gt;(); } </code></pre> <p>This is called by the update method:</p> <pre><code> private void Posgen() { Tripos.X += (float)Math.Sin(MathHelper.ToRadians(Tri_angle))*Tri_speed; Tripos.Y += (float)Math.Cos(MathHelper.ToRadians(Tri_angle))*Tri_speed; Tri_angle++; } private void colchanger() { currentcol.R += (byte)colourchangespeed; if (currentcol.R == 255) { currentcol.R = 0; currentcol.G += (byte)colourchangespeed; } if (currentcol.G == 255) { currentcol.G = 0; currentcol.B += (byte)colourchangespeed; } if (currentcol.B == 255) { currentcol.B = 0; } } private void dataadd() { addtocount++; Tricol.Add(currentcol); datatripos.Add(Tripos); count.Add(addtocount); } </code></pre> <p>Called by the draw method:</p> <pre><code> private void drawtri() { foreach (Vector2 data in datatripos) { spriteBatch.Draw(Ball, data, null, currentcol, 0, new Vector2(5, 5), Triscale, SpriteEffects.None, 0); } } </code></pre> <p>If you want the full code ask in advance. There are some variables I don't use but I intend to use for later so ignore these.</p> <p>Thanks in advance.</p> <p>Yours Mona.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload