<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Filipe Silvestrim Blog &#187; Games</title>
	<atom:link href="http://www.filipesilvestrim.com/blog/category/games/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.filipesilvestrim.com/blog</link>
	<description>The life of a Game Developer</description>
	<lastBuildDate>Sat, 16 Apr 2011 08:54:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>SpotLights to RTS games and pseudo inverse masks</title>
		<link>http://www.filipesilvestrim.com/blog/02/02/2009/spotlights-to-rts-games-and-pseudo-inverse-masks/</link>
		<comments>http://www.filipesilvestrim.com/blog/02/02/2009/spotlights-to-rts-games-and-pseudo-inverse-masks/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 06:23:45 +0000</pubDate>
		<dc:creator>Filipe Silvestrim</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.filipesilvestrim.com/blog/?p=24</guid>
		<description><![CDATA[<p>Well&#8230; Today a friend of mine asked me to help him with a night render for his <a title="RTS Genre" href="http://en.wikipedia.org/wiki/Real-time_strategy" target="_blank">RTS</a> game. He needed an inverse mask to his MovieClip (which was his entire game). I thought a little and I decided to help him. I started writing an inverse mask, but I realized [...]]]></description>
			<content:encoded><![CDATA[<p>Well&#8230; Today a friend of mine asked me to help him with a night render for his <a title="RTS Genre" href="http://en.wikipedia.org/wiki/Real-time_strategy" target="_blank">RTS</a> game. He needed an inverse mask to his MovieClip (which was his entire game). I thought a little and I decided to help him. I started writing an inverse mask, but I realized that this would exhaust the cpu. So I thought that what really matters to him is to create a layer of fog on his game, so I wrote (in a few minutes) 2 classes that manage theses &#8220;Spots Lights&#8221;.</p>
<p>The result as you can see is here (drag the red circles):</p>
<p>
<object width="350" height="468">
<param name="movie" value="http://www.filipesilvestrim.com/blog/wp-content/uploads/2009/02/labs.swf"></param>
<param name="quality" value="high"></param>
<param name="wmode" value="window"></param>
<param name="menu" value="false"></param>
<param name="bgcolor" value="#FFFFFF"></param>
<embed type="application/x-shockwave-flash" width="350" height="468" src="http://www.filipesilvestrim.com/blog/wp-content/uploads/2009/02/labs.swf" quality="high" bgcolor="#FFFFFF" wmode="window" menu="false" ></embed>
</object>
</p>
<p style="text-align: left;">As I&#8217;m writing codes that are not related to my engine (the one I&#8217;m writing for my final project), I decided to create a <a title="Filipe Silvestrim Repository" href="http://code.google.com/p/filipesilvestrim/" target="_blank">Google Code Repository</a> for my extra experiments. This way the classes will be always there. This first experiment can be improved a lot. If you have some comments or know a better way of doing it, please let me know <img src='http://www.filipesilvestrim.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p style="text-align: left;">This example&#8217;s class is here:</p>
<pre class="brush: as3; title: ;">
package {
    import com.filipesilvestrim.game.render.light.SpotLight;
    import com.filipesilvestrim.game.render.light.SpotRenderer;

    import flash.display.Sprite;
    import flash.display.StageScaleMode;
    import flash.events.Event;
    import flash.events.MouseEvent;

    [SWF(width=350, height=468)]
    public class SpotExperiment extends Sprite
    {
    private var spotRender 		: SpotRenderer;
    private var spotSelected 	: SpotLight;

    [Embed(source=&quot;aoe.jpg&quot;)]
    private var map : Class;

    public function SpotExperiment()
    {
        stage.scaleMode = StageScaleMode.NO_SCALE;
        addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
        addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
        addEventListener(Event.MOUSE_LEAVE, onMouseUp);
        addEventListener(Event.ENTER_FRAME, onEnterFrame);

        //Adding the background (in some cases the game as itself)
        addChild(new map());

        //creating the render. The first param is where we'll add the representation, the second is the width and the third is the height
        spotRender = new SpotRenderer(this, 350, 468);
        //here we can change the fog color to other one and the transparency
        spotRender.changeColorMap(0x000000, 1);

        //Now we're adding 3 spots of diferent sizes and position
        //As params we have: name, pos X, pos Y, width, height
        var spot1 : SpotLight = new SpotLight(&quot;spot1&quot;, 200,200,200,200);
        //we can adjust the intensity from 0 to 1
        spot1.intensity = 1;
        //the focus can be adjusted too
        spot1.focus = .5;
        //adds the red ball for debug
        spot1.debug(this);
        //add the spot to be rendered
        spotRender.addSpot(spot1);

        var spot2 : SpotLight = new SpotLight(&quot;spot2&quot;, 250,300,100,100);
        spot2.debug(this);
        spotRender.addSpot(spot2);

        var spot3 : SpotLight = new SpotLight(&quot;spot3&quot;, 100, 100, 300, 300);
        spot3.debug(this);
        spotRender.addSpot(spot3);

        //render as first time to the scenario don't appear without no one fog
        spotRender.render();
    }

        private function onMouseDown ( event : MouseEvent ) : void
        {
            //if some spot is target
            if (spotRender.getSpot(event.target.name) != null)
            {
                //hold in the spotSelected variable the sport that represents that Sprite ball
                spotSelected = spotRender.getSpot(event.target.name);
            }
        }

        private function onMouseUp ( event : Event ) : void
        {
            //if mouse released
            spotSelected = null;
        }

        private function onEnterFrame ( event : Event ) : void
        {
            //hold the spots changes (if some spot selected)
            if(spotSelected != null)
            {
                //reposition the spot and the debug reference accourding the mouse position
                spotSelected.x = spotSelected.spriteDebug.x = mouseX;
                spotSelected.y = spotSelected.spriteDebug.y = mouseY;
                //when change the position the sportRender must be rendered again
                spotRender.render();
            }
        }
    }
}</pre>
<p style="text-align: left;">
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">[<ins>SWF]</ins>http://www.filipesilvestrim.com/blog/wp-content/uploads/2009/02/labs.swf<ins>,</ins> 350<ins>,</ins> 468<ins>[</ins><ins>/SWF</ins>]</div>
]]></content:encoded>
			<wfw:commentRss>http://www.filipesilvestrim.com/blog/02/02/2009/spotlights-to-rts-games-and-pseudo-inverse-masks/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Material (artigo e exemplos) do minicurso de ActionScript 3.0 para Games</title>
		<link>http://www.filipesilvestrim.com/blog/16/11/2007/material-artigo-e-exemplos-do-minicurso-de-actionscript-30-para-games/</link>
		<comments>http://www.filipesilvestrim.com/blog/16/11/2007/material-artigo-e-exemplos-do-minicurso-de-actionscript-30-para-games/#comments</comments>
		<pubDate>Fri, 16 Nov 2007 15:02:04 +0000</pubDate>
		<dc:creator>Filipe Silvestrim</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Courses]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.filipesilvestrim.com/blog/16/11/2007/material-artigo-e-exemplos-do-minicurso-de-actionscript-30-para-games/</guid>
		<description><![CDATA[<p>Olá pessoal,</p> <p>fiquei meio parado nas duas últimas semanas por causa do <a href="http://www.inf.unisinos.br/~sbgames/" target="_blank">SBGames 2007</a> e de uns projetos pessoais.</p> <p>O SbGames 2007 foi simplesmente ótimo e o pré-evento <a href="http://www.gds.inf.br" target="_blank">GDS</a> superou as expectativas.</p> <p>O AUGRS apresentou duas palestras, uma de AS2 e Advergames com Pedro Taranto e Alberto Amaral e a minha [...]]]></description>
			<content:encoded><![CDATA[<p>Olá pessoal,</p>
<p>fiquei meio parado nas duas últimas semanas por causa do <a href="http://www.inf.unisinos.br/~sbgames/" target="_blank">SBGames 2007</a> e de uns projetos pessoais.</p>
<p>O SbGames 2007 foi simplesmente ótimo e o pré-evento <a href="http://www.gds.inf.br" target="_blank">GDS</a> superou as expectativas.</p>
<p>O AUGRS apresentou duas palestras, uma de AS2 e Advergames com Pedro Taranto e Alberto Amaral e a minha de AS3 para Games.</p>
<p>O meu minicurso teve como título &#8220;Conhecendo o ActionScript 3.0 para o desenvolvimento de jogos utilizando o Adobe Flash CS3&#8243; e foram abordadas questões desde o básico do AS3 referindo-se a DisplayList e ao Sistema de Eventos até a parte de Simulações de Física com a APE e 3D com Papervision 3D.</p>
<p>O artigo pode ser adquirido nesse link <a href="http://www.filipesilvestrim.com/gds_2007/minicursoAS3Games.pdf" target="_blank">http://www.filipesilvestrim.com/gds_2007/minicursoAS3Games.pdf</a>  e os exemplos (classes e .fla) podem ser feitos o download aqui <a href="http://www.filipesilvestrim.com/gds_2007/Fonte.zip" target="_blank">http://www.filipesilvestrim.com/gds_2007/Fonte.zip</a> .</p>
<p>Atenção: Ao fazer o download dos códigos fonte, favor ler o arquivo <em>leia-me.html</em> para que os exemplos rodem corretamente.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.filipesilvestrim.com/blog/16/11/2007/material-artigo-e-exemplos-do-minicurso-de-actionscript-30-para-games/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Palestra &#8211; ActionScript 3.0 para o desenvolvimento de jogos</title>
		<link>http://www.filipesilvestrim.com/blog/26/10/2007/palestra-actionscript-30-para-o-desenvolvimento-de-jogos/</link>
		<comments>http://www.filipesilvestrim.com/blog/26/10/2007/palestra-actionscript-30-para-o-desenvolvimento-de-jogos/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 11:54:21 +0000</pubDate>
		<dc:creator>Filipe Silvestrim</dc:creator>
				<category><![CDATA[ActionScript 3]]></category>
		<category><![CDATA[Courses]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Games]]></category>

		<guid isPermaLink="false">http://www.filipesilvestrim.com/blog/26/10/2007/palestra-actionscript-30-para-o-desenvolvimento-de-jogos/</guid>
		<description><![CDATA[<p align="left"></p> <p align="left">&#160;</p> <p align="left">Estarei palestrando um mini curso de ActionScript 3.0 para o desenvolvimento de jogos no pré-evento do SBGames 2007 (Simpósio Brasileiro de Games).</p> <p align="left">Para assistir a palestra basta se inscrever no SBGames e marcar a opção de que irá assistir ao pré-evento GDS (Game Development School).</p> <p align="left">&#160;</p> <p align="left">Detalhes [...]]]></description>
			<content:encoded><![CDATA[<p align="left"><img src="http://www.filipesilvestrim.com/blog/images/sbgames2007.jpg" style="padding: 10px" align="left" /></p>
<p align="left">&nbsp;</p>
<p align="left">Estarei palestrando um mini curso de <strong>ActionScript 3.0 para o desenvolvimento de jogos</strong> no pré-evento do SBGames 2007 (Simpósio Brasileiro de Games).</p>
<p align="left">Para assistir a palestra basta se inscrever no SBGames e marcar a opção de que irá assistir ao pré-evento GDS (Game Development School).</p>
<p align="left">&nbsp;</p>
<p align="left">Detalhes da palestra:</p>
<blockquote>
<p align="left"><strong>Dia 6 de Novembro<br />
14:00 &#8211; 17:00</strong></p>
<p><strong>Conhecendo o ActionScript 3.0 para o desenvolvimento de jogos utilizando o Adobe Flash CS3.</strong></p>
<p><strong>Filipe Ghesla Silvestrim</strong></p>
<p>AUGRS &#8211; Adobe User Group do Rio Grande do Sul <a href="http://www.augrs.com" target="_blank">http://www.augrs.com</a></p>
<p><em>Resumo</em>: Introduzir a linguagem de programação ActionScript 3.0 no desenvolvimento de jogos utilizando o software Adobe Flash Professional CS3 como plataforma de desenvolvimento.</p>
<p><em>Público-Alvo</em>: Intermediário</p>
<p><em>Pré-Requisitos</em>: Conhecimento de lógica de programação para jogos.</p></blockquote>
<p align="left">Mais informações sobre o SBGames no site <a href="http://www.inf.unisinos.br/~sbgames" target="_blank">http://www.inf.unisinos.br/~sbgames</a></p>
<p align="left">Mais informações sobre o pré-evento no endereço <a href="http://www.inf.unisinos.br/~sbgames/GDS-port.html" target="_blank">http://www.inf.unisinos.br/~sbgames/GDS-port.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.filipesilvestrim.com/blog/26/10/2007/palestra-actionscript-30-para-o-desenvolvimento-de-jogos/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

