<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.xna.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Game Algorithms</title><link>http://forums.xna.com/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 0.0)</generator><item><title>Re: Good shoot algorithm</title><link>http://forums.xna.com/forums/thread/142084.aspx</link><pubDate>Sat, 21 Feb 2009 23:12:14 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:142084</guid><dc:creator>Kenny hp</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/142084.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=142084</wfw:commentRss><description>Thank&amp;#39;s! it&amp;#39;s just i need, now works perfect!</description></item><item><title>Re: Good shoot algorithm</title><link>http://forums.xna.com/forums/thread/141996.aspx</link><pubDate>Sat, 21 Feb 2009 18:47:50 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:141996</guid><dc:creator>Eckish</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/141996.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=141996</wfw:commentRss><description>&lt;p&gt;&lt;span style="background-color:#f4f7f5;"&gt;Move the following code out of the if statement:&lt;br /&gt;
&lt;br /&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style="border-right:#7f9db9 1px solid;border-top:#7f9db9 1px solid;font-size:11px;overflow:auto;border-left:#7f9db9 1px solid;border-bottom:#7f9db9 1px solid;font-family:courier new;background-color:white;"&gt;
&lt;table style="border-top-width:0px;border-left-width:0px;margin:2px 0px;width:99%;border-bottom:#eee 0px solid;border-collapse:collapse;background-color:#fff;border-right-width:0px;" cellspacing="0" cellpadding="0"&gt;
    
    
        &lt;tr&gt;
            &lt;td&gt;&lt;span style="font-size:11px;"&gt;temporizador += (&lt;/span&gt;&lt;span style="color:blue;"&gt;float&lt;/span&gt;&lt;span style="font-size:11px;"&gt;)gameTime.ElapsedGameTime.Milliseconds;     &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt; &lt;/td&gt;
        &lt;/tr&gt;
    
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;The problem is that your delay timer is only accumulating time when you press your fire button.  You want it to accumulate time at every update.&lt;br /&gt;
&lt;br /&gt;
I also notice from the video you linked that there appears to be a limit on the bullets the character can have active at any given time.  If you want to implement that, then you will need to maintain a counter that decrements everytime you shoot and then increments everytime your bullets hit an object or boundry.  Then add a check to your if statement that only fires a bullet when the counter is above 0.&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Good shoot algorithm</title><link>http://forums.xna.com/forums/thread/141994.aspx</link><pubDate>Sat, 21 Feb 2009 18:39:15 GMT</pubDate><guid isPermaLink="false">4aa5dbf6-357b-46b2-b5b2-1b660a6dc370:141994</guid><dc:creator>Kenny hp</dc:creator><slash:comments>0</slash:comments><comments>http://forums.xna.com/forums/thread/141994.aspx</comments><wfw:commentRss>http://forums.xna.com/forums/commentrss.aspx?SectionID=45&amp;PostID=141994</wfw:commentRss><description>I would like to get a similar shoot like this:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.youtube.com/watch?v=-L9nGo22xgQ"&gt;http://www.youtube.com/watch?v=-L9nGo22xgQ&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div id="result_box" style="text-align:left;"&gt;I have almost achieved,  but is not as good as I&amp;#39;d like, when I press the shoot button, the first time not work. This is my shoot functi&lt;span style="font-size:13px;"&gt;&lt;span style="font-size:13px;"&gt;
&lt;div style="border-bottom:#7f9db9 1px solid;border-left:#7f9db9 1px solid;background-color:white;font-family:courier new;font-size:11px;overflow:auto;border-top:#7f9db9 1px solid;border-right:#7f9db9 1px solid;"&gt;
&lt;table style="border-bottom:#eee 0px solid;border-right-width:0px;background-color:#fff;margin:2px 0px;width:99%;border-collapse:collapse;border-top-width:0px;border-left-width:0px;" cellspacing="0" cellpadding="0"&gt;
    
    
        &lt;tr&gt;
            &lt;td&gt;&lt;span style="font-size:11px;"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt;&lt;span style="font-size:11px;"&gt; (Keyboard.GetState().IsKeyDown(Keys.Space))  &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;            {  &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt; &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;                &lt;span style="color:blue;"&gt;float&lt;/span&gt;&lt;span style="font-size:11px;"&gt; intervaloTiempo = 300f;  &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;                  &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;                temporizador += (&lt;span style="color:blue;"&gt;float&lt;/span&gt;&lt;span style="font-size:11px;"&gt;)gameTime.ElapsedGameTime.Milliseconds;  &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt; &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;                &lt;span style="color:blue;"&gt;if&lt;/span&gt;&lt;span style="font-size:11px;"&gt; (intervaloTiempo &amp;lt; temporizador)  &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;                {  &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;                    Disparo disparo = &lt;span style="color:blue;"&gt;new&lt;/span&gt;&lt;span style="font-size:11px;"&gt; Disparo(juegoActual, posicion, Enumerados.TiposDisparo.Basico, gameTime);  &lt;/span&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;                    juegoActual.Components.Add(disparo);  &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;                    temporizador = 0f;  &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td style="background-color:#f7f7f7;"&gt;                }  &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;            } &lt;/td&gt;
        &lt;/tr&gt;
    
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Any idea?&lt;/p&gt;
&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/span&gt;
&lt;p&gt;&lt;span style="color:#008000;font-size:13px;"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;</description></item></channel></rss>