<?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>Brainfold &#187; Uncategorized</title>
	<atom:link href="http://www.brainfold.org/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brainfold.org/blog</link>
	<description>On Python, game development and everything</description>
	<lastBuildDate>Sat, 15 May 2010 21:58:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Help needed</title>
		<link>http://www.brainfold.org/blog/2010/05/15/help-needed/</link>
		<comments>http://www.brainfold.org/blog/2010/05/15/help-needed/#comments</comments>
		<pubDate>Sat, 15 May 2010 21:58:53 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[pyeigen]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=297</guid>
		<description><![CDATA[While PyEigen 0.2 is mostly ready for release, I'm stuck on weird problems with GCC on both Windows (MinGW) and Linux. PyEigen compiles fine on Visual C++, but GCC gives different errors depending on the version. On GCC 4.4 I get these mysterious errors: source/iterator/matrix2fiterator.cpp:39: error: insufficient contextual information to determine type source/iterator/matrix2fiterator.cpp:40: error: insufficient [...]]]></description>
			<content:encoded><![CDATA[<p>While PyEigen 0.2 is mostly ready for release, I'm stuck on weird problems with GCC on both Windows (MinGW) and Linux. PyEigen compiles fine on Visual C++, but GCC gives different errors depending on the version. On GCC 4.4 I get these mysterious errors:</p>
<pre>source/iterator/matrix2fiterator.cpp:39: error: insufficient contextual information to determine type
source/iterator/matrix2fiterator.cpp:40: error: insufficient contextual information to determine type
source/iterator/matrix2fiterator.cpp:41: error: too many initializers for ‘PyTypeObject’</pre>
<p>On GCC 4.5, apparently every template function in PyEigen results in an undefined reference, even though the implementations are (or at least should be, as MSVC finds them) included in the object files. Frankly I don't have the faintest idea why this is happening. I even completely restructured the code to try if the (admittedly confusing) header relationships were to blame for the errors, but nothing changed.</p>
<p>If someone wants to help (pretty please) and try to figure out what's wrong, you can grab the code here: <a href="http://code.launchpad.net/~knarkles/pyeigen/trunk">http://code.launchpad.net/~knarkles/pyeigen/trunk</a>. You need the Python headers and Eigen 2 to compile; feel free to ask me for help on getting a build setup up an running.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2010/05/15/help-needed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PyEigen 0.2 feature complete</title>
		<link>http://www.brainfold.org/blog/2010/05/03/pyeigen-0-2-feature-complete/</link>
		<comments>http://www.brainfold.org/blog/2010/05/03/pyeigen-0-2-feature-complete/#comments</comments>
		<pubDate>Mon, 03 May 2010 07:43:57 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[numpy]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[pyeigen]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=292</guid>
		<description><![CDATA[After a couple of weeks of hiatus, the 0.2 release of PyEigen is now feature complete. What's left is some testing and documentation, then release. I postponed quaternions and transformations to 0.3 because variable-size matrices were plenty of work for a single release and single programmer already; I don't want too much time between releases [...]]]></description>
			<content:encoded><![CDATA[<p>After a couple of weeks of hiatus, the 0.2 release of PyEigen is now feature complete. What's left is some testing and documentation, then release. I postponed quaternions and transformations to 0.3 because variable-size matrices were plenty of work for a single release and single programmer already; I don't want too much time between releases at such an early stage. If I'm not too busy, PyEigen 0.2 should be released in a week or two.</p>
<p>I did some benchmarking on 1000x1000 matrices. Insanely, enabling SSE2 instructions speeded up that test case by 10x; I was expecting a 4x increase at most, since SSE instructions handle 4 times the data per instruction. NumPy is slightly faster for 1000x1000 matrix multiplication, but there's an obvious optimization in PyEigen that will hopefully make it faster again. That will have to wait for 0.3 though, since it's a bit tedious to implement. For those interested: there's an extra matrix copy in all PyEigen functions and operators that return a value, which I can probably optimize away.</p>
<p>BTW, if you want more frequent progress updates, you can follow my <a href="http://twitter.com/Knarkles">Twitter feed</a>. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2010/05/03/pyeigen-0-2-feature-complete/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PyEigen 0.2 teaser</title>
		<link>http://www.brainfold.org/blog/2010/03/29/pyeigen-0-2-teaser/</link>
		<comments>http://www.brainfold.org/blog/2010/03/29/pyeigen-0-2-teaser/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 15:47:19 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[pybindgen]]></category>
		<category><![CDATA[pyeigen]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=277</guid>
		<description><![CDATA[I just want to assure everyone that development of PyEigen didn't stop at the 0.1 release and I've put many hours into the next release already. I have almost finished rewriting everything using C++ templates; might as well take advantage of C++ features since Eigen requires a C++ compiler anyway. Lines of code have been [...]]]></description>
			<content:encoded><![CDATA[<p>I just want to assure everyone that development of PyEigen didn't stop at the 0.1 release and I've put many hours into the next release already. I have almost finished rewriting everything using C++ templates; might as well take advantage of C++ features since Eigen requires a C++  compiler anyway. Lines of code have been cut almost in half and maintenance will be much easier in the future.  Here are some of the major upcoming features (subject to change, completed features will be in bold):</p>
<ul>
<li><strong>Python 3 support</strong></li>
<li><strong>Matrix iterators</strong></li>
<li><strong>Variable-size vectors and matrices</strong></li>
</ul>
<p>In other news, I just found about <a href="http://launchpad.net/pybindgen/">PyBindGen</a>, which looks very promising compared to other binding generators, and might be worth checking out for a future version of PyEigen. Can someone speak for or against it? I'm mostly worried about performance, since I want PyEigen to be as fast as possible; after all, that's the sole reason I started the whole project.</p>
<p><strong>Update (2010-03-30):</strong><br />
Matrix iterators done, slicing dropped (you can just convert to a list first).</p>
<p><strong>Update (2010-05-03):</strong><br />
Quaternions and transformations postponed to the next release, variable-size matrices done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2010/03/29/pyeigen-0-2-teaser/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Business as usual</title>
		<link>http://www.brainfold.org/blog/2008/12/10/business-as-usual/</link>
		<comments>http://www.brainfold.org/blog/2008/12/10/business-as-usual/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 00:58:13 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Artillery Brawl]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[studies]]></category>
		<category><![CDATA[university]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=100</guid>
		<description><![CDATA[It's time to poke a hole in the wall of silence. I just finished selecting university courses for the next semester, which is going to be a bit special. Special, because if I pass every course, I will have finished all the courses needed for my Master's degree! I still have a thesis to write, [...]]]></description>
			<content:encoded><![CDATA[<p>It's time to poke a hole in the wall of silence. I just finished selecting university courses for the next semester, which is going to be a bit special. Special, because if I pass every course, I will have finished all the courses needed for my Master's degree! I still have a thesis to write, but it's still a great – and strange – feeling. I have some interesting courses coming up, including pattern recognition, digital image processing and knowledge discovery (which is about data mining, visualization and such).</p>
<p>Since this will hopefully be my last year at the university, and for other reasons, I have been quite busy. As such, I have had to make some sacrifices, such as game development (as evidenced by the lack of updates to this blog). Again. But since I will be less busy after I finish my studies for this Autumn, which should happen next week, I will be free to continue working on <a href="http://www.brainfold.org/blog/tag/artillery-brawl/">Artillery Brawl</a>, and hope I will be at least slightly less busy during the next semester! After all, it would be nice to have something in my portfolio to show when I start applying for jobs to write my thesis at. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  I also promise to try and get the card game I <a href="http://www.brainfold.org/blog/2008/10/03/secrets/">wrote about</a> playable in the near future.</p>
<p>In other news, Python 3.0 was released while I was away. The <a href="http://docs.python.org/3.0/whatsnew/3.0.html">improvements</a>, especially to Unicode handling, look really interesting and I would really like to switch, but unfortunately, I can't... None of the libraries I'm using for Artillery Brawl - <a href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a>, <a href="http://www.pyglet.org/">pyglet</a> and <a href="http://code.google.com/p/pymunk/">pymunk</a> – have been updated for Python 3.0 yet. There's not much I can do except wait, so for now, I'm sticking with Python 2.6.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/12/10/business-as-usual/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unfortunately</title>
		<link>http://www.brainfold.org/blog/2008/09/22/unfortunately/</link>
		<comments>http://www.brainfold.org/blog/2008/09/22/unfortunately/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 19:52:55 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=92</guid>
		<description><![CDATA[Looks like my disappearance for the summer is becoming an annual event. Unfortunately, the only thing I have to report is that I still have too much work with studies, my part-time job and some other stuff to have any left for game development at the moment. I still wanted to say that I'm not [...]]]></description>
			<content:encoded><![CDATA[<p>Looks like my disappearance for the summer is becoming an annual event. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Unfortunately, the only thing I have to report is that I still have too much work with studies, my part-time job and some other stuff to have any left for game development at the moment. I still wanted to say that I'm not dead, and neither are my gamedev plans. I have even made a decision: as soon I have time again, I'm going to concentrate on Artillery Brawl and not any side projects, even tiny ones, until I'm convinced Artillery Brawl is or is not a fun game.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/09/22/unfortunately/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summer</title>
		<link>http://www.brainfold.org/blog/2008/08/05/summer/</link>
		<comments>http://www.brainfold.org/blog/2008/08/05/summer/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 05:45:03 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[real life]]></category>
		<category><![CDATA[studies]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=89</guid>
		<description><![CDATA[Oops, looks like Real Life ate me for July. I haven't even worked on the university project much, but I'll have to get it ready before September. Some good news regarding my studies though: I'm very likely to finish all my remaining courses during the next academic year. After that, I'm planning to move back [...]]]></description>
			<content:encoded><![CDATA[<p>Oops, looks like Real Life ate me for July. I haven't even worked on the university project much, but I'll have to get it ready before September. Some good news regarding my studies though: I'm very likely to finish all my remaining courses during the next academic year. After that, I'm planning to move back to the capital, Helsinki, to write my Master's thesis at some company. If everything goes according to the plan, I'll finish my degree late next year, yay! Of course, things rarely go exactly like planned...</p>
<p>Hopefully I'll get more game development done in the Autumn, since it looks like I'll still be quite busy during August.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/08/05/summer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I want to&#8230;</title>
		<link>http://www.brainfold.org/blog/2008/07/08/i-want-to/</link>
		<comments>http://www.brainfold.org/blog/2008/07/08/i-want-to/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 22:23:05 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=88</guid>
		<description><![CDATA[Finish these stupid courses - I have to use Java again for the other one, eww Prototype a game idea I had while driving home today - but not spend over a week on it Learn to draw some vector art - because it should be easier for "programmer art" than pixels Get a new [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li>Finish these stupid courses - I have to use Java again for the other one, eww</li>
<li>Prototype a game idea I had while driving home today - but not spend over a week on it</li>
<li>Learn to draw some vector art - because it should be easier for "programmer art" than pixels</li>
<li>Get a new job for Autumn</li>
<li>Get some sleep</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/07/08/i-want-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Box of horrors</title>
		<link>http://www.brainfold.org/blog/2008/07/01/box-of-horrors/</link>
		<comments>http://www.brainfold.org/blog/2008/07/01/box-of-horrors/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 19:33:21 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Artillery Brawl]]></category>
		<category><![CDATA[Box2d]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[graduation]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[pymunk]]></category>
		<category><![CDATA[setuptools]]></category>
		<category><![CDATA[studies]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=83</guid>
		<description><![CDATA[Today I adapted the nice setuptools-based plugin module from Spineless to more easily support different physics toolkits in my code, and played around a bit trying to write a Box2D plugin. Frankly, I don't like the Box2D API design at all, and I like the pyBox2D API even less, as it's a direct port of [...]]]></description>
			<content:encoded><![CDATA[<p>Today I adapted the nice <a href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a>-based plugin module from Spineless to more easily support different physics toolkits in my code, and played around a bit trying to write a <a href="http://www.box2d.org/">Box2D</a> plugin. Frankly, I don't like the Box2D API design at all, and I like the <a href="http://code.google.com/p/pybox2d/">pyBox2D</a> API even less, as it's a direct port of the C++ API and doesn't even try to be Pythonic. Eww. Seems I'll have to try fake sweeping collision detection and other tweaks to pymunk next to fix the collision problems I <a href="http://www.brainfold.org/blog/2008/06/30/bullet-through-the-wall/">wrote about</a>.</p>
<p>In other news, starting tomorrow I'll try to finish two university courses that are really long overdue and that I want out of the way before September. I have one short paper to write and one coding project to do, so game development progress will probably be a bit slower again for a while. But every finished course takes me closer to graduation (which I'm planning to do next year), so yay for that!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/07/01/box-of-horrors/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Entities ahoy!</title>
		<link>http://www.brainfold.org/blog/2008/06/28/entities-ahoy/</link>
		<comments>http://www.brainfold.org/blog/2008/06/28/entities-ahoy/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 01:27:14 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Artillery Brawl]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[entity system]]></category>
		<category><![CDATA[game development]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[issue tracker]]></category>
		<category><![CDATA[setuptools]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=79</guid>
		<description><![CDATA[Entity system Today I've continued work under the hood, on the entity system. Both components and entity types are now loaded using the plugin / entry point system of setuptools, which means custom components and units will be really easy to create and distribute. And much easier for me to load. I have a habit [...]]]></description>
			<content:encoded><![CDATA[<h4>Entity system</h4>
<p>Today I've continued work under the hood, on the entity system. Both components and entity types are now loaded using the plugin / entry point system of <a href="http://peak.telecommunity.com/DevCenter/setuptools">setuptools</a>, which means custom components and units will be really easy to create and distribute. And much easier for me to load. <img src='http://www.brainfold.org/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I have a habit of making too many sweeping changes to code at once, and this is no exception. On the other hand, this does result in massive improvements to the entity system and especially creation of entity type files, so it's all for the greater good.</p>
<p>No screenshots to show for my efforts, but see the end of the post for examples of what entity type files currently look like. This might change before these changes are completed.</p>
<h4>Entity editor</h4>
<p>I'll probably have to start working on an entity editor at some point, since I recon unit and other entity creation will get quite complicated when multiple linked entities, collision shapes, etc. etc. get involved. I'm no big fan of GUI programming, especially since Python's <a href="http://wiki.python.org/moin/GuiProgramming">GUI libraries</a> all seem kind of shoddy (though that seems to apply to other languages too, at least C# and Java). Anyway, I'll probably use <a href="http://wxpython.org/">wxPython</a> for it. Making it in-game would be cool, but too much effort at the moment.</p>
<h4>Trac</h4>
<p>I tried installing <a href="http://trac.edgewall.org/">Trac</a> (again) today since they just released version 0.11, and couldn't get it working (again). After getting over a few hurdles, I was finally stumped when trac-admin hanged while trying to create the environment. Every time. I really want to like Trac, since it's excellent when it works, but I've had nothing but problems trying to get it working myself. It seems I'll have to let it go and find some other issue tracker when I really start needing one. I'd like it to integrate with <a href="http://www.eclipse.org/mylyn/">Mylyn</a>, but the (free) options there are a bit limited. We'll see...</p>
<p><span id="more-79"></span></p>
<h4>Entity types files</h4>
<p>Here's what a unit type file currently looks like. The interface for this is not fully implemented yet, but I hope I'll get that finished during this weekend.</p>
<div class="codecolorer-container python dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> artillerybrawl <span style="color: #ff7700;font-weight:bold;">import</span> component, entity<br />
<span style="color: #ff7700;font-weight:bold;">from</span> artillerybrawl.<span style="color: black;">entity</span> <span style="color: #ff7700;font-weight:bold;">import</span> Entity<br />
<br />
Unit = entity.<span style="color: black;">get_class</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;unit&quot;</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">class</span> Howitzer<span style="color: black;">&#40;</span>Unit<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; name = <span style="color: #483d8b;">&quot;howitzer&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; Unit.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">mass</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">material</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">hitpoints</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">resistances</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Body</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_width</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_height</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_texture</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">collision_meshes</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Turret</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_offset</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_width</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_height</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_texture</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_min_angle</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_angle</span> = <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_power</span> = <span style="color: #008000;">None</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> create<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; entity = Unit.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Body</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; body_sprite = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;sprite&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_width</span>, <span style="color: #008000;">self</span>.<span style="color: black;">body_height</span>, <span style="color: #008000;">self</span>.<span style="color: black;">body_texture</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; body_physics = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;physics&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">mass</span>, <span style="color: #008000;">self</span>.<span style="color: black;">collision_meshes</span>, <span style="color: #008000;">self</span>.<span style="color: black;">material</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; body_damage = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;damage&quot;</span>, <span style="color: #008000;">self</span>.<span style="color: black;">hitpoints</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; body = Entity<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">name</span>, <span style="color: black;">&#40;</span>body_sprite, body_physics, body_damage<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Turret</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; turret_transform = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;transform&quot;</span>, parent=body<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; turret_sprite = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;sprite&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_width</span>, <span style="color: #008000;">self</span>.<span style="color: black;">turret_height</span>, <span style="color: #008000;">self</span>.<span style="color: black;">turret_texture</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; turret_component = component.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;turret&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_min_angle</span>, <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_angle</span>, <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_power</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; turret = Entity<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%s_turret&quot;</span> <span style="color: #66cc66;">%</span> <span style="color: #008000;">self</span>.<span style="color: black;">name</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#40;</span>turret_transform, turret_sprite, turret_component<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">return</span> body</div></div>
<p>And an actual unit base on the unit type above.</p>
<div class="codecolorer-container python dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #ff7700;font-weight:bold;">from</span> artillerybrawl <span style="color: #ff7700;font-weight:bold;">import</span> entity<br />
<br />
Howitzer = entity.<span style="color: black;">get_class</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;howitzer&quot;</span><span style="color: black;">&#41;</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">class</span> A1<span style="color: black;">&#40;</span>Howitzer<span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; name = <span style="color: #483d8b;">&quot;A1&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; Howitzer.<span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">mass</span> = <span style="color: #ff4500;">1000.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">material</span> = <span style="color: #483d8b;">&quot;metal&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">hitpoints</span> = <span style="color: #ff4500;">100</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">resistances</span> = <span style="color: black;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #483d8b;">&quot;kinetic&quot;</span>: <span style="color: #ff4500;">50.0</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Body</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_width</span> = <span style="color: #ff4500;">5.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_height</span> = <span style="color: #ff4500;">2.5</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">body_texture</span> = <span style="color: #483d8b;">&quot;a1&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">collision_meshes</span> = <span style="color: black;">&#91;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#91;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.0</span>, <span style="color: #ff4500;">0.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">1.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">0.0</span>, <span style="color: #ff4500;">1.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">0.0</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#91;</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0.0</span>, <span style="color: #ff4500;">0.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">1.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">0.0</span>, <span style="color: #ff4500;">1.0</span><span style="color: black;">&#41;</span>, <span style="color: black;">&#40;</span><span style="color: #ff4500;">1.0</span>, <span style="color: #ff4500;">0.0</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: black;">&#93;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Turret</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_offset</span> = <span style="color: black;">&#40;</span><span style="color: #ff4500;">2.5</span>, <span style="color: #ff4500;">2.5</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_width</span> = <span style="color: #ff4500;">5.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_height</span> = <span style="color: #ff4500;">1.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_texture</span> = <span style="color: #483d8b;">&quot;a1_turret&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_min_angle</span> = -<span style="color: #ff4500;">5.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_angle</span> = <span style="color: #ff4500;">85.0</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">self</span>.<span style="color: black;">turret_max_power</span> = <span style="color: #ff4500;">100.0</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/06/28/entities-ahoy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flashy stuff</title>
		<link>http://www.brainfold.org/blog/2008/05/16/flashy-stuff/</link>
		<comments>http://www.brainfold.org/blog/2008/05/16/flashy-stuff/#comments</comments>
		<pubDate>Fri, 16 May 2008 10:10:53 +0000</pubDate>
		<dc:creator>Jussi Lepistö</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[studies]]></category>

		<guid isPermaLink="false">http://www.brainfold.org/blog/?p=59</guid>
		<description><![CDATA[So I'm learning Flash now. It actually seems quite interesting, though I'm not a big fan of the scripting language (I'm using version 3.0 of ActionScript). But why did they have to make every window of the IDE have the same style, ie. dockable tool windows? Also, since they are not standard windows, the scroll [...]]]></description>
			<content:encoded><![CDATA[<p>So I'm learning Flash now. It actually seems quite interesting, though I'm not a big fan of the scripting language (I'm using version 3.0 of ActionScript). But why did they have to make <span style="text-decoration: underline;">every</span> window of the IDE have the same style, ie. dockable tool windows? Also, since they are not standard windows, the scroll wheel and some standard hotkeys don't seem to work... *sigh* It's impossible to use the built-in help this way, so I'll rather use the online help with my browser. I'm just doing a small project for a university course though, and I'm not planning to do anything gamedev related after that. Still, nice to get some new experiences development-wise.</p>
<p>I'm going out of town this weekend, and next week I'll probably have to concentrate on the Flash project, but after that I'll try to get back to game development since I shouldn't have any courses left for this Spring. So, until then!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brainfold.org/blog/2008/05/16/flashy-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
