<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>Game Programming at scriptedfun &#187; 1945</title>
	<atom:link href="http://www.scriptedfun.com/category/1945/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptedfun.com</link>
	<description>Game Programming for Beginners: Video Tutorials, Source Code, and Articles</description>
	<lastBuildDate>Thu, 11 Sep 2008 17:45:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/</creativeCommons:license>
		<item>
		<title>Shooting Mechanism Demo</title>
		<link>http://www.scriptedfun.com/shooting-mechanism-demo/</link>
		<comments>http://www.scriptedfun.com/shooting-mechanism-demo/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 05:32:48 +0000</pubDate>
		<dc:creator>Chuck</dc:creator>
				<category><![CDATA[1945]]></category>
		<category><![CDATA[gamedev]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[pygame]]></category>

		<guid isPermaLink="false">http://www.scriptedfun.com/shooting-mechanism-demo/</guid>
		<description><![CDATA[As a follow up to the background scrolling example, I&#8217;ve modified the 1945 code again to emphasize how the shooting mechanism works.

Basically, the player is given two options for shooting:

Every distinct click of the left mouse button guarantees one shot.
Holding the left mouse button will make shots appear at regular intervals (rapid fire).

In a way, [...]]]></description>
			<content:encoded><![CDATA[<p>As a follow up to the <a href="http://www.scriptedfun.com/pygame-scrolling-background/">background scrolling example</a>, I&#8217;ve modified <a href="http://www.scriptedfun.com/1945-a-vertical-scrolling-shooter/">the 1945 code</a> again to emphasize how the shooting mechanism works.</p>
<p><img src="http://www.scriptedfun.com/wp-content/uploads/2006/12/shooting.gif" alt="shooting mechanism example" /></p>
<p>Basically, the player is given two options for shooting:</p>
<ol>
<li>Every distinct click of the left mouse button guarantees one shot.</li>
<li>Holding the left mouse button will make shots appear at regular intervals (rapid fire).</li>
</ol>
<p>In a way, this gives the player the incentive to click if he wants a more rapid rate of fire, since you can effectively increase the intervals at which rapid fire gives off shots.</p>
<p>Feel free to ask questions! <img src='http://www.scriptedfun.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://www.scriptedfun.com/wp-content/uploads/2006/12/shooting.zip">shooting mechanism source code</a></p>
<p><!--adsense#admedrect--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptedfun.com/shooting-mechanism-demo/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>Pygame Scrolling Background</title>
		<link>http://www.scriptedfun.com/pygame-scrolling-background/</link>
		<comments>http://www.scriptedfun.com/pygame-scrolling-background/#comments</comments>
		<pubDate>Sat, 09 Dec 2006 13:52:12 +0000</pubDate>
		<dc:creator>Chuck</dc:creator>
				<category><![CDATA[1945]]></category>
		<category><![CDATA[gamedev]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[pygame]]></category>

		<guid isPermaLink="false">http://www.scriptedfun.com/pygame-scrolling-background/</guid>
		<description><![CDATA[One of the questions that I&#8217;m asked most often is how the background scrolling in 1945 works. To answer this question, I&#8217;ve removed some of the code from the original 1945 code, added a few things, and came up with this scrolling demo:

The best way to understand how the scrolling actually works is by downloading [...]]]></description>
			<content:encoded><![CDATA[<p>One of the questions that I&#8217;m asked most often is <a href="http://www.scriptedfun.com/1945-a-vertical-scrolling-shooter/">how the background scrolling in 1945 works</a>. To answer this question, I&#8217;ve removed some of the code from the original 1945 code, added a few things, and came up with this scrolling demo:</p>
<p><img src="http://www.scriptedfun.com/wp-content/uploads/2006/12/bgscrollsmall.gif" alt="scrolling background demo" /></p>
<p>The best way to understand how the scrolling actually works is by downloading the source code and experimenting with the program.</p>
<p>Here are the main changes:</p>
<ul>
<li>The screen size is now 640 by 544 &#8211; the reason for this you will see when you run the code.</li>
<li>Scrolling is no longer automatic &#8211; you may use the up and down arrow keys to scroll the background. This should help you observe better what is going on.</li>
<li>The program ends by pressing Q &#8211; I&#8217;m hoping that this change would help the menu bar catch your attention&#8230;</li>
<li>A minimum of instructions is provided in the title bar.</li>
<li>Pressing the Escape key toggles between two ways of putting the background on the screen &#8211; this is the highlight of the code example.</li>
</ul>
<p>Basically, we are taking advantage of the fact that the background is just a repeating pattern, so all we have to do is draw a background that is a little larger than the actual screen (here, the background is actually 640 by 512, but the screen size is 1945 is 640 by 480), then just move this large picture across the screen, creating the illusion of movement. Once we hit the edge, we just wrap the image around, which I think does a good job of making us believe that the sea just goes on and on and on to infinity.</p>
<p>If all that sounded complicated, I encourage you to try the demo and toggle between the two modes and scroll the background &#8211; you&#8217;ll see what I mean, and how simple it really is <img src='http://www.scriptedfun.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Feel free to ask questions, and I hope you find this helpful!</p>
<p><a href="http://www.scriptedfun.com/wp-content/uploads/2006/12/bgscroll.zip">scrolling background source code</a></p>
<p><!--adsense#admedrect--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptedfun.com/pygame-scrolling-background/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/</creativeCommons:license>
	</item>
		<item>
		<title>1945 &#8211; a vertical scrolling shooter</title>
		<link>http://www.scriptedfun.com/1945-a-vertical-scrolling-shooter/</link>
		<comments>http://www.scriptedfun.com/1945-a-vertical-scrolling-shooter/#comments</comments>
		<pubDate>Sun, 02 Jul 2006 05:04:14 +0000</pubDate>
		<dc:creator>Chuck</dc:creator>
				<category><![CDATA[1945]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[pygame]]></category>

		<guid isPermaLink="false">http://www.scriptedfun.com/?p=12</guid>
		<description><![CDATA[1945 is a clone of the popular vertical scrolling shooter 1942. Again, the graphics in the game were taken from the Spritelib by Ari Feldman. This game will serve as the basis for the screencasts once we finish Arinoid. The screencasts will probably begin with screencast 6. In the meantime, I am hoping that you&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>1945 is a clone of the popular vertical scrolling shooter <a href="http://en.wikipedia.org/wiki/1942_%28arcade_game%29" onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');">1942</a>. Again, the graphics in the game were taken from the <a href="http://www.flyingyogi.com/fun/spritelib.html" onclick="javascript:pageTracker._trackPageview ('/outbound/www.flyingyogi.com');">Spritelib by Ari Feldman</a>. This game will serve as the basis for the screencasts once we finish <a href="http://www.scriptedfun.com/?p=5">Arinoid</a>. The screencasts will probably begin with screencast 6. In the meantime, I am hoping that you&#8217;ll find the source code useful, and just leave a comment on the site if you have any questions <img src='http://www.scriptedfun.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I posted this in advance because one of the site&#8217;s readers needed some help with animations, which this game has but Arinoid doesn&#8217;t. Aside from animations, this game also features a scrolling background.</p>
<p><img alt="1945 screenshot" src="http://www.scriptedfun.com/wp-content/uploads/2006/06/1945.gif" /><br />
<!--adsense#admedrect--><br />
<span id="more-12"></span>In this game, enemy planes just appear randomly from the top of the screen, move downward, and try shoot you. You, in turn, should avoid the enemy planes and shoot them down using your semi-rapid-fire gun. Despite the simple mechanics, I think that the current prototype is already fun to play &#8211; there&#8217;s something satisfying about clearing the screen of things, accompanied by explosions; this is the basic premise of many arcade games.</p>
<p><!--adsense#linksquare-->The code I used for the animations is heavily based on the animation code in aliens.py, which is included in the <a href="http://www.pygame.org/download.shtml" onclick="javascript:pageTracker._trackPageview ('/outbound/www.pygame.org');">Pygame source distribution</a>. I highly encourage you to study the code for that game, because a lot of what I know about <a href="http://www.pygame.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.pygame.org');">Pygame</a> came from studying that code <img src='http://www.scriptedfun.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>The 1945 code branches off from the <a href="http://www.scriptedfun.com/?p=7">barebones code</a>, and borrows from <a href="http://www.scriptedfun.com/?p=5">Arinoid</a>. However, in contrast to the barebones app which uses RenderUpdates, 1945 uses RenderPlain, because the entire screen changes at every frame due to the scrolling background, so dirty rectangles aren&#8217;t necessary.</p>
<p>The link to the 1945 zip file appears below. As usual, <a href="http://www.python.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.python.org');">Python</a> and <a href="http://www.pygame.org/" onclick="javascript:pageTracker._trackPageview ('/outbound/www.pygame.org');">Pygame</a> are needed to run the program.</p>
<p><a href="http://www.scriptedfun.com/wp-content/uploads/2006/06/1945.zip">1945 source</a><br />
<!--adsense#adbanner--></p>
]]></content:encoded>
			<wfw:commentRss>http://www.scriptedfun.com/1945-a-vertical-scrolling-shooter/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by/2.5/</creativeCommons:license>
	</item>
	</channel>
</rss>
