<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6419069426408917488</id><updated>2011-09-28T22:12:25.413+01:00</updated><category term='story'/><category term='PovRay'/><category term='Java'/><category term='Alerts'/><category term='general'/><category term='HTML Javascript'/><title type='text'>Amazon Systems</title><subtitle type='html'>Documenting and sharing this Myst-like Adventure creation system.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>64</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-881674393431745978</id><published>2011-07-20T12:00:00.003+01:00</published><updated>2011-07-20T12:02:34.073+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Immediate Plan</title><content type='html'>1. Do all the junk scenes necessary for, say, the first 3 junk positions.&lt;br /&gt;2. Implement the navigation method.&lt;br /&gt;3. Make the new Bridgedata module, compile and test.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-881674393431745978?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/881674393431745978/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=881674393431745978' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/881674393431745978'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/881674393431745978'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2011/07/immediate-plan.html' title='Immediate Plan'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-5306764612441367614</id><published>2011-07-20T11:36:00.002+01:00</published><updated>2011-07-20T11:39:09.927+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>Hello again, GFORGE</title><content type='html'>To be honest, I was happier with GFORGE's terrains than I am with Terragen's, so I dug out the old W98 Notino, and verified that it would still run GFORGE. It gives me another development route problem, but I am relieved that I can get back to GFORGE if I have to.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-5306764612441367614?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/5306764612441367614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=5306764612441367614' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/5306764612441367614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/5306764612441367614'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2011/07/hello-again-gforge.html' title='Hello again, GFORGE'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-7378040143697119264</id><published>2011-07-19T18:22:00.003+01:00</published><updated>2011-07-20T11:40:08.819+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Goodbye, GFORGE. Hello, Terragen</title><content type='html'>Oh, dear. GFORGE no longer works for me, not in Windows XP and not in a DOS cmd box within Windows XP. Rather than drag out my old Windows 98 laptop to try that, I downloaded a free copy of Terragen, which does a similar sort of thing. &lt;br /&gt;&lt;br /&gt;Unfortunately, Terragen doesn't output in a form that POVray understands as a height field. &lt;br /&gt;&lt;br /&gt;But after much googling, I discovered For Export Only (FEO) which is a set of plugins for Terragen, including one that creates a BMP file that POVray understands.&lt;br /&gt;&lt;br /&gt;Ah, well. No-one said it was going to be easy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-7378040143697119264?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/7378040143697119264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=7378040143697119264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7378040143697119264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7378040143697119264'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2011/07/goodbye-gforge-hello-terragen.html' title='Goodbye, GFORGE. Hello, Terragen'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8275940074216298984</id><published>2011-07-15T13:17:00.002+01:00</published><updated>2011-07-15T13:20:07.756+01:00</updated><title type='text'>Sprite rocks.</title><content type='html'>Next task is to devise a number of rock sprites. I'll try several of these GFORGE terrain maker files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8275940074216298984?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8275940074216298984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8275940074216298984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8275940074216298984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8275940074216298984'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2011/07/sprite-rocks.html' title='Sprite rocks.'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2491230636228658598</id><published>2011-07-15T11:53:00.009+01:00</published><updated>2011-07-20T11:59:09.026+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='story'/><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Aide-memoire for the Junk navigation map</title><content type='html'>This entry is PROVISIONAL. It will be updated as necessary.&lt;br /&gt;Route S start -&gt; F finish * = defined&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  W   X   Y   Z&lt;br /&gt;1 * - F   * - * &lt;br /&gt;  |       |   |&lt;br /&gt;2 *   * - *   *&lt;br /&gt;  |   |       |&lt;br /&gt;3 *   *   S   *&lt;br /&gt;  |   |   |   |&lt;br /&gt;4 * - *   * - *&lt;br /&gt;&lt;br /&gt;Y3 Start. Sprite rocks stbd &lt;br /&gt;   Sprite cone port&lt;br /&gt;Y4 Open sea. Sprite cone stbd&lt;br /&gt;Z4 Rocks 2 + pylon on port - visible from cockpit port, bow port and cabin port&lt;br /&gt;Z3 Sprite rocks port &lt;br /&gt;   Sprite cone port&lt;br /&gt;Z2 Sprite rocks stbd &lt;br /&gt;   Sprite cone port&lt;br /&gt;Z1 Sprite rocks port and stbd&lt;br /&gt;   Rocks 3 + pylon fwd - visible from bow fwd only&lt;br /&gt;Y1 High Rocks fwd - visible from bow fwd only &lt;br /&gt;Y2 Rocks 2 stbd&lt;br /&gt;X2 Rocks 1 fwd. Visible bow fwd only&lt;br /&gt;X3 Girders&lt;br /&gt;X4 Open sea. Sprite cone port.&lt;br /&gt;W4 Rocks fwd.&lt;br /&gt;W3 Open sea. Sprite cone stbd.&lt;br /&gt;W2 Wreck port. Sprite cone stbd.&lt;br /&gt;W1 Rocks 1 + pylon on stbd - visible from cockpit stbd, bow stbd and cabin stbd&lt;br /&gt;   Jade on stbd bow - visible from bow fwd only&lt;br /&gt;X1 Finish. Jade fwd - visible from bow fwd only &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2491230636228658598?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2491230636228658598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2491230636228658598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2491230636228658598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2491230636228658598'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2011/07/aide-memoire-for-navigation-map.html' title='Aide-memoire for the Junk navigation map'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-1816182265555725572</id><published>2011-07-15T11:43:00.004+01:00</published><updated>2011-07-15T11:50:52.775+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>Rocks at sea</title><content type='html'>One of the sets of rocks I've been developing for scenery purposes. The texture used is Cork, which appears as a nice arid island.  Note the shadow of the junk's sails on the sea in front. In use, there will be a pylon with guidance 'traffic lights' on the island.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-K_EUewwFPkA/TiAapGV8JTI/AAAAAAAAAEM/9aEtcUeSX6o/s1600/junk.bmp"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://3.bp.blogspot.com/-K_EUewwFPkA/TiAapGV8JTI/AAAAAAAAAEM/9aEtcUeSX6o/s400/junk.bmp" border="0" alt=""id="BLOGGER_PHOTO_ID_5629528827592713522" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-1816182265555725572?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/1816182265555725572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=1816182265555725572' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/1816182265555725572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/1816182265555725572'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2011/07/rocks-at-sea.html' title='Rocks at sea'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-K_EUewwFPkA/TiAapGV8JTI/AAAAAAAAAEM/9aEtcUeSX6o/s72-c/junk.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-9197769803475564563</id><published>2011-07-14T10:51:00.006+01:00</published><updated>2011-07-14T11:32:28.062+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='story'/><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Back in harness</title><content type='html'>Having been distracted for several months by, for example, two editions of &lt;a href="http://mythaxis.co.uk"&gt;Mythaxis Magazine&lt;/a&gt; (worth a read), a golfing holiday, a new palmtop computer, new books and so on, I made a restart, two nights ago on my POVray creations. &lt;br /&gt;&lt;br /&gt;In fact, though I only hinted about it, I made a plan for the first part of the game that involved a bit of varied scenery. At first, I was envisaging sprites to supply even static scenery. Now, I'm more inclined to a mixture of sprites and static images.&lt;br /&gt;&lt;br /&gt;In the original post, I reproduced my notebook pages here. Totally incomprehensible, I'm afraid. I removed them.&lt;br /&gt;&lt;br /&gt;The plan is to gradually reveal the route to be followed by indicating previous and next positions by traffic light style markers on shore or on buoys. The map is gradually revealed on the screen in the cabin. When the problem has been solved, the player can go straight to the destination, but the first time he has to either guess it or work it out by following the route.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-9197769803475564563?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/9197769803475564563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=9197769803475564563' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/9197769803475564563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/9197769803475564563'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2011/07/back-in-harness.html' title='Back in harness'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-4591249194783588267</id><published>2010-12-13T00:39:00.004Z</published><updated>2010-12-13T01:03:50.260Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>POVRAY woes</title><content type='html'>In rendering the junk final images, I've encountered problems with ropes and the cabin textures. It only needs time, as ever. Even on my quickest machine, rendering takes hours per scene, and every time I get a rope position wrong, it has to be done again. I think I'll use cylinders and tori to get the anchor positions right, before final render. We're getting there. At least I'm working on it virtually every night now.&lt;br /&gt;&lt;br /&gt;I've embedded the instructions for multiple renders in the junk.pov code. In the past it's always taken forever to remember how to do it.&lt;br /&gt;&lt;br /&gt;KFI and KFF are the initial and final frame nos (each scene's file label is appended with frame no, which corresponds to scene no)&lt;br /&gt;&lt;br /&gt;KI and KF are the initial and final clock values which I use to change the scene no.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;// "animation" command line string (paste in empty command line box above)&lt;br /&gt;// +KFI100 +KFF102 +KI0 +KF2&lt;br /&gt;&lt;br /&gt;// comment out next line if animation in force&lt;br /&gt; #declare scene=100;&lt;br /&gt;&lt;br /&gt;// comment in following line if animation in force&lt;br /&gt;// #declare scene = clock+100;&lt;br /&gt;&lt;br /&gt;&lt;/tt&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-4591249194783588267?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/4591249194783588267/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=4591249194783588267' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4591249194783588267'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4591249194783588267'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/12/povray-woes.html' title='POVRAY woes'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2109126099670799463</id><published>2010-12-13T00:34:00.002Z</published><updated>2010-12-13T00:39:19.921Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML Javascript'/><title type='text'>MP3 player</title><content type='html'>An interruption - I may have found a suitable mp3 player (by Neolao) to substitute for the rather awkward MIDI player in the Javascript. (Note to self - see samsung/notino/bridge)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2109126099670799463?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2109126099670799463/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2109126099670799463' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2109126099670799463'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2109126099670799463'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/12/mp3-player.html' title='MP3 player'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8917119267429496450</id><published>2010-12-10T23:35:00.002Z</published><updated>2010-12-10T23:43:28.781Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='story'/><title type='text'>Starting to Build the new version</title><content type='html'>Now working on changing BridgeData.java to include the junk section. &lt;br /&gt;&lt;br /&gt;Had to re-discover the build route - it's more than a year since it was last changed. I've improved the build environment, and installed up to date JREs.&lt;br /&gt;&lt;br /&gt;Every time I start a scene, I trip over something I've forgotten, but it's progress, constant progress.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8917119267429496450?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8917119267429496450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8917119267429496450' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8917119267429496450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8917119267429496450'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/12/starting-to-build-new-version.html' title='Starting to Build the new version'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-847941867545002000</id><published>2010-11-15T11:53:00.002Z</published><updated>2010-11-15T12:03:43.594Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='story'/><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>The Junk Puzzle</title><content type='html'>Yup. Got it now. I've devised a 16 point maze - not really a maze, because there's many ways through it, and when you've solved it, you can go straight to the end next time you play. Each point in the grid, let's call it, has its own ID lights, and a different set of scenery around it, viewed from the junk. There are ten positions on the junk, bow, stern, facing various ways, and there is a different scene visible from each of these junk scenes, depending on the ID of the current point in the grid.&lt;br /&gt;&lt;br /&gt;So... the scenery is delivered by sprites rather than background, and the 160 possible visible scenes are reduced to ten with different sprites at each location. &lt;br /&gt;&lt;br /&gt;Each point in the grid indicates the adjacent IDs and the navigation system allows the player to move to whatever ID he favours.&lt;br /&gt;&lt;br /&gt;It's quite a lot of code, but it saves masses of scene files. Instead of 160 scenes, we have just the 10 on the junk, the background sprites being imposed on an empty sea/sky.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-847941867545002000?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/847941867545002000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=847941867545002000' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/847941867545002000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/847941867545002000'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/11/junk-puzzle.html' title='The Junk Puzzle'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-536316700217452128</id><published>2010-11-11T18:04:00.003Z</published><updated>2010-11-11T18:21:28.665Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='story'/><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>Feverish Activity behind the Scenes</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_g4a_aq3nffY/TNw0CasAIPI/AAAAAAAAADo/Ntm3CZpqwlQ/s1600/stairs.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 258px;" src="http://4.bp.blogspot.com/_g4a_aq3nffY/TNw0CasAIPI/AAAAAAAAADo/Ntm3CZpqwlQ/s400/stairs.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5538358857887129842" /&gt;&lt;/a&gt;&lt;br /&gt;Over the last few weeks, I've concentrated on a variety of articles on the junk - table, chairs, a bucket etc.&lt;br /&gt;&lt;br /&gt;The next stage is to build it into a new version of the example game, but that will involve some new work on the Sprites, to give the water a more realistic appearance.&lt;br /&gt;&lt;br /&gt;I also have to re-write the BridgeData module to control the new scenes.&lt;br /&gt;&lt;br /&gt;I am a little conflicted on the "Junk Puzzle" - i.e. how to get from the initial scene of being on the junk to getting to the island.  It mustn't be too obvious - the player should have to think about it - but I don't want it to turn into a maze.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-536316700217452128?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/536316700217452128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=536316700217452128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/536316700217452128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/536316700217452128'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/11/feverish-activity-behind-scenes.html' title='Feverish Activity behind the Scenes'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_g4a_aq3nffY/TNw0CasAIPI/AAAAAAAAADo/Ntm3CZpqwlQ/s72-c/stairs.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-6531849458500560960</id><published>2010-09-07T16:10:00.002+01:00</published><updated>2010-09-07T16:19:47.260+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='story'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Work re-commences.</title><content type='html'>I returned to this project yesterday.  I am designing the navigation system for the junk, one that uses coloured buttons and a map to lead the user round a number of locations at sea. The view outside the cabin and from the deck has to be consistent, with the appropriate angles of buoys and the island. These will have to be installed as sprites, so that we don't have to make a scene for every viewpoint.&lt;br /&gt;&lt;br /&gt;The cabin of the junk, from which navigation takes place, looked so stark that I'm installing a carpet in it.&lt;br /&gt;&lt;br /&gt;I still haven't figured out how to organise the puzzle. I don't want just a maze or point and click shooting gallery. There has to be some substance to the puzzle that looks soluble but isn't too easy.&lt;br /&gt;&lt;br /&gt;__________________________________&lt;br /&gt;&lt;br /&gt;Once I get the navigation in place, I'll do another test version. Watch this space.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-6531849458500560960?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/6531849458500560960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=6531849458500560960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/6531849458500560960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/6531849458500560960'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/09/work-re-commences.html' title='Work re-commences.'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-1724230809739045639</id><published>2010-05-21T09:51:00.001+01:00</published><updated>2010-05-21T09:57:01.232+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Odd Comments</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Odd Comments&lt;/span&gt;&lt;br /&gt;Just a little side issue here. I keep getting comments on the blog that I can't publish because the commenter's name and comment are rendered in a font that my browsers (none of them, and I have many) cannot render. If you are not having your comments published, then this is the reason. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Break in Transmission&lt;/span&gt;&lt;br /&gt;The recent pause was due to an extended period of working abroad without access to my code and Povray sources. Normal service will be resumed shortly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-1724230809739045639?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/1724230809739045639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=1724230809739045639' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/1724230809739045639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/1724230809739045639'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/05/odd-comments.html' title='Odd Comments'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2418850682588352855</id><published>2010-04-18T18:37:00.004+01:00</published><updated>2010-04-18T18:43:45.015+01:00</updated><title type='text'>Latest Junk Picture</title><content type='html'>I just finished this little beauty this morning. Note the ropes and the pylon. It took FIVE HOURS, THREE MINUTES AND TWO SECONDS to render! That was with a number of time-wasting options enabled, particularly the Rope functions.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_g4a_aq3nffY/S8tD3zgO_0I/AAAAAAAAAC4/keh_tN6lHNo/s1600/junk.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_g4a_aq3nffY/S8tD3zgO_0I/AAAAAAAAAC4/keh_tN6lHNo/s400/junk.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5461533599114133314" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2418850682588352855?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2418850682588352855/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2418850682588352855' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2418850682588352855'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2418850682588352855'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/04/latest-junk-picture.html' title='Latest Junk Picture'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_g4a_aq3nffY/S8tD3zgO_0I/AAAAAAAAAC4/keh_tN6lHNo/s72-c/junk.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-3157939768811223712</id><published>2010-04-16T14:59:00.002+01:00</published><updated>2010-04-16T15:02:38.835+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='story'/><title type='text'>Pylons</title><content type='html'>I'm going to have pylons in the water for the junk to use in navigation. These pylons will have a sort of road map on them, leading to the island.&lt;br /&gt;&lt;br /&gt;Things are moving much faster for me now. There's a thrill of anticipation that I'll soon have a second working example with much more substance to it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-3157939768811223712?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/3157939768811223712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=3157939768811223712' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3157939768811223712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3157939768811223712'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/04/pylons.html' title='Pylons'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8919985074463047061</id><published>2010-04-12T19:03:00.003+01:00</published><updated>2010-04-12T19:21:23.746+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Strategy Again</title><content type='html'>I am finding my slow pace of development irksome. I have today been thinking of strategies to get another short example game out quite quickly.&lt;br /&gt;&lt;br /&gt;Among these strategies are:&lt;br /&gt;&lt;br /&gt;Complete the first section of the game quickly, without further refinement, and forgetting the next section.&lt;br /&gt;&lt;br /&gt;So:&lt;br /&gt;- Junk&lt;br /&gt;- Dockside doors&lt;br /&gt;- Elevator&lt;br /&gt;&lt;br /&gt;I'll just get on with that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8919985074463047061?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8919985074463047061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8919985074463047061' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8919985074463047061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8919985074463047061'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/04/strategy-again.html' title='Strategy Again'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-9017251673675279908</id><published>2010-04-05T11:18:00.003+01:00</published><updated>2010-04-05T14:30:58.708+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Comments on POVray techniques</title><content type='html'>Following up on the comments in the previous post, I should point out that I can optionally apply a grid to any scene.  The grid is a series of cylinders, set 5 units apart and centred on the origin of the scene. That gives me an accurate measure of where to put an item. I build the item and rotate it at origin, then move it to the desired location.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_g4a_aq3nffY/S7nlwW61NbI/AAAAAAAAACw/bXW2n5h4E6A/s1600/Image1.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 382px; height: 237px;" src="http://2.bp.blogspot.com/_g4a_aq3nffY/S7nlwW61NbI/AAAAAAAAACw/bXW2n5h4E6A/s400/Image1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5456645042484884914" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The animation (which I may use for a multi-render batch file), briefly, works like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;"POV-Ray supports an automatically declared floating point variable identified as clock (all lower case). This is the key to making image files that can be automated. In command line operations, the clock variable is set using the +k switch. For example, +k3.4 from the command line would set the value of clock to 3.4. The same could be accomplished from the INI file using Clock=3.4 in an INI file. &lt;br /&gt;&lt;br /&gt;If we do not set clock for anything, and the animation loop is not used, the clock variable is still there - it is just set for the default value of 0.0, so it is possible to set up some POV code for the purpose of animation, and still render it as a still picture during the object/world creation stage of our project. &lt;br /&gt;&lt;br /&gt;The simplest example of using this to our advantage would be having an object which is travelling at a constant rate, say, along the x-axis. We would have the statement &lt;br /&gt;&lt;br /&gt;  translate &amp;lt;clock, 0, 0&amp;gt;"&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-9017251673675279908?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/9017251673675279908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=9017251673675279908' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/9017251673675279908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/9017251673675279908'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/04/comments-on-povray-techniques.html' title='Comments on POVray techniques'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_g4a_aq3nffY/S7nlwW61NbI/AAAAAAAAACw/bXW2n5h4E6A/s72-c/Image1.jpg' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8421453856823423275</id><published>2010-04-03T12:52:00.002+01:00</published><updated>2010-04-03T13:03:31.026+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Green Shoots of Recovery</title><content type='html'>Last night, I dusted this project off, improved the staircase algorithm, and added a staircase to the Jade island.&lt;br /&gt;&lt;br /&gt;One of the problems is the length of time each render now takes, even for a minor adjustment. However, once some new component is settled, I think it's probably going to be possible to set up a batch rendering job to produce all the renders anew, every time a significant component is added. &lt;br /&gt;&lt;br /&gt;I have decided to inch the project forward in its incomplete state, adding as many of the individual stages of the game as possible, even based on an incomplete background picture.&lt;br /&gt;&lt;br /&gt;For example, if a new bridge, building or piece of furniture is added to the island, then I might have to re-render a number of backgrounds later, and I might have to modify the positions of sprites to an extent, but better incomplete scenery at this stage rather than incomplete gameplay.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8421453856823423275?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8421453856823423275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8421453856823423275' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8421453856823423275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8421453856823423275'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2010/04/green-shoots-of-recovery.html' title='Green Shoots of Recovery'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-3824809422884233034</id><published>2009-12-14T23:56:00.003Z</published><updated>2009-12-15T00:02:41.739Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>Update</title><content type='html'>Like most bloggers, I sometimes take time off from blogging. &lt;br /&gt;&lt;br /&gt;I have had a number of interruptions, including a trip to Barcelona, work on Mythaxis and (guiltily) replaying Myst III - magnificent scenery.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I haven't been totally idle, though. Since I last blogged, I have refined the Junk and modified a spiral staircase algorithm to give me swooping stairways. I'll post some examples real soon now. And Christmas hols are coming up. I should get some more design done then.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-3824809422884233034?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/3824809422884233034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=3824809422884233034' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3824809422884233034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3824809422884233034'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/12/update.html' title='Update'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-189456293189975865</id><published>2009-09-11T17:45:00.002+01:00</published><updated>2009-09-11T17:56:48.278+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>Reporting completion on the Junk</title><content type='html'>It's been a slowish business, but I'm now reasonably happy with the junk. After all, it's only a platform for transport and a piece of furniture to view from afar. &lt;br /&gt;&lt;br /&gt;As a sprite, it'll be viewable at various sizes and seen from left or right, but not animated. &lt;br /&gt;&lt;br /&gt;I'll do a separate animation of the waterline splashing along, so it appears to be moving, and calculate speeds / sizes for various manifestations of it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-189456293189975865?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/189456293189975865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=189456293189975865' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/189456293189975865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/189456293189975865'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/09/reporting-completion-on-junk.html' title='Reporting completion on the Junk'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2875818712902003980</id><published>2009-08-17T10:32:00.005+01:00</published><updated>2009-08-20T18:26:17.333+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Yet More Junk</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_g4a_aq3nffY/Sokj3OJ0msI/AAAAAAAAACo/yCfYAHubYhM/s1600-h/junk2.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 329px; height: 375px;" src="http://4.bp.blogspot.com/_g4a_aq3nffY/Sokj3OJ0msI/AAAAAAAAACo/yCfYAHubYhM/s400/junk2.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5370863462215097026" /&gt;&lt;/a&gt; The latest version of the junk and its dinghy (which shares the junk's hull shape) &lt;span style="font-style:italic;"&gt;sans&lt;/span&gt; ropes, but ropes will appear soon, thanks to Chris Bartlett's Rope macros and "after-sales support". &lt;br /&gt;&lt;br /&gt;&lt;a href="http://benroux.skyrock.com/"&gt;Benjamin Roux&lt;/a&gt;  has also volunteered to help with the project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2875818712902003980?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2875818712902003980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2875818712902003980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2875818712902003980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2875818712902003980'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/08/more-junk.html' title='Yet More Junk'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_g4a_aq3nffY/Sokj3OJ0msI/AAAAAAAAACo/yCfYAHubYhM/s72-c/junk2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8345944833809598139</id><published>2009-07-28T15:12:00.003+01:00</published><updated>2009-07-28T15:19:31.936+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>More Junk</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_g4a_aq3nffY/Sm8HjKT92YI/AAAAAAAAACg/u4SSW0lve-s/s1600-h/junk1.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 294px; height: 208px;" src="http://3.bp.blogspot.com/_g4a_aq3nffY/Sm8HjKT92YI/AAAAAAAAACg/u4SSW0lve-s/s400/junk1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5363513981866465666" /&gt;&lt;/a&gt;Got the masts and sails in the junk. Had some difficulty with the decks, because patches are not 'real' shapes and differences, intersections etc don't work the way you'd expect. Solving it by fitting a deckhouse and then painstakingly filling in the areas left with boxes and polygons, which will lead to a more authentic final appearance. The picture here is hull, deckhouse, mast and sails.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8345944833809598139?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8345944833809598139/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8345944833809598139' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8345944833809598139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8345944833809598139'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/07/got-masts-and-sails-in-junk.html' title='More Junk'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_g4a_aq3nffY/Sm8HjKT92YI/AAAAAAAAACg/u4SSW0lve-s/s72-c/junk1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-4337563835410815434</id><published>2009-07-22T22:17:00.004+01:00</published><updated>2009-07-22T22:53:59.594+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>Junk</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_g4a_aq3nffY/SmeCdobsrVI/AAAAAAAAACY/qsQSaO5zDds/s1600-h/junk.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 161px;" src="http://4.bp.blogspot.com/_g4a_aq3nffY/SmeCdobsrVI/AAAAAAAAACY/qsQSaO5zDds/s400/junk.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5361397326989274450" /&gt;&lt;/a&gt;&lt;br /&gt;Put together the hull for a Chinese Junk, using 3 bicubic patches (actually 2, because the port and starboard hull sections are mirror images of each other.) The view is of the transom (rear end) of the boat. I took the measurements for the hull profile from a design on the internet.&lt;br /&gt;&lt;br /&gt;Next, the decks and masts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-4337563835410815434?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/4337563835410815434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=4337563835410815434' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4337563835410815434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4337563835410815434'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/07/junk.html' title='Junk'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_g4a_aq3nffY/SmeCdobsrVI/AAAAAAAAACY/qsQSaO5zDds/s72-c/junk.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-5218551507952051889</id><published>2009-06-13T18:23:00.004+01:00</published><updated>2009-06-13T18:49:42.307+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='story'/><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>A Few Extra Plot and Image Points</title><content type='html'>I envisage a sea cave that the boat can sail into, but only when the portcullis across its entrance has been raised. So the player is at a land entrance to the cave, and can raise the gate from there, but the dock in the cave is only reachable by the boat sailing in.&lt;br /&gt;&lt;br /&gt;Also, I started to devise a new spiral staircase function where the steps were not connected at the centre. I realised yesterday I could use an existing spiral stair function, and cut the centre out of it by differencing with a cylinder. I'd still have to add vertical struts on the edges for realism - a staircase can't just hang in the air - but the main job will be done.&lt;br /&gt;&lt;br /&gt;Fan animation. I observed how a fan opens. The rearmost blade of the fan stays still, and only the top blade is showing. The top blade flips out, pulling the next and the next and so on. &lt;br /&gt;&lt;br /&gt;I suspect the best way to create the images for this in povray would be in reverse. Start with the open fan as an array of blades, coat the array with the image, then for subsequent frames, pull the top blade back over the one underneath it, then pull them both back over the third, and so on, until the fan is closed. I'm not entirely sure this is possible, though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-5218551507952051889?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/5218551507952051889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=5218551507952051889' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/5218551507952051889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/5218551507952051889'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/06/few-extra-plot-and-image-points.html' title='A Few Extra Plot and Image Points'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2480472805192508893</id><published>2009-06-12T18:23:00.008+01:00</published><updated>2009-06-13T18:43:49.963+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='story'/><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>A Bit of a Brain Dump</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_g4a_aq3nffY/SjKXGLi_WwI/AAAAAAAAACQ/p064koGHR00/s1600-h/junkdraw.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 253px; height: 400px;" src="http://4.bp.blogspot.com/_g4a_aq3nffY/SjKXGLi_WwI/AAAAAAAAACQ/p064koGHR00/s400/junkdraw.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5346501840076757762" /&gt;&lt;/a&gt;&lt;br /&gt;I haven't posted very much lately, partly because I was getting out the next issue of &lt;a href="http://mythaxis.co.uk" target=_blank&gt;&lt;span style="font-weight:bold;"&gt;Mythaxis&lt;/span&gt;&lt;/a&gt;, but I have been thinking about it a lot. I have decided to start the game on a boat - a Chinese Junk. The boat can transport the player to various locations around the island as necessary, and I would use a chart table below decks to direct the boat to the destination.&lt;br /&gt;&lt;br /&gt;The boat will also contain a number of useful items - including a fan to transport the player back to the junk, or summon it. &lt;br /&gt;&lt;br /&gt;I already have a boat in povray. I just have to elaborate it a bit.&lt;br /&gt;&lt;br /&gt;In thinking about this, I realised we must have a rocking effect for the scenery when on deck. I considered using an array of &lt;span style="font-weight:bold;"&gt;g2d&lt;/span&gt; rotated images for this, but I think it'll be easier just to pre-rotate the images in Paint Shop Pro and load them as sprites. I can arrange that they not be the whole size of the applet window by placing static sprites of portholes, sails, deckhouses etc to frame the background which will be a lower priority sprite.&lt;br /&gt;&lt;br /&gt;I was briefly worried about fan management, because there are several fan functions, which I solved by having a hot spot on the open fan, and by having a special room for open fans.&lt;ul&gt;&lt;li&gt;pick up (closed) fan - double click when fan not carried&lt;li&gt;drop (closed) fan - double click when fan carried&lt;li&gt; open fan - single click when in inventory 'room' only and fan is closed&lt;li&gt; close fan - single click (not on fan hot spot) when in inventory 'room' only and fan is open&lt;li&gt;use fan - click on hot spot on open fan&lt;/ul&gt;Sounds complex, I know, but I think it'll be natural. I may remove the restriction on opening the fan only in the inventory. Fan animation is going to be fun!&lt;br /&gt;&lt;br /&gt;I have come to the conclusion that I have to fill out the game in povray before I do any more gameplay. I just keep realising that the game isn't rich enough without a good deal more articles in it.  The game's going to be small enough without looking impoverished. So the next big push is scenery.&lt;br /&gt;&lt;br /&gt;I still haven't bitten the bullet of music in mp3, but I'm not too worried about that.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2480472805192508893?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2480472805192508893/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2480472805192508893' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2480472805192508893'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2480472805192508893'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/06/bit-of-brain-dump.html' title='A Bit of a Brain Dump'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_g4a_aq3nffY/SjKXGLi_WwI/AAAAAAAAACQ/p064koGHR00/s72-c/junkdraw.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-7783081936353223264</id><published>2009-05-22T00:30:00.001+01:00</published><updated>2009-05-22T00:31:52.645+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Break in Transmission</title><content type='html'>A whole month since I've had time to concentrate on The Game, but watch this space...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-7783081936353223264?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/7783081936353223264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=7783081936353223264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7783081936353223264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7783081936353223264'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/05/break-in-transmission.html' title='Break in Transmission'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-7099958338225050809</id><published>2009-04-22T00:36:00.002+01:00</published><updated>2009-04-22T00:40:01.432+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Version 1.1 now available</title><content type='html'>A zipped version with all the fixes to date is now available.&lt;br /&gt;&lt;br /&gt;The original (lame) example now runs on 1.1 code.&lt;br /&gt;&lt;br /&gt;Both of these can be accessed via:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://amazonsystems.phpzilla.net/" target=_blank &gt; http://amazonsystems.phpzilla.net/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-7099958338225050809?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/7099958338225050809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=7099958338225050809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7099958338225050809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7099958338225050809'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/04/version-11-now-available.html' title='Version 1.1 now available'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8266390856514449823</id><published>2009-04-16T23:52:00.002+01:00</published><updated>2009-04-17T00:04:37.140+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>What Next?</title><content type='html'>I think I have reached a suitable point at which to preserve the current state of the code. So I'll upload version 1.1 in due course.&lt;br /&gt;&lt;br /&gt;Next stage will be new artwork, followed by a new puzzle, then the music problem must be solved.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8266390856514449823?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8266390856514449823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8266390856514449823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8266390856514449823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8266390856514449823'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/04/what-next.html' title='What Next?'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8873435686830261487</id><published>2009-04-16T10:42:00.004+01:00</published><updated>2009-04-16T16:29:30.522+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Scale and Flip facilities</title><content type='html'>I have now added scale and flip facilities, to allow the same image to be used for a sprite at different sizes and reversed.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_g4a_aq3nffY/SedNt2TmEqI/AAAAAAAAACI/k-M0pl_vKV0/s1600-h/key.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 50px; height: 100px;" src="http://3.bp.blogspot.com/_g4a_aq3nffY/SedNt2TmEqI/AAAAAAAAACI/k-M0pl_vKV0/s400/key.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5325310534456054434" /&gt;&lt;/a&gt;&lt;br /&gt;Different scale in x and y direction is possible, invert, mirror and all three.&lt;br /&gt;&lt;br /&gt;In the diagram:&lt;br /&gt;1. Normal sprite&lt;br /&gt;2. 75% scale on both x and y axes&lt;br /&gt;3. 75% scale on both x and y axes plus mirror&lt;br /&gt;4. 75% scale on both x and y axes plus mirror plus invert&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8873435686830261487?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8873435686830261487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8873435686830261487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8873435686830261487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8873435686830261487'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/04/scale-and-flip-facilities.html' title='Scale and Flip facilities'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_g4a_aq3nffY/SedNt2TmEqI/AAAAAAAAACI/k-M0pl_vKV0/s72-c/key.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8167883920380930162</id><published>2009-04-11T00:29:00.007+01:00</published><updated>2009-06-12T19:13:24.185+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Priority</title><content type='html'>Having a little trouble with the priority of sprites, but nothing desperate yet. I have a feeling that monkeying with vector elements is the cause of the problem. I may have to try a different approach to sorting the sprite list.&lt;br /&gt;&lt;br /&gt;(later) Schoolboy error. I was using &lt;span style="font-weight:bold;"&gt;insert&lt;/span&gt;ElementAt() instead of &lt;span style="font-weight:bold;"&gt;set&lt;/span&gt;ElementAt().&lt;br /&gt;&lt;br /&gt;Thus - the &lt;span style="font-style:italic;"&gt;Vector&lt;/span&gt; of &lt;span style="font-style:italic;"&gt;Sprite&lt;/span&gt;s appears in &lt;span style="font-weight:bold;"&gt;slist&lt;/span&gt;:&lt;br /&gt;&lt;pre&gt;//      This is a sinking sort. On first pass, the highest&lt;br /&gt;//      priority sprite arrives at the bottom. On second,&lt;br /&gt;//      the next highest arrives at second bottom, etc.&lt;br /&gt;//      Sprites of the same priority remain in their&lt;br /&gt;//      original sequence with respect to each other.&lt;br /&gt;    for (ii = 0; ii&lt; slist.size()-1; ii++)&lt;br /&gt;    {&lt;br /&gt;        for (jj = 0; jj &lt; (slist.size()-ii-1); jj++)&lt;br /&gt;        {&lt;br /&gt;            spare1 = (Sprite)slist.elementAt(jj);&lt;br /&gt;            spare2 = (Sprite)slist.elementAt(jj+1);&lt;br /&gt;            if (spare1.getPriority() &gt; spare2.getPriority())&lt;br /&gt;            {&lt;br /&gt;                slist.setElementAt(spare1, jj+1);&lt;br /&gt;                slist.setElementAt(spare2, jj);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8167883920380930162?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8167883920380930162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8167883920380930162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8167883920380930162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8167883920380930162'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/04/priority.html' title='Priority'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-3823925875919962960</id><published>2009-04-09T23:19:00.003+01:00</published><updated>2009-04-11T00:32:25.629+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Gull motion bug fixed</title><content type='html'>I was dissatisfied with the original gull motion (see 30 December 2008 entry). Found out what it was today. &lt;br /&gt;&lt;br /&gt;The previous table had the gull stopping for an extra beat at zero deflection. Now deflection goes from +3 to -3.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-3823925875919962960?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/3823925875919962960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=3823925875919962960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3823925875919962960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3823925875919962960'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/04/gull-motion-bug-fixed.html' title='Gull motion bug fixed'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-4430787154760814207</id><published>2009-04-06T00:00:00.004+01:00</published><updated>2009-04-06T00:13:39.484+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Important bug solved</title><content type='html'>Sorted. The solution was to drop anything being carried into the limbo room before doing the Restore. The bug was caused by the clash of an object being simultaneously carried and restored to an uncarried situation.&lt;br /&gt;&lt;br /&gt;Also, and in connection with this bug, I added the "limbo" room to the system. All adventures need a limbo room in which to store objects that aren't anywhere else. For example, a sprite that has been destroyed, or has not yet been revealed can be left in there where it will do no harm until such a condition arises whereby the game writer decides to put the object back in play. "limbo", like "inventory" becomes a compulsory scene in the system, because it is referred to in the RestoreGame function by name.&lt;br /&gt;&lt;br /&gt;After another sweep through the code to pick up any other anomalies or improvements, I'll publish version 1.1 in both source and runtime.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-4430787154760814207?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/4430787154760814207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=4430787154760814207' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4430787154760814207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4430787154760814207'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/04/important-bug-solved.html' title='Important bug solved'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-323814144031474312</id><published>2009-03-28T16:41:00.003Z</published><updated>2009-04-04T13:36:03.155+01:00</updated><title type='text'>Important bug</title><content type='html'>&lt;span style="font-style:italic;"&gt;I've found a bug that sometimes, on a restore, leaves a sprite lying on every scene, a sprite that cannot be picked up. I can't reliably reproduce it. I thought at first that if you started a new game and restored a situation in which you were carrying a sprite, then it happened, but it doesn't seem to be that. Ho-hum... The position it occupies on the restored scene and all other scenes is the same as its original (i.e. game start) position.&lt;/span&gt; Later (much later, days later) I stumbled upon the bug again and can now reproduce it. It happens if I put the key in the inventory, then exit the inventory and save. Then I enter the inventory and pick up the key and restore. Now I can reproduce it, it should be simple to fix!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-323814144031474312?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/323814144031474312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=323814144031474312' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/323814144031474312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/323814144031474312'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/important-bug.html' title='Important bug'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-3503872401955915475</id><published>2009-03-27T17:43:00.005Z</published><updated>2009-03-27T17:58:18.682Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>Development problem solved</title><content type='html'>I was finding that new versions of the code were not being acknowledged in Firefox, so that even if I made a change, it kept the old code.&lt;br /&gt;&lt;br /&gt;Discovered that you have to bring up the Java console and type x to clear the classloader cache. At first, IE didn't seem to have the same problem, but that was probably because I restarted IE every time I tested it.&lt;br /&gt;&lt;br /&gt;Anyway, to be on the safe side, I clear the classloader cache every time now.&lt;br /&gt;&lt;br /&gt;And using mousePressed() instead of mouseClicked() works a treat. The mouse response is very much better now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-3503872401955915475?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/3503872401955915475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=3503872401955915475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3503872401955915475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3503872401955915475'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/development-problem-solved.html' title='Development problem solved'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-7844161606448151397</id><published>2009-03-27T00:12:00.002Z</published><updated>2009-03-27T00:23:52.068Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>Development system</title><content type='html'>Over the last few days, I've set up a simple development system using command line calls to javac etc. I've installed EZ Document Safe to keep the sources and versions in order.&lt;br /&gt;&lt;br /&gt;The good news is that the original code still compiles and runs. &lt;br /&gt;&lt;br /&gt;I have found out why the mouse click doesn't work so well. If you drag the mouse a little when you press, you don't get a Clicked event; you may or may not get a Dragged event; you may get both; and it all depends on the JRE platform, the timing and how far it was dragged. There's a certain amount of discussion on SunWeb about the matter, and I used a test application to see what was going on.&lt;br /&gt;&lt;br /&gt;I've devised a new system which ought to work on all platforms. I'll try it soon.&lt;br /&gt;&lt;br /&gt;I have also downloaded JLayer, an mp3 player. It works in free-standing mode, but I don't know how it'll fare when I try to incorporate it into my code. I may just run it in a separate applet like the current midi ones.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-7844161606448151397?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/7844161606448151397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=7844161606448151397' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7844161606448151397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7844161606448151397'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/development-system.html' title='Development system'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-3606806818567832017</id><published>2009-03-26T23:39:00.007Z</published><updated>2009-03-27T00:32:54.935Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='story'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Some Story and Setting Outlines</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_g4a_aq3nffY/ScweqsFoRTI/AAAAAAAAACA/pLdLmed_fQM/s1600-h/notes.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 278px;" src="http://1.bp.blogspot.com/_g4a_aq3nffY/ScweqsFoRTI/AAAAAAAAACA/pLdLmed_fQM/s400/notes.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5317658978755822898" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;h2&gt;Chinese Myst - Ideas&lt;/h2&gt;&lt;br /&gt;Major features :&lt;br /&gt;o 3 mountains, each with a different character&lt;br /&gt;o Bridges which need to be deployed&lt;br /&gt;o Stairways and paths&lt;br /&gt;o Pagodas, elevators, secret compartments and passages&lt;br /&gt;o Monastery&lt;br /&gt;o Nothing that's inappropriate technology, so use water power, clockwork, rope and pulley, steam etc.&lt;br /&gt;o Locks, Puzzle locks, trapdoors&lt;br /&gt;o Parts to fit in a matrix or jig-saw&lt;br /&gt;o Logical puzzles&lt;br /&gt;&lt;br /&gt;Despite appropriateness of technology, allow a &lt;span style="font-weight:bold;"&gt;little&lt;/span&gt; magic - tiny dragons, animated statues, self-igniting candles, ghost, fireworks, distant events in a crystal ball or animated picture or model. Also the fan is the equivalent of the Myst book (teleport mechanism).&lt;br /&gt;&lt;br /&gt;Temple dogs, vases, chest of many drawers, lamps, screens, nested objects, musical instruments, cabinets, boxes, gong, water clock, teapot.&lt;br /&gt;&lt;br /&gt;? Boat travel ? Aerial Runway&lt;br /&gt;&lt;br /&gt;No language or writing, but perhaps some simple symbols.&lt;br /&gt;&lt;br /&gt;Tiny model of the game world.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The Objective&lt;/h2&gt;&lt;br /&gt;(i) Must be revealed without verbal description so it could be demonstrated in a picture or a fan.&lt;br /&gt;&lt;br /&gt;(ii) NOT the following hackneyed objectives:&lt;br /&gt;a) Lord of Evil - destroy him... NO!&lt;br /&gt;b) Imprisoned Princess - free her... NO! NO!&lt;br /&gt;c) Save the Planet... NO! NO! NO!&lt;br /&gt;d) Find the Ultimate Treasure... NOT AGAIN!&lt;br /&gt;&lt;br /&gt;(iii) Well, perhaps a treasure hunt with trophy case. Collect seven treasures. The empty trophy case at the beginning, the filled one ends the game. A picture shows how the trophy case should look.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-3606806818567832017?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/3606806818567832017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=3606806818567832017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3606806818567832017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3606806818567832017'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/some-story-and-setting-outlines.html' title='Some Story and Setting Outlines'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_g4a_aq3nffY/ScweqsFoRTI/AAAAAAAAACA/pLdLmed_fQM/s72-c/notes.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-7946417913684767258</id><published>2009-03-14T23:27:00.004Z</published><updated>2009-03-14T23:40:34.256Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Parallel Development</title><content type='html'>I've now described the original game, and delivered the sources for public consumption. Next, I shall embark on a new generation of the game.&lt;br /&gt;&lt;br /&gt;Writing this game all by myself is going to be a bit of a challenge and a trifle lonely. Three threads have to be handled:&lt;ul&gt;&lt;li&gt;Engine code development&lt;/li&gt;&lt;li&gt;POVRay images development&lt;/li&gt;&lt;li&gt;Story development&lt;/li&gt;&lt;/ul&gt;Frankly, I could do with some help on any of the threads.&lt;br /&gt;&lt;br /&gt;First, I'll set up a new code development and test environment.  I don't even know if my 2003 code will still compile and work if I recompile it with an up-to-date Java. Most of my early development took place on J++, which, despite its shortcomings, was a pretty friendly development environment. Latterly, I was using the Sun bare bones development system. I flirted with Borland JBuilder for a while, but it was more trouble than benefit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-7946417913684767258?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/7946417913684767258/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=7946417913684767258' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7946417913684767258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7946417913684767258'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/parallel-development.html' title='Parallel Development'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-4602298578070236840</id><published>2009-03-10T23:06:00.006Z</published><updated>2009-03-16T23:26:30.293Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><title type='text'>Returning to POVRay</title><content type='html'>&lt;img src="http://amazonsystems.phpzilla.net/images/view10.jpg" alt="scene=10"&gt;&lt;br /&gt;I no longer have the POVRay source I used for the example game, but the current (2008) version is not so very dissimilar, so I have stored that at &lt;a href= "http://amazonsystems.phpzilla.net" target =_blank&gt; http://amazonsystems.phpzilla.net&lt;/a&gt; too. &lt;br /&gt;&lt;br /&gt;The whole of the game world is contained within the single source file &lt;span style="font-weight:bold;"&gt;China3.pov&lt;/span&gt;. Quite near the beginning of the file, you can choose a scene number. The approximate aspect covered by the scene number is described in a comment.&lt;br /&gt;&lt;br /&gt;The islands are described by the height file &lt;span style="font-weight:bold;"&gt;Output.tga&lt;/span&gt;. &lt;br /&gt;&lt;br /&gt;What you get is a terrain marked out in triangles. I have given it a jade texture, which seems to suit the angular effect. Some of the textures I have specified are rather simple and will be altered for final rendering, as they take too long for testing if complex.&lt;br /&gt;&lt;br /&gt;The world is not very rich in variety as yet. I intend to add details such as trees and other plants, stones, and various "natural" features. Other scenery will include tunnels, stairways and buildings. I have included a bamboo object to use as building materials, with the bamboo.gif file for texture.&lt;br /&gt;&lt;br /&gt;The game itself will require buttons, levers, doors, bridges, mechanisms and no end of cunning stuff, but often, though they may be designed in POVRay so that they match the surrounding illumination and background, they will be delivered in the game as sprites rather than as scenery, so that they can move.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-4602298578070236840?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/4602298578070236840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=4602298578070236840' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4602298578070236840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4602298578070236840'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/returning-to-povray.html' title='Returning to POVRay'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-3608950074489744296</id><published>2009-03-07T19:56:00.003Z</published><updated>2009-03-07T20:03:44.644Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Public access to Bridge files.</title><content type='html'>I eventually settled on phpzilla.net, which provides 5 Gigs free storage (at the expense of a little banner advertising on web pages and a few splash pages which inconvenience me, but not the user). You can see the address in my links listing in the sidebar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-3608950074489744296?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/3608950074489744296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=3608950074489744296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3608950074489744296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3608950074489744296'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/public-access-to-bridge-files.html' title='Public access to Bridge files.'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-1755019779529022977</id><published>2009-03-04T23:10:00.002Z</published><updated>2009-03-04T23:14:52.678Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Public File Access</title><content type='html'>Although, by the time you read this, the problem will be solved, I felt it worthwhile to air the alternatives I am considering.&lt;br /&gt;&lt;br /&gt;Since we may finish up with quite a lot of data, especially images and mp3s, I am reluctant to host them at my &lt;a href="http://amazonsystems.co.uk" target=_blank&gt;base website - amazonsystems.co.uk&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;At first, I thought &lt;a href="http://humyo.com" target=_blank&gt;humyo.com&lt;/a&gt; the ideal situation for the public airing and sharing of files. I set up a Bridge account and uploaded some data files to it. However, it developed that files stored there were not freely available to web users who did not have their own humyo account. A possible solution is to set up a "guest" account at humyo, an account with read permission for the Bridge account, and publish the username and password on the blog, so anyone could have access. The downside of this is that the huge filestore (10 Gigs) on the guest account would be tempting to spammers, pornographers and other time-wasters. You can be sure they would not fail to exploit the space in some horrid fashion, and I would get the blame.&lt;br /&gt;&lt;br /&gt;A "public" Gmail account could be used. Ideally, the data could be held as attachments to bogus emails (this usage of Gmail is quite common). Again, unfortunately, such an account would be open to abuse.&lt;br /&gt;&lt;br /&gt;In either of the above instances, I could deliver the keys of the accounts only to those who requested them, but this would discourage casual surfers and people of a suspicious disposition, without protecting me from those who pretended an interest only to gain access to the online storage for their own ends.&lt;br /&gt;&lt;br /&gt;The ideal medium for public data is webspace, and I am confident of finding some free webspace somewhere. I am already using a few such sites for various fringe projects, but all have rather small webspace quotas for free users. I may finish up paying for extra webspace on my own site. Sigh.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-1755019779529022977?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/1755019779529022977/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=1755019779529022977' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/1755019779529022977'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/1755019779529022977'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/public-file-access.html' title='Public File Access'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-4671709890294232885</id><published>2009-03-03T23:07:00.002Z</published><updated>2009-03-04T23:14:32.737Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Panic over</title><content type='html'>The stricken site - &lt;a href="http://carfilhiot.co.uk" target=_blank&gt;Carfilhiot&lt;/a&gt; - has now been repaired. I had a MySQL backup of the site which was in Nucleus, and foolishly decided to convert it to WordPress manually, rather than use a conversion utility. This had the advantage of enabling me to check links and make small corrections, but it was time-consuming in the extreme, and I have only just finished. Work got in the way, too.&lt;br /&gt;&lt;br /&gt;Tomorrow, I'll get started on a few more ideas I'm contemplating for the game system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-4671709890294232885?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/4671709890294232885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=4671709890294232885' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4671709890294232885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4671709890294232885'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/03/panic-over.html' title='Panic over'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-1353312117150508526</id><published>2009-01-29T22:54:00.003Z</published><updated>2009-01-29T23:04:45.218Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>A Little Pause</title><content type='html'>Some cretin hacked into &lt;a href="http://carfilhiot.co.uk"&gt;&lt;span style="font-weight:bold;"&gt;one of my other sites&lt;/span&gt;&lt;/a&gt;, and installed a php bulk mailer, presumably in the laudable aim of extending the world's reproductive capabilities. Since I believe that the world is already over-populated, I made haste to trash the whole thing, and I'm rebuilding it. Back to game development soon.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-1353312117150508526?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/1353312117150508526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=1353312117150508526' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/1353312117150508526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/1353312117150508526'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/01/little-pause.html' title='A Little Pause'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2020905003907434171</id><published>2009-01-13T12:06:00.005Z</published><updated>2009-01-29T22:58:43.344Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='PovRay'/><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>The Graphic Environment of the Game</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.amazonsystems.co.uk/images/chinaplan.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 632px; height: 325px;" src="http://www.amazonsystems.co.uk/images/chinaplan.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;Using PovRay, a free ray-tracing package, I've built the island environment in which the game plays. You only see a fraction of it in the sample game, and even that is badly textured. &lt;br /&gt;&lt;br /&gt;The basic terrain was mapped out using GFORGE - producing a height model which PovRay accepts and builds into a surface.&lt;br /&gt;&lt;br /&gt;The scale is not vast. At the left of the plan above, you can see the L-shaped landing stage in brown, which is 2.8 metres wide.&lt;br /&gt;&lt;br /&gt;A bonus of this construction method is that the interior of the surface is hollow, and so if a tunnel is driven into the rock, it reveals a cavern, the full height of the mountain. It is necessary to conceal the fact that the mountain is paper-thin by never showing the actual edge of the hole!&lt;br /&gt;&lt;br /&gt;The development plans I have so far are :&lt;ul&gt;&lt;li&gt;a "trophy room" type of ending to the game, in which, once all the collected items are brought to the room, the game ends&lt;li&gt;a door with a maze lock&lt;li&gt;an elevator worked by water power which the player has to set working by moving valves&lt;li&gt;boats&lt;li&gt;bamboo stairways and structures&lt;li&gt;trees and vegetation&lt;li&gt;lots of odd items&lt;li&gt;a control centre on the left hand peak which lifts and lowers bridges and generally opens and closes pathways.&lt;/ul&gt; I intend to concentrate on a rich environment that is a pleasure to be in, as opposed to a simple puzzle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2020905003907434171?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2020905003907434171/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2020905003907434171' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2020905003907434171'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2020905003907434171'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/01/graphic-environment-of-game.html' title='The Graphic Environment of the Game'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-7292165440607104109</id><published>2009-01-13T11:25:00.000Z</published><updated>2009-01-13T11:26:28.162Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>The Display Manager</title><content type='html'>Finally, we come to the DisplayManager - the last item in the list of&lt;br /&gt;Java classes.&lt;br /&gt;&lt;br /&gt;The DisplayManager handles the graphics, using an off-screen buffer and&lt;br /&gt;a clean version of the background. At each frame change, the previous&lt;br /&gt;dirty rectangles are cleaned by writing the background into them, and&lt;br /&gt;then the sprites are copied to the off-screen buffer, and the new dirty&lt;br /&gt;rectangles redisplayed.&lt;br /&gt;&lt;br /&gt;In a paint() call, only the dirty rectangles are displayed. In an&lt;br /&gt;update(), the whole screen is written.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;I think an unnecessary DirtyRectSet is defined in Bridge. Priority is&lt;br /&gt;not being taken into account in sprite write sequence. There may still&lt;br /&gt;be some confusion as to when an update and when a full redisplay takes&lt;br /&gt;place.&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/**&lt;br /&gt; *&lt;br /&gt; * DisplayManager.java&lt;br /&gt; * @author    Mark G. Tacchi (mtacchi@next.com) &lt;br /&gt; * @version    0.8&lt;br /&gt; * Mar 28/1996&lt;br /&gt; * Heavily modified, with permission, by Gil Williamson 2003&lt;br /&gt; *&lt;br /&gt; * DisplayManager provides optimized screen display. Images are drawn to&lt;br /&gt; * an offscreen buffer and blitted out to the display.  If images are close&lt;br /&gt; * to one another, they are coalesced and blitted as a single image.&lt;br /&gt; *&lt;br /&gt; * A read only cache is kept which represents an untainted background image.&lt;br /&gt; * This is used in the optimization algorithm as a source for a clean&lt;br /&gt; * background.&lt;br /&gt; *&lt;br /&gt; */&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;import java.awt.Rectangle;&lt;br /&gt;import java.awt.Graphics;&lt;br /&gt;import java.awt.Image;&lt;br /&gt;import java.awt.MediaTracker;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;import java.awt.Cursor;&lt;br /&gt;&lt;br /&gt;public class DisplayManager extends java.lang.Object&lt;br /&gt;{&lt;br /&gt;    private Image    background;&lt;br /&gt;    private Image     offScreenBuffer;&lt;br /&gt;    private DirtyRectSet    dirtyRects = new DirtyRectSet();&lt;br /&gt;          &lt;br /&gt;    /**&lt;br /&gt;    *  A reference back to the Bridge this manager is servicing.&lt;br /&gt;    */&lt;br /&gt;    protected Bridge owner;&lt;br /&gt;&lt;br /&gt;    public DisplayManager(Bridge theOwner) &lt;br /&gt;    {&lt;br /&gt;        owner= theOwner;&lt;br /&gt;    } &lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;    * Set the background image to the specified image.&lt;br /&gt;    */&lt;br /&gt;    public void setBackground (Image theImage)&lt;br /&gt;    {&lt;br /&gt;        background= theImage;&lt;br /&gt;        int width = background.getWidth(owner);&lt;br /&gt;        int height = background.getHeight(owner);&lt;br /&gt;        offScreenBuffer= owner.createImage(width, height);&lt;br /&gt;        offScreenBuffer.getGraphics().drawImage (theImage, 0, 0, owner);&lt;br /&gt;&lt;br /&gt;        dirtyRects.addRect (new Rectangle (0, 0, width,height));&lt;br /&gt;              &lt;br /&gt;    }/*setBackground*/&lt;br /&gt;&lt;br /&gt;    public void refresh(Graphics g)&lt;br /&gt;    {&lt;br /&gt;                //gil temp&lt;br /&gt;        Rectangle r = new Rectangle(0,0,640,480);&lt;br /&gt;        dirtyRects.addRect(r);&lt;br /&gt;        paint(g);&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;      &lt;br /&gt;    /**&lt;br /&gt;    * Display changed portions of screen.&lt;br /&gt;    */&lt;br /&gt;    public void paint(Graphics g)&lt;br /&gt;    {&lt;br /&gt;        DirtyRectSet flushRects;&lt;br /&gt;        Graphics osb;&lt;br /&gt;        &lt;br /&gt;        if( offScreenBuffer == null )&lt;br /&gt;            osb = null;&lt;br /&gt;        else&lt;br /&gt;            osb = offScreenBuffer.getGraphics ();&lt;br /&gt;              &lt;br /&gt;        //&lt;br /&gt;        // clear background behind actors...&lt;br /&gt;        //&lt;br /&gt;        dirtyRects.drawImage (osb, background, owner);&lt;br /&gt;&lt;br /&gt;        flushRects= dirtyRects;&lt;br /&gt;        dirtyRects= new DirtyRectSet();&lt;br /&gt;&lt;br /&gt;        //&lt;br /&gt;        // draw Sprites&lt;br /&gt;        //&lt;br /&gt;        Vector slist = owner.bridgedata.getCurrentSprites();&lt;br /&gt;        for (int ii = 0; ii&lt; slist.size(); ii++) &lt;br /&gt;        {&lt;br /&gt;            Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;            // Zilch sprites do not get drawn&lt;br /&gt;            if (sprite.getClass() == Zilch.class) continue;&lt;br /&gt;            Rectangle r = new Rectangle(sprite.getExtent());&lt;br /&gt;            dirtyRects.addRect (r);&lt;br /&gt;            flushRects.addRect (r);&lt;br /&gt;            Graphics g2= osb.create (r.x, r.y, r.width, r.height);&lt;br /&gt;            Image imageii = sprite.getCurrentImage();&lt;br /&gt;            g2.drawImage(imageii, 0, 0, owner);&lt;br /&gt;            g2.dispose();&lt;br /&gt;        }&lt;br /&gt;        flushRects.drawImage (g, offScreenBuffer, owner);&lt;br /&gt;      &lt;br /&gt;    } /*paint*/&lt;br /&gt;&lt;br /&gt;} /*DisplayManager*/&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-7292165440607104109?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/7292165440607104109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=7292165440607104109' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7292165440607104109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7292165440607104109'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/01/display-manager.html' title='The Display Manager'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-7366316331357050475</id><published>2009-01-12T16:20:00.004Z</published><updated>2009-01-13T11:27:10.309Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>DirtyRectSet - Dirty Rectangle Set class</title><content type='html'>DirtyRectSet is the class that collects all the bits of the image that&lt;br /&gt;have been changed and therefore need replacement. It saves processing&lt;br /&gt;time on image update.&lt;br /&gt;&lt;br /&gt;Rectangles are added in ascending sequence of x coordinate, and there is&lt;br /&gt;a collapse() method that enables rectangles which are rather close to&lt;br /&gt;each other to be amalgamated. "Close enough" is defined by GLUE - i.e&lt;br /&gt;within GLUE pixels, the rectangles overlap.&lt;br /&gt;&lt;br /&gt;The drawImage method is immensely subtle - so subtle that it always&lt;br /&gt;takes me some time to figure out exactly what it's doing. Importantly,&lt;br /&gt;though, it seems to work.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt; &lt;br /&gt;/** * * DirtyRectSet.java * Mark Tacchi Mar 15/1996 &lt;br /&gt;* * * Slightly modified by Gil Williamson 2003 */&lt;br /&gt;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;import java.awt.Rectangle;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class DirtyRectSet extends java.lang.Object &lt;br /&gt;{&lt;br /&gt;   private Vector rects;&lt;br /&gt;   public DirtyRectSet() &lt;br /&gt;   { &lt;br /&gt;       rects = new Vector();&lt;br /&gt;   }&lt;br /&gt;   public void addRect (Rectangle r)&lt;br /&gt;   {&lt;br /&gt;          int size = rects.size ();&lt;br /&gt;        for (int index = 0; index &lt; size; index++)&lt;br /&gt;        {&lt;br /&gt;            Rectangle curr = (Rectangle)rects.elementAt (index);&lt;br /&gt;&lt;br /&gt;            if (r.x &gt; curr.x)&lt;br /&gt;            {&lt;br /&gt;                rects.insertElementAt (r, index);&lt;br /&gt;                return;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        rects.addElement (r);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   final int GLUE = 64;&lt;br /&gt;&lt;br /&gt;   final private boolean closeEnough (Rectangle r1, Rectangle r2)&lt;br /&gt;   {&lt;br /&gt;         boolean result;&lt;br /&gt;      r1.width += GLUE;&lt;br /&gt;      r1.height += GLUE;&lt;br /&gt;      r2.width += GLUE;&lt;br /&gt;      r2.height += GLUE;&lt;br /&gt;      result = r1.intersects (r2);&lt;br /&gt;      r1.width -= GLUE;&lt;br /&gt;      r1.height -= GLUE;&lt;br /&gt;      r2.width -= GLUE;&lt;br /&gt;      r2.height -= GLUE;&lt;br /&gt;      return result;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public int getSize()&lt;br /&gt;   {&lt;br /&gt;       return(rects.size());&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   public Rectangle getRect(int index)&lt;br /&gt;   {&lt;br /&gt;       return ((Rectangle)rects.elementAt(index));&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   public void empty()&lt;br /&gt;   {&lt;br /&gt;       if (rects.size()&gt;0)&lt;br /&gt;       {&lt;br /&gt;           rects.removeAllElements();&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;   &lt;br /&gt;   public void collapse ()&lt;br /&gt;   {&lt;br /&gt;        int index = 0;&lt;br /&gt;        if (rects.size () &lt; 2)&lt;br /&gt;            return;&lt;br /&gt;        Rectangle r1 = (Rectangle)rects.elementAt (index);&lt;br /&gt;        Rectangle r2 = (Rectangle)rects.elementAt (index+1);&lt;br /&gt;        while (true)&lt;br /&gt;        {&lt;br /&gt;            // collapse R1 and R2&lt;br /&gt;            if (closeEnough (r1, r2))&lt;br /&gt;            {&lt;br /&gt;                r1 = r1.union (r2);&lt;br /&gt;                rects.setElementAt (r1, index);&lt;br /&gt;                rects.removeElementAt (index+1);&lt;br /&gt;                if (index+1 &lt; rects.size ())&lt;br /&gt;                    r2 = (Rectangle)rects.elementAt(index+1);&lt;br /&gt;                else&lt;br /&gt;                    return;&lt;br /&gt;            }&lt;br /&gt;            // go to next pair&lt;br /&gt;            else if (index+2 &lt; rects.size ())&lt;br /&gt;            {&lt;br /&gt;                r1 = r2;&lt;br /&gt;                r2 = (Rectangle)rects.elementAt (index+2);&lt;br /&gt;                index += 1;&lt;br /&gt;            }&lt;br /&gt;&lt;br /&gt;            // done&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                return;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   public void drawImage (java.awt.Graphics g, java.awt.Image img,&lt;br /&gt;                    Bridge owner)&lt;br /&gt;    {&lt;br /&gt;        collapse ();&lt;br /&gt;&lt;br /&gt;        for (int i= 0; i&lt; rects.size (); i++) {&lt;br /&gt;            Rectangle r = (Rectangle)rects.elementAt(i);&lt;br /&gt;              java.awt.Graphics g2 = g.create (r.x, r.y, r.width,&lt;br /&gt;              r.height);&lt;br /&gt;              g2.drawImage(img, -r.x, -r.y, owner);&lt;br /&gt;              g2.dispose ();&lt;br /&gt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-7366316331357050475?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/7366316331357050475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=7366316331357050475' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7366316331357050475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7366316331357050475'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/01/dirty.html' title='DirtyRectSet - Dirty Rectangle Set class'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-221841022922523031</id><published>2009-01-10T00:22:00.001Z</published><updated>2009-01-13T11:27:36.363Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>The BridgeData class</title><content type='html'>The BridgeData class varies from game to game. The first part defines all the scenes, zones and sprites. The second part has a number of service routines that deliver the information to calling methods.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;There are a couple of method names that I would change for the sake of clarity, specifically:&lt;br /&gt;setCurrentScene() and getCurrentScene(), which really should be called: setCurrentSceneName() and getCurrentSceneName().&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// This is the class that defines all the scenes, zones and sprites&lt;br /&gt;import java.util.Vector;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.applet.AudioClip;&lt;br /&gt;import java.net.URL;&lt;br /&gt;&lt;br /&gt;public class BridgeData extends Object&lt;br /&gt;{&lt;br /&gt;    private Vector scenes;&lt;br /&gt;    private Vector sprites;&lt;br /&gt;    private Scene scene;&lt;br /&gt;    private String currscene;&lt;br /&gt;    public String startup = "waitintro";&lt;br /&gt;    protected Bridge owner;&lt;br /&gt;    public BridgeData(Bridge theOwner)&lt;br /&gt;    {&lt;br /&gt;        owner = theOwner;&lt;br /&gt;        scenes = new Vector();&lt;br /&gt;        sprites = new Vector();&lt;br /&gt;        // Put scenes in here&lt;br /&gt;        //inventory&lt;br /&gt;        scene = new Scene ("inventory", "inventory.gif");&lt;br /&gt;        scene.addZone(20, 20, 80, 80, "", Cursor.CROSSHAIR_CURSOR);&lt;br /&gt;        scenes.addElement(scene);&lt;br /&gt;        //waitintro&lt;br /&gt;        scene = new Scene ("waitintro", "instr.gif");&lt;br /&gt;        scene.addZone(238, 176, 164, 124, "intro", Cursor.CROSSHAIR_CURSOR);&lt;br /&gt;        scenes.addElement(scene);&lt;br /&gt;        //wait&lt;br /&gt;        scene = new Scene ("wait", "hourglass.jpg");&lt;br /&gt;        scenes.addElement(scene);&lt;br /&gt;        //intro&lt;br /&gt;        scene = new Scene ("intro", "china.jpg", "c12");&lt;br /&gt;        scene.addZone(100, 310, 70, 60, "dock", Cursor.CROSSHAIR_CURSOR);&lt;br /&gt;        scenes.addElement(scene);&lt;br /&gt;        //dock&lt;br /&gt;        scene = new Scene ("dock", "dock.jpg", "ara");&lt;br /&gt;        scene.addZone(200, 210, 100, 70, "doornbox", Cursor.CROSSHAIR_CURSOR);&lt;br /&gt;        scene.addZone(0, 0, 640, 60, "dockup", Cursor.S_RESIZE_CURSOR);&lt;br /&gt;        scene.addZone(0, 0, 60, 480, "dockback", Cursor.E_RESIZE_CURSOR);&lt;br /&gt;        scene.addZone(580, 0, 60, 480, "dockback", Cursor.E_RESIZE_CURSOR);&lt;br /&gt;        scenes.addElement(scene);&lt;br /&gt;        //dockback&lt;br /&gt;        scene = new Scene ("dockback", "dockback.jpg", "ara");&lt;br /&gt;        scene.addZone(0, 0, 60, 480, "dock", Cursor.E_RESIZE_CURSOR);&lt;br /&gt;        scene.addZone(580, 0, 60, 480, "dock", Cursor.E_RESIZE_CURSOR);&lt;br /&gt;        scene.addZone(200, 210, 100, 70, "intro", Cursor.CROSSHAIR_CURSOR);&lt;br /&gt;        scenes.addElement(scene);&lt;br /&gt;        //dockup&lt;br /&gt;        scene = new Scene ("dockup", "dockup.jpg", "ara");&lt;br /&gt;        scene.addZone(0, 430, 640, 50, "dock", Cursor.S_RESIZE_CURSOR);&lt;br /&gt;        scenes.addElement(scene);&lt;br /&gt;        //doornbox&lt;br /&gt;        scene = new Scene ("doornbox", "doornbox.jpg");&lt;br /&gt;        scene.addZone(0, 430, 640, 50, "dock", Cursor.S_RESIZE_CURSOR);&lt;br /&gt;        scenes.addElement(scene);&lt;br /&gt;        //Put sprites in here&lt;br /&gt;        RippleA ripplea = new RippleA("ripplea", "intro");&lt;br /&gt;        sprites.addElement(ripplea);&lt;br /&gt;        GullA gulla = new GullA("gulla", "intro", 480, 40, 0);&lt;br /&gt;        sprites.addElement(gulla);&lt;br /&gt;        GullA gullb = new GullA("gullb", "intro", 370, 200, 78);&lt;br /&gt;        sprites.addElement(gullb);&lt;br /&gt;        GullA gullc = new GullA("gullc", "dockback", 80, 50, 12);&lt;br /&gt;        sprites.addElement(gullc);&lt;br /&gt;        GullA gulld = new GullA("gulld", "dockback", 150, 200, 78);&lt;br /&gt;        sprites.addElement(gulld);&lt;br /&gt;        // Put carryables here&lt;br /&gt;        GoldKey goldkey = new GoldKey("goldkey", "dock");&lt;br /&gt;        sprites.addElement(goldkey);&lt;br /&gt;        Zilch dockkeyhole = new Zilch("dockkeyhole", "doornbox");&lt;br /&gt;        dockkeyhole.setPosition(200, 240);&lt;br /&gt;        URL addr = owner.getCurrentUrl("sounds/rooster.au");&lt;br /&gt;        dockkeyhole.addAudio(0, owner.getAudioClip(addr));&lt;br /&gt;        sprites.addElement(dockkeyhole);&lt;br /&gt;    }&lt;br /&gt;    public boolean collide(String spritename, String hitter)&lt;br /&gt;    {&lt;br /&gt;        if (hitter == null)&lt;br /&gt;        {&lt;br /&gt;            return true;&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            if (spritename.equals("dockkeyhole") &amp;&amp; (hitter.equals("goldkey")))&lt;br /&gt;            {&lt;br /&gt;                Sprite found = getSpriteByName(spritename);&lt;br /&gt;                if (found != null)&lt;br /&gt;                {&lt;br /&gt;                    AudioClip auclip = found.getAudio(0);&lt;br /&gt;                    auclip.play();&lt;br /&gt;                    return true;    &lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;            &lt;br /&gt;    // Above here are game-specific functions&lt;br /&gt;    // Below here are general purpose functions&lt;br /&gt;    public Scene fetchScene(String a)&lt;br /&gt;    {&lt;br /&gt;        int ii;&lt;br /&gt;        if (scenes == null)&lt;br /&gt;        {&lt;br /&gt;            return null;&lt;br /&gt;        }&lt;br /&gt;        for(ii = 0; ii &lt; scenes.size(); ii++)&lt;br /&gt;        {&lt;br /&gt;            scene = (Scene)scenes.elementAt(ii);&lt;br /&gt;            if (a.equals(scene.name))&lt;br /&gt;            {&lt;br /&gt;                return scene;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return null;&lt;br /&gt;    }&lt;br /&gt;    public Scene fetchCurrentScene()&lt;br /&gt;    {&lt;br /&gt;        return (fetchScene(currscene));&lt;br /&gt;    }&lt;br /&gt;    public void setCurrentScene(String name)&lt;br /&gt;    {&lt;br /&gt;        currscene = new String(name);&lt;br /&gt;    }&lt;br /&gt;    public String getCurrentScene()&lt;br /&gt;    {&lt;br /&gt;        return(currscene);&lt;br /&gt;    }&lt;br /&gt;    public Vector getSceneSprites(String sceneName)&lt;br /&gt;    {&lt;br /&gt;        Vector local = new Vector();&lt;br /&gt;        Sprite temp = null;&lt;br /&gt;        for (int ii = 0; ii &lt; sprites.size(); ii++)&lt;br /&gt;        {&lt;br /&gt;            temp = (Sprite)sprites.elementAt(ii);&lt;br /&gt;            if (temp.scenename.equals(sceneName))&lt;br /&gt;            {&lt;br /&gt;                local.addElement(temp);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return local;&lt;br /&gt;    }&lt;br /&gt;    public Vector getCurrentSprites()&lt;br /&gt;    {&lt;br /&gt;        return getSceneSprites(currscene);&lt;br /&gt;    }&lt;br /&gt;    public Vector getAllSprites()&lt;br /&gt;    {&lt;br /&gt;        return sprites;&lt;br /&gt;    }&lt;br /&gt;    public Sprite getSpriteByName(String name)&lt;br /&gt;    {&lt;br /&gt;        Sprite temp;&lt;br /&gt;        for (int ii = 0; ii &lt; sprites.size(); ii++)&lt;br /&gt;        {&lt;br /&gt;            temp = (Sprite)sprites.elementAt(ii);&lt;br /&gt;            if (temp.getName().equals(name))&lt;br /&gt;            {&lt;br /&gt;                return(temp);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return null;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-221841022922523031?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/221841022922523031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=221841022922523031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/221841022922523031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/221841022922523031'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/01/bridgedata-class.html' title='The BridgeData class'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-5771316889381715060</id><published>2009-01-08T10:01:00.003Z</published><updated>2009-01-13T11:27:50.284Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>The Scene and Zone classes</title><content type='html'>The Scene and Zone classes. The comments say it all. The Scene is the equivalent of the "Room" in adventure-speak.&lt;br /&gt;&lt;span style="font-style:italic;"&gt;I can see a future need for a method that changes the destination of a zone. It would be of the form - change the destination of the nth zone in the scene which points to scene A to scene B (the normal value of n would be zero - i.e. the only zone).&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// Scene class - this is the background to a scene and includes:&lt;br /&gt;// the Zone class - a Zone is a rectangular area within a scene, &lt;br /&gt;// usually for the purpose of enabling the player to click at&lt;br /&gt;// a portion of the scene in order to move to another scene.&lt;br /&gt;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;import java.awt.*;&lt;br /&gt;public class Scene extends Object&lt;br /&gt;{&lt;br /&gt;    public String name;       // Text name of scene        &lt;br /&gt;    public String imagename;  // image file name for scene&lt;br /&gt;    public String songname;   // text song name&lt;br /&gt;    private Vector zones;     // list of zones within the scene&lt;br /&gt;    &lt;br /&gt;    // Zone Class&lt;br /&gt;    public class Zone extends Object&lt;br /&gt;    {&lt;br /&gt;        public Rectangle rect;       // extent of zone&lt;br /&gt;        public String destination;   // text name of destination scene&lt;br /&gt;        public int cursor;           // cursor to display while in zone&lt;br /&gt;        public boolean cursoron;     // whether cursor displays&lt;br /&gt;        public Zone(Rectangle r, String d)&lt;br /&gt;        {&lt;br /&gt;            rect = new Rectangle(r);&lt;br /&gt;            destination = new String(d);&lt;br /&gt;            cursoron = false;&lt;br /&gt;        }&lt;br /&gt;        public Zone(int x, int y, int w, int h, String d, int Cursor)&lt;br /&gt;        {&lt;br /&gt;            rect = new Rectangle(x, y, w, h);&lt;br /&gt;            destination = new String(d);&lt;br /&gt;            cursor = Cursor;&lt;br /&gt;            cursoron = true;&lt;br /&gt;        }&lt;br /&gt;        public boolean inZone(int x, int y)&lt;br /&gt;        {&lt;br /&gt;            if (rect.contains(x, y))&lt;br /&gt;                return true;&lt;br /&gt;            return false;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    public Scene(String n, String in)&lt;br /&gt;    {&lt;br /&gt;        name = new String(n);&lt;br /&gt;        imagename = new String(in);&lt;br /&gt;        zones = new Vector();&lt;br /&gt;        songname = new String("");&lt;br /&gt;    }&lt;br /&gt;    public Scene(String n, String in, String song)&lt;br /&gt;    {&lt;br /&gt;        name = new String(n);&lt;br /&gt;        imagename = new String(in);&lt;br /&gt;        zones = new Vector();&lt;br /&gt;        songname = new String(song);&lt;br /&gt;    }&lt;br /&gt;    public void addZone(int x, int y, int w, int h, String d, int e)&lt;br /&gt;    {&lt;br /&gt;        Zone z = new Zone(x, y, w, h, d, e);&lt;br /&gt;        zones.addElement(z);&lt;br /&gt;    }&lt;br /&gt;    public String getDest(int x, int y)&lt;br /&gt;    {&lt;br /&gt;        int ii;&lt;br /&gt;        Zone tz;&lt;br /&gt;        if (zones == null) &lt;br /&gt;            return null;&lt;br /&gt;        for (ii = 0; ii &lt; zones.size(); ii++)&lt;br /&gt;        {&lt;br /&gt;            tz = (Zone)zones.elementAt(ii);&lt;br /&gt;            if (tz.inZone(x, y))&lt;br /&gt;                return tz.destination;&lt;br /&gt;        }&lt;br /&gt;        return null;&lt;br /&gt;    }&lt;br /&gt;    public int getZoneCursor(int x, int y)&lt;br /&gt;    {&lt;br /&gt;        int ii;&lt;br /&gt;        Zone tz;&lt;br /&gt;        if (zones == null) &lt;br /&gt;            return -1;&lt;br /&gt;        for (ii = 0; ii &lt; zones.size(); ii++)&lt;br /&gt;        {&lt;br /&gt;            tz = (Zone)zones.elementAt(ii);&lt;br /&gt;            if (tz.inZone(x, y) &amp;&amp; tz.cursoron)&lt;br /&gt;                return tz.cursor;&lt;br /&gt;        }&lt;br /&gt;        return -1;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-5771316889381715060?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/5771316889381715060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=5771316889381715060' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/5771316889381715060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/5771316889381715060'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/01/scene-and-zone-classes.html' title='The Scene and Zone classes'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-115779908013920575</id><published>2008-12-31T22:56:00.001Z</published><updated>2009-01-13T11:28:08.545Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>RippleA - rippling water sprite</title><content type='html'>Here is RippleA, intended to simulate rippling water. It can be seen on the first page of the sample code.&lt;br /&gt;&lt;br /&gt;It uses the Sprite.increment() method to change the image at any given time.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;It isn't very realistic - perhaps a slower  (setCommonTime())&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class RippleA extends Sprite&lt;br /&gt;{&lt;br /&gt;    public RippleA(String spriteName, String Scenename)&lt;br /&gt;    {&lt;br /&gt;        super(spriteName, Scenename, "ripplea.jpg", MULTIPLE, &lt;br /&gt;           4, UNMOVING, NOACTION);&lt;br /&gt;        setCommonTime(1);&lt;br /&gt;        setPosition(0, 360);&lt;br /&gt;        setSize(640, 120);&lt;br /&gt;    }&lt;br /&gt;    public void tick(long ticks, int mousex, int mousey)&lt;br /&gt;    {&lt;br /&gt;        super.increment(ticks);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-115779908013920575?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/115779908013920575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=115779908013920575' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/115779908013920575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/115779908013920575'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/ripplea-rippling-water-sprite.html' title='RippleA - rippling water sprite'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2396040453332579289</id><published>2008-12-30T08:32:00.001Z</published><updated>2009-01-13T11:28:32.118Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>The Zilch sprite</title><content type='html'>Zilch is a sprite which is invisible and only serves to detect hits in the part of a scene in which it has been placed. There is an example of this in the original game where the keyhole of the door is covered by a Zilch to enable the audio clip when the gold key hits the keyhole.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class Zilch extends Sprite&lt;br /&gt;{&lt;br /&gt;    public Zilch(String spriteName, String Scenename)&lt;br /&gt;    {&lt;br /&gt;        super(spriteName, Scenename, "zilch.gif", SINGLE, &lt;br /&gt;            1, UNMOVING, NOACTION);&lt;br /&gt;        setSize(50,50);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2396040453332579289?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2396040453332579289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2396040453332579289' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2396040453332579289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2396040453332579289'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/zilch-sprite.html' title='The Zilch sprite'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-70979685125017322</id><published>2008-12-30T01:10:00.004Z</published><updated>2009-01-13T11:29:05.756Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>The Gull sprite</title><content type='html'>&lt;a href="http://www.amazonsystems.co.uk/images/gullanim.gif"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 28px; height: 27px;" src="http://www.amazonsystems.co.uk/images/gullanim.gif" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;Another sprite, the gull, which is treated differently from a gettable sprite like the key. It moves in a sort of spiral, using its "phase" to decide where it is on its circle, and in choosing a suitable frame. The phase has 96 possible values and deflect is used to determine the x position with respect to start. Meanwhile, the y position just goes up and down in a vertical range. If you look at the sample game, you will see how they smoothly pass over the scenery and even over each other.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;There is a certain jerkiness in the animation of the Gull at certain phases - it is not refected in the smooth animation of the animated gif (see right). I think it probably has to do with the calculation of position versus phase and may be improved with a different set of deflections. It is a subject worth revisiting.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Several GullA sprites can coexist; they simply require different start posiitions and phases.&lt;br /&gt;&lt;br /&gt;They don't require save and restore code, because they are restored as part of scenery restoration.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.awt.Cursor;&lt;br /&gt;import java.awt.Rectangle;&lt;br /&gt;public class GullA extends Sprite&lt;br /&gt;{&lt;br /&gt;    int [] deflect = {70, 70, 69, 68, 67, 66, 64, 62, 59,&lt;br /&gt;        57, 54, 50, 47, 43, 39, 35, 31, 27, 23, 19, 15, 10, 5, 0};&lt;br /&gt;    boolean up;&lt;br /&gt;    private int startx, starty, phase;&lt;br /&gt;    private final int MAXPHASE = 96;&lt;br /&gt;    public GullA(String spriteName, String Scenename, int StartX, int StartY, int Phase)&lt;br /&gt;    {&lt;br /&gt;        super(spriteName, Scenename, "gull.gif", MULTIPLE, &lt;br /&gt;            24, UNMOVING, NOACTION);&lt;br /&gt;        startx = StartX;&lt;br /&gt;        starty = StartY;&lt;br /&gt;        phase = Phase;&lt;br /&gt;        setPosition(startx+640, starty);&lt;br /&gt;        setSize(28, 27);&lt;br /&gt;        up = false;&lt;br /&gt;    }&lt;br /&gt;    public void tick(long ticks, int mousex, int mousey)&lt;br /&gt;    {&lt;br /&gt;        int coeff = 0;&lt;br /&gt;        increment(ticks);&lt;br /&gt;        phase += 1;&lt;br /&gt;        if (phase &gt;= MAXPHASE) phase = 0;&lt;br /&gt;        setFrame(phase/4);&lt;br /&gt;        Rectangle r = getExtent();&lt;br /&gt;        if (phase &lt; 24) coeff = deflect[phase];&lt;br /&gt;        if ((phase &gt; 23) &amp;&amp; (phase &lt; 48))&lt;br /&gt;        {&lt;br /&gt;            coeff = -deflect[47-phase];&lt;br /&gt;        }&lt;br /&gt;        if ((phase &gt; 47) &amp;&amp; (phase &lt; 72))&lt;br /&gt;        {&lt;br /&gt;            coeff = -deflect[phase - 48];&lt;br /&gt;        }&lt;br /&gt;        if ((phase &gt; 71) &amp;&amp; (phase &lt; 96))&lt;br /&gt;        {&lt;br /&gt;            coeff = deflect[95-phase];&lt;br /&gt;        }&lt;br /&gt;        r.x = startx + coeff;&lt;br /&gt;        if (r.y &lt; 28) up = false;&lt;br /&gt;        if (r.y &gt; 250) up = true;&lt;br /&gt;        if (up)&lt;br /&gt;            r.y -= 1;&lt;br /&gt;        else &lt;br /&gt;            r.y += 1;&lt;br /&gt;        setPosition(r.x, r.y);&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-70979685125017322?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/70979685125017322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=70979685125017322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/70979685125017322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/70979685125017322'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2009/01/gull-sprite_06.html' title='The Gull sprite'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-200100446659374363</id><published>2008-12-30T00:32:00.002Z</published><updated>2009-01-13T11:29:49.238Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>The Gold Key sprite</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_g4a_aq3nffY/SWOvqK6YIlI/AAAAAAAAABM/CR0Rov0rMi8/s1600-h/goldk000.gif"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 40px; height: 20px;" src="http://2.bp.blogspot.com/_g4a_aq3nffY/SWOvqK6YIlI/AAAAAAAAABM/CR0Rov0rMi8/s400/goldk000.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5288263526481666642" /&gt;&lt;/a&gt;&lt;br /&gt;This is an example of a gettable sprite. All it really has is its initialisation, most of which it inherits from the Sprite class, and the save and restore code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;I can't help feeling that a lot of the save and restore stuff could be in the parent class too for movable / gettable sprites.&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;import java.awt.Point;&lt;br /&gt;public class GoldKey extends Sprite&lt;br /&gt;{&lt;br /&gt;    public GoldKey(String spriteName, String Scenename)&lt;br /&gt;    {&lt;br /&gt;        super(spriteName, Scenename, "goldk.gif", MULTIPLE, &lt;br /&gt;            2, GETTABLE, NOACTION);&lt;br /&gt;        setPosition(100, 400);&lt;br /&gt;        setSize(40, 20);&lt;br /&gt;        addValidDrop("inventory", -1, -1);&lt;br /&gt;        addValidDrop("dock", 100, 400);&lt;br /&gt;    }&lt;br /&gt;    public String saveMe()&lt;br /&gt;    {&lt;br /&gt;        String mysave = getSavePrefix();&lt;br /&gt;        mysave = mysave.concat("[" + scenename + "]");&lt;br /&gt;        mysave = mysave.concat(posSave());&lt;br /&gt;        mysave = mysave.concat(gotSave());&lt;br /&gt;        mysave = mysave.concat("&gt;");&lt;br /&gt;        return mysave;&lt;br /&gt;    }&lt;br /&gt;    public boolean restoreMe(String restoreString)&lt;br /&gt;    {&lt;br /&gt;        String search = getRestoreContent(restoreString);&lt;br /&gt;        int start = search.indexOf("[");&lt;br /&gt;        if (start != -1)&lt;br /&gt;        {&lt;br /&gt;            start +=1;&lt;br /&gt;            int end = search.indexOf("]", start);&lt;br /&gt;            if (end != -1)&lt;br /&gt;            {&lt;br /&gt;                scenename = search.substring(start, end);&lt;br /&gt;                start = search.indexOf("[X", end);&lt;br /&gt;                end = search.indexOf("]", start);&lt;br /&gt;                Point p = posRestore(search.substring(start, end+1));&lt;br /&gt;                setPosition(p.x, p.y);&lt;br /&gt;                if (search.indexOf("[NOTGOT]") != -1)&lt;br /&gt;                {&lt;br /&gt;                    if (dropSprite(scenename))&lt;br /&gt;                    {&lt;br /&gt;                        return true;&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;                else if (search.indexOf("[GOT]") != -1)&lt;br /&gt;                {&lt;br /&gt;                    getSprite();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    return false;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-200100446659374363?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/200100446659374363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=200100446659374363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/200100446659374363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/200100446659374363'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/gold-key-sprite.html' title='The Gold Key sprite'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_g4a_aq3nffY/SWOvqK6YIlI/AAAAAAAAABM/CR0Rov0rMi8/s72-c/goldk000.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-8941365930230406460</id><published>2008-12-28T22:26:00.001Z</published><updated>2009-01-13T11:30:28.046Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>The Sprite Class</title><content type='html'>Creatively speaking, the sprites (a term stolen from early video games) constitute the interest in the game, against which the backgrounds can be viewed as mere scenery. So I have defined a class, called (unsurprisingly) Sprite, from which all sprites descend. A sprite is an item that is superimposed on the background of a scene. It may be able to be carried  by the player, it may move on its own account, like the birds in the example game. It may be a piece of the scenery that can be manipulated by the player. It may be invisible, and have no image, but only an extent. Contact between player cursor and sprite and between sprite and sprite can be detected. A sprite can even be invisible (strictly, transparent). Each sprite is associated with one or more image files to give it one or more representations and/or animations. The parent Sprite class includes a number of variables common to all sprites and a number of default methods that can be overridden in Sprite's descendant classes.&lt;br /&gt;Here is the basic sprite class.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.applet.*;&lt;br /&gt;&lt;br /&gt;public class Sprite extends Object&lt;br /&gt;{&lt;br /&gt;    // Statics&lt;br /&gt;    public static final int UNMOVING = 0; // Never relocates&lt;br /&gt;    public static final int MOVING = 1; // Can relocate (move() function)&lt;br /&gt;    public static final int GETTABLE = 2; // Can be picked up &lt;br /&gt;    public static final int NOACTION = 0; // Unresponsive to mouse&lt;br /&gt;    public static final int ACTIVE = 1; // Responsive to mouse (act() function)&lt;br /&gt;    public static final int SINGLE = 0; // Single image file (furniture)&lt;br /&gt;    public static final int MULTIPLE = 1; // Multiple numbered files&lt;br /&gt;    public static final int AGIF = 2; // Animated Gif &lt;br /&gt;    public static final int NOANIM = -1; // No Animation&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    // Static-ish - set up at Constructor &lt;br /&gt;    private String spritename;&lt;br /&gt;    private String basefile;&lt;br /&gt;    private String suffix;&lt;br /&gt;    private String currimage;&lt;br /&gt;    private int filetype;&lt;br /&gt;    private int noframes;&lt;br /&gt;    private int movetype;&lt;br /&gt;    private int actiontype;&lt;br /&gt;    // Parametrable-Static defaulted at Constructor but alterable&lt;br /&gt;    private int scale;&lt;br /&gt;    private int priority;&lt;br /&gt;    private int frametimes[];&lt;br /&gt;    private boolean got;&lt;br /&gt;    private Vector images;&lt;br /&gt;    private Vector audioclips;&lt;br /&gt;    // For gettable sprites&lt;br /&gt;    public Vector validscenes;&lt;br /&gt;    public Vector positions;&lt;br /&gt;&lt;br /&gt;    // Immediate&lt;br /&gt;    public String scenename;&lt;br /&gt;    public int cursor;&lt;br /&gt;    public boolean cursoron; &lt;br /&gt;    private int frame;&lt;br /&gt;    private long prevtick;&lt;br /&gt;    private Rectangle extent;&lt;br /&gt; &lt;br /&gt;    // Maximum constructor for a Sprite&lt;br /&gt;    public Sprite(String spriteName, String sceneName, String fileName, int fileType, &lt;br /&gt;        int noOfFrames, int moveType, int actionType)&lt;br /&gt;    {&lt;br /&gt;        // text name of sprite &lt;br /&gt;        spritename = new String(spriteName);&lt;br /&gt;        // text name of 'home' scene&lt;br /&gt;        scenename = new String(sceneName);&lt;br /&gt;        // text name of image file(s)&lt;br /&gt;        basefile = new String(fileName);&lt;br /&gt;        int c = basefile.indexOf('.');&lt;br /&gt;        suffix = new String(basefile.substring(c));&lt;br /&gt;        basefile = new String(basefile.substring(0, c));&lt;br /&gt;        // file type single, multiple or animated gif&lt;br /&gt;        // (animated gif not yet implemented)&lt;br /&gt;        filetype = fileType;&lt;br /&gt;        // number of image frames in the sprite set&lt;br /&gt;        noframes = noOfFrames;&lt;br /&gt;        // movement type (can it relocate?)&lt;br /&gt;        movetype = moveType;&lt;br /&gt;        // action type (whether responsive to mouse)&lt;br /&gt;        actiontype = actionType;&lt;br /&gt;        // the images can be scaled for perpective etc.&lt;br /&gt;        scale = 100;&lt;br /&gt;        // priority determines which sprite is drawn first&lt;br /&gt;        priority = 1;&lt;br /&gt;        // enables variable speed animation &lt;br /&gt;        frametimes = new int[noOfFrames];&lt;br /&gt;        // set all the frame times to 'no animation'&lt;br /&gt;        setCommonTime(NOANIM);&lt;br /&gt;        // x pos, y pos, width, height&lt;br /&gt;        extent = new Rectangle(0, 0, 0, 0);&lt;br /&gt;        // for special cursor &lt;br /&gt;        cursoron = false;&lt;br /&gt;        // whether being carried &lt;br /&gt;        got = false;&lt;br /&gt;        // for Gettable sprites&lt;br /&gt;        validscenes = new Vector();&lt;br /&gt;        positions = new Vector();&lt;br /&gt;        // ?caches for images and audio clips &lt;br /&gt;        images = new Vector();&lt;br /&gt;        audioclips = new Vector();&lt;br /&gt;        // specify which sprite image to use&lt;br /&gt;        setFrame(0);&lt;br /&gt;        addCursor(Cursor.DEFAULT_CURSOR);&lt;br /&gt;    }&lt;br /&gt;    public void addAudio(int serial, AudioClip au)&lt;br /&gt;    {&lt;br /&gt;        audioclips.insertElementAt(au, serial);&lt;br /&gt;    }&lt;br /&gt;    public AudioClip getAudio(int serial)&lt;br /&gt;    {&lt;br /&gt;        AudioClip au = (AudioClip)audioclips.elementAt(serial);&lt;br /&gt;        return au;&lt;br /&gt;    }&lt;br /&gt;    public void addImage(int serial, Image im)&lt;br /&gt;    {&lt;br /&gt;        images.insertElementAt(im, serial);&lt;br /&gt;    }&lt;br /&gt;    public Image getImage(int serial)&lt;br /&gt;    {&lt;br /&gt;        Image im = (Image)images.elementAt(serial);&lt;br /&gt;        return im;&lt;br /&gt;    }&lt;br /&gt;    public Image getCurrentImage()&lt;br /&gt;    {&lt;br /&gt;        Image im = getImage(frame);&lt;br /&gt;        return im;&lt;br /&gt;    }&lt;br /&gt;    public void relocate(String sceneName)&lt;br /&gt;    {&lt;br /&gt;        scenename = sceneName;&lt;br /&gt;    }&lt;br /&gt;    // USUALLY OVERRIDDEN EXCEPT FOR NON-ANIMATED GETTABLE ITEMS&lt;br /&gt;    public void tick(long ticks, int mousex, int mousey)&lt;br /&gt;    {&lt;br /&gt;        prevtick = ticks;&lt;br /&gt;        if (got)&lt;br /&gt;       {&lt;br /&gt;            // displace Sprite from carrying cursor&lt;br /&gt;//***perhaps make displacement parametrable***&lt;br /&gt;            setPosition(mousex+30, mousey+30);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    // Usual call for animated  sprites at tick()&lt;br /&gt;    public void increment(long ticks)&lt;br /&gt;    {&lt;br /&gt;        if ((ticks - prevtick) &gt;= frametimes[frame])&lt;br /&gt;        {&lt;br /&gt;            setFrame(frame+1);&lt;br /&gt;            prevtick = ticks;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;//*** rather suspicious of this ***&lt;br /&gt;    public int setPriority(int pr)&lt;br /&gt;    {&lt;br /&gt;        if (priority &gt; 0)&lt;br /&gt;            priority = pr;&lt;br /&gt;        return priority;&lt;br /&gt;    }&lt;br /&gt;    public int setScale(int sc)&lt;br /&gt;    {&lt;br /&gt;        if ((sc &gt; 0) &amp;&amp; (sc &lt;= 100))&lt;br /&gt;            scale = sc;&lt;br /&gt;        return scale;&lt;br /&gt;    }&lt;br /&gt;    // Set all the frame times to a single value&lt;br /&gt;    public void setCommonTime(int frt)&lt;br /&gt;    {&lt;br /&gt;        for(int ii = 0; ii &lt; noframes; ii++)&lt;br /&gt;        {&lt;br /&gt;            frametimes[ii] = frt;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    // Set the position&lt;br /&gt;    public void setPosition(int X, int Y)&lt;br /&gt;    {&lt;br /&gt;        extent.x = X;&lt;br /&gt;        extent.y = Y;&lt;br /&gt;    }&lt;br /&gt;    // Set the size&lt;br /&gt;    public void setSize(int X, int Y)&lt;br /&gt;    {&lt;br /&gt;        extent.width = X;&lt;br /&gt;        extent.height = Y;&lt;br /&gt;    }&lt;br /&gt;    // Get the extent&lt;br /&gt;    public Rectangle getExtent()&lt;br /&gt;    {&lt;br /&gt;        return extent;&lt;br /&gt;    }&lt;br /&gt;    // Set the current Frame&lt;br /&gt;    public void setFrame(int frameNo)&lt;br /&gt;    {&lt;br /&gt;         if (frameNo &lt; 0) &lt;br /&gt;        {&lt;br /&gt;            frame = noframes-1;&lt;br /&gt;        }&lt;br /&gt;        else if (frameNo &gt;= noframes) &lt;br /&gt;        {&lt;br /&gt;            frame = 0;&lt;br /&gt;        }&lt;br /&gt;        else &lt;br /&gt;        {&lt;br /&gt;            frame = frameNo;&lt;br /&gt;        }&lt;br /&gt;//*** Not sure this is sensible if we're cacheing images ***&lt;br /&gt;        Integer x = new Integer(frame+1000);&lt;br /&gt;        String ser = new String(x.toString());&lt;br /&gt;        currimage = new String(basefile +&lt;br /&gt;            ser.substring(1) + suffix);&lt;br /&gt;    }&lt;br /&gt;    public int getFrame()&lt;br /&gt;    {&lt;br /&gt;        return frame;&lt;br /&gt;    }&lt;br /&gt;    public String getCurrentImageName()&lt;br /&gt;    {&lt;br /&gt;        return currimage;&lt;br /&gt;    }&lt;br /&gt;    public String getName()&lt;br /&gt;    {&lt;br /&gt;        return spritename;&lt;br /&gt;    }&lt;br /&gt;    public Vector getAllFilenames()&lt;br /&gt;    {&lt;br /&gt;        Vector vec = new Vector();&lt;br /&gt;        for (int ii = 0; ii &lt; noframes; ii++)&lt;br /&gt;        {&lt;br /&gt;            Integer x = new Integer(ii+1000);&lt;br /&gt;            String ser = new String(x.toString());&lt;br /&gt;            String sb = new String(basefile + &lt;br /&gt;                ser.substring(1) + suffix);&lt;br /&gt;            vec.addElement(sb);&lt;br /&gt;        }&lt;br /&gt;        return vec;&lt;br /&gt;    }&lt;br /&gt;    public void addCursor(int c)&lt;br /&gt;    {&lt;br /&gt;        cursor = c;&lt;br /&gt;        cursoron = true;&lt;br /&gt;    }&lt;br /&gt;    public void removeCursor()&lt;br /&gt;    {&lt;br /&gt;        cursoron = false;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;// All the Gettable stuff&lt;br /&gt;    public void getSprite()&lt;br /&gt;    {&lt;br /&gt;        if (movetype == GETTABLE)&lt;br /&gt;        {&lt;br /&gt;            got = true;&lt;br /&gt;//*** Note when a sprite is being carried its image changes to image 1 ***&lt;br /&gt;//*** I don't think there's any check on the range&lt;br /&gt;            setFrame(1);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    public boolean isGettable()&lt;br /&gt;    {&lt;br /&gt;         if (movetype == GETTABLE)&lt;br /&gt;        {&lt;br /&gt;            return true;&lt;br /&gt;        }&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;    public boolean isGot()&lt;br /&gt;    {&lt;br /&gt;        if (got)&lt;br /&gt;            return true;&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;// Overridden if a click is significant &lt;br /&gt;    public boolean hitBy(String hitter)&lt;br /&gt;    {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;    public boolean dropSprite(String Scenename)&lt;br /&gt;    {&lt;br /&gt;        if (got)&lt;br /&gt;        {&lt;br /&gt;            for(int ii = 0; ii &lt; validscenes.size(); ii++)&lt;br /&gt;            {&lt;br /&gt;                String scene =&lt;br /&gt;                    (String)validscenes.elementAt(ii);&lt;br /&gt;                if (scene.equals(Scenename))&lt;br /&gt;               {&lt;br /&gt;                    got = false;&lt;br /&gt;                    Point point = &lt;br /&gt;                        (Point)positions.elementAt(ii);&lt;br /&gt;                    // -1 means anywhere - inventory page etc.&lt;br /&gt;                    if (point.x != -1)&lt;br /&gt;                        setPosition(point.x, point.y);&lt;br /&gt;                    setFrame(0);&lt;br /&gt;                    return true;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return false; &lt;br /&gt;    }&lt;br /&gt;    public void addValidDrop(String scene, int xpos, int ypos)&lt;br /&gt;    {&lt;br /&gt;        validscenes.addElement(scene);&lt;br /&gt;        Point point = new Point(xpos, ypos);&lt;br /&gt;        positions.addElement(point);&lt;br /&gt;    }&lt;br /&gt;    public boolean isHit(int hitx, int hity)&lt;br /&gt;    {&lt;br /&gt;        if (extent.contains(hitx, hity))&lt;br /&gt;        {&lt;br /&gt;            return true;&lt;br /&gt;        }&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;    // overriden for Sprites about which saving/restoring has &lt;br /&gt;    // some relevance other than position &lt;br /&gt;    public String saveMe()&lt;br /&gt;    {&lt;br /&gt;        return null;&lt;br /&gt;    }&lt;br /&gt;    public boolean restoreMe(String savestring)&lt;br /&gt;    {&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;    // used by Sprites which saveMe()&lt;br /&gt;    public String getSavePrefix()&lt;br /&gt;    {&lt;br /&gt;        String saver = new String(spritename + "&lt;");&lt;br /&gt;        return(saver);&lt;br /&gt;    }&lt;br /&gt;    public String gotSave()&lt;br /&gt;    {&lt;br /&gt;        if (this.isGot())&lt;br /&gt;        {&lt;br /&gt;            return ("[GOT]");&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;             return ("[NOTGOT]");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;//*** I wonder if this causes trouble on restore when it's got ***&lt;br /&gt;//*** There is a situation where a gettable sprite is marooned on restore&lt;br /&gt;    public String posSave()&lt;br /&gt;    {&lt;br /&gt;        Integer X = new Integer(extent.x);&lt;br /&gt;        Integer Y = new Integer(extent.y);&lt;br /&gt;        String saver = new String("[X" + X.toString() &lt;br /&gt;             + "Y" + Y.toString() + "]");&lt;br /&gt;        return saver;&lt;br /&gt;    }&lt;br /&gt;    public Point posRestore(String restoreString)&lt;br /&gt;    {&lt;br /&gt;        int X, Y;&lt;br /&gt;        X = 0;&lt;br /&gt;        Y = 0;&lt;br /&gt;        int start = restoreString.indexOf("[X");&lt;br /&gt;        int end = restoreString.indexOf("Y", start);&lt;br /&gt;        if ((start != -1)&amp;&amp;(end != -1))&lt;br /&gt;        {&lt;br /&gt;            String temp = &lt;br /&gt;                restoreString.substring(start+2, end);&lt;br /&gt;            try&lt;br /&gt;            {&lt;br /&gt;                X = Integer.parseInt(temp);&lt;br /&gt;            }&lt;br /&gt;            catch (NumberFormatException e)&lt;br /&gt;            {&lt;br /&gt;                X = 0;&lt;br /&gt;            }&lt;br /&gt;            start=end + 1;&lt;br /&gt;            end = restoreString.indexOf("]", start);&lt;br /&gt;            if (end != -1)&lt;br /&gt;            {&lt;br /&gt;                temp = restoreString.substring(start, end);&lt;br /&gt;                try&lt;br /&gt;                {&lt;br /&gt;                      Y = Integer.parseInt(temp);&lt;br /&gt;                }&lt;br /&gt;                catch (NumberFormatException e)&lt;br /&gt;                {&lt;br /&gt;                    Y = 0;&lt;br /&gt;                }&lt;br /&gt;            }       &lt;br /&gt;        }&lt;br /&gt;        Point p = new Point(X, Y);&lt;br /&gt;        return p;&lt;br /&gt;    }&lt;br /&gt;    public String getRestoreContent(String restoreString)&lt;br /&gt;    {&lt;br /&gt;        String search = getSavePrefix();&lt;br /&gt;        int start = restoreString.indexOf(search);&lt;br /&gt;        if (start != -1)&lt;br /&gt;        {&lt;br /&gt;            start += search.length();&lt;br /&gt;            int end = restoreString.indexOf("&gt;", start);&lt;br /&gt;            if (end != -1)&lt;br /&gt;            {&lt;br /&gt;                search = restoreString.substring(start, end);&lt;br /&gt;                return search;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        return null;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There are definitely some areas for expansion, modification and improvement here, despite the fact that it largely works already. In particular, the areas marked with //*** will reward further study.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-8941365930230406460?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/8941365930230406460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=8941365930230406460' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8941365930230406460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/8941365930230406460'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/sprite-class.html' title='The Sprite Class'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2643113233156721071</id><published>2008-12-13T09:25:00.003Z</published><updated>2009-01-06T18:55:51.525Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>The Save / Restore and Mouse actions</title><content type='html'>Today, we complete Bridge.java with the Save and Restore processes, and the Mouse actions. &lt;br /&gt;&lt;br /&gt;Only one save is stored, in a cookie, by the Javascript shell. Whatever state has most recently been saved can be restored as many times as desired.&lt;br /&gt;&lt;br /&gt;The static state of the game does not vary much. The state of play is largely determined by the positions of all the sprites. Each sprite is requested to supply its save data. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    /* The save process is done in three stages, to prevent&lt;br /&gt;        deadly embrace and similar problems with the HTML/Javascript and&lt;br /&gt;        the applet.&lt;br /&gt;    &lt;br /&gt;        First, the Javascript sets a saveFlag.  Then, when the code is at a good&lt;br /&gt;        stage to do the save, the actual save data is built. Finally, every&lt;br /&gt;        few seconds, the Javascript checks for a save string in the applet.&lt;br /&gt;        Normally this returns an empty string, but in this case it returns&lt;br /&gt;        the save data.    */&lt;br /&gt;    &lt;br /&gt;    // Called from Javascript&lt;br /&gt;    public void doSave()&lt;br /&gt;    {&lt;br /&gt;        showStatus("doSave"); // gil temp&lt;br /&gt;        saveFlag = true;&lt;br /&gt;    }&lt;br /&gt;    // Called from Javascript&lt;br /&gt;    public String getSave()&lt;br /&gt;    {&lt;br /&gt;        String newsave = new String(saveString);&lt;br /&gt;        showStatus("getSave" + newsave); // gil temp&lt;br /&gt;        saveString = new String("");&lt;br /&gt;        return newsave;&lt;br /&gt;    }&lt;br /&gt;    // Called from tick()&lt;br /&gt;    public String saveGame()&lt;br /&gt;    {&lt;br /&gt;        String save;&lt;br /&gt;        String chunk;&lt;br /&gt;        save = new String("game&lt;Bridge&gt;");&lt;br /&gt;        save = save.concat("currscene&lt;"+currscene+"&gt;");&lt;br /&gt;        save = save.concat("popscene&lt;"+popscene+"&gt;");&lt;br /&gt;        save = save.concat("songname&lt;"+songName+"&gt;");&lt;br /&gt;        Vector slist = bridgedata.getAllSprites();&lt;br /&gt;        for (int ii = 0; ii&lt; slist.size(); ii++) &lt;br /&gt;        {&lt;br /&gt;            Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;            chunk = sprite.saveMe();&lt;br /&gt;            if (chunk != null)&lt;br /&gt;                save = save.concat(chunk);&lt;br /&gt;        }&lt;br /&gt;        return save;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In a similar way to the Save process, game restore takes place as a result of a flag set by Javascript and a subsequent detection of that flag in the tick() method.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Called from Javascript&lt;br /&gt;    public void doRestore(String restoredata)&lt;br /&gt;    {&lt;br /&gt;        showStatus("doRestore" + restoredata); // gil temp&lt;br /&gt;        restoreFlag = true;&lt;br /&gt;        restoreData = new String(restoredata);&lt;br /&gt;    }&lt;br /&gt;    // Called from tick()&lt;br /&gt;    public boolean restoreGame(String restore)&lt;br /&gt;    {&lt;br /&gt;        int start, end;&lt;br /&gt;        String save;&lt;br /&gt;        String chunk;&lt;br /&gt;        String restscene;&lt;br /&gt;        showStatus("restoreGame" + restore); // gil temp&lt;br /&gt;        start = restore.indexOf("currscene&lt;");&lt;br /&gt;        end = restore.indexOf("&gt;", start+10);&lt;br /&gt;        if ((start == -1)||(end == -1)) return false;&lt;br /&gt;        restscene = restore.substring(start+10, end);&lt;br /&gt;        start = restore.indexOf("popscene&lt;", end);&lt;br /&gt;        end = restore.indexOf("&gt;", start+9);&lt;br /&gt;        if ((start == -1)||(end == -1)) return false;&lt;br /&gt;        popscene = restore.substring(start+9, end);&lt;br /&gt;        start = restore.indexOf("songname&lt;", end);&lt;br /&gt;        end = restore.indexOf("&gt;", start+9);&lt;br /&gt;        if ((start == -1)||(end == -1)) return false;&lt;br /&gt;        songName = restore.substring(start+9, end);&lt;br /&gt;        Vector slist = bridgedata.getAllSprites();&lt;br /&gt;        for (int ii = 0; ii&lt; slist.size(); ii++) &lt;br /&gt;        {&lt;br /&gt;            Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;            sprite.restoreMe(restore.substring(end));&lt;br /&gt;            if (sprite.isGot())&lt;br /&gt;            {&lt;br /&gt;                isHolding = sprite;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        currscene = changeScene("wait");&lt;br /&gt;        thisscene = bridgedata.fetchCurrentScene();&lt;br /&gt;        displaymanager.refresh(getGraphics());&lt;br /&gt;        currscene = changeScene(restscene);&lt;br /&gt;        thisscene = bridgedata.fetchCurrentScene();&lt;br /&gt;        return true;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Finally, in the Bridge Applet, we get to the Mouse control area.&lt;br /&gt;There are four basic tasks for a click.&lt;ul&gt;&lt;li&gt;If the mouse is clicked in a scene change zone, the scene is changed.&lt;li&gt;If a sprite is being held, and it is clicked on another sprite, then a collision may be detected and acted upon.&lt;li&gt;If a double click is made, a sprite may be taken or dropped.&lt;li&gt;If the click is made on a sprite without a held sprite, that counts as a collision and may result in an action.&lt;/ul&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Find out where the mouse is.&lt;br /&gt;    public void mouseMoved(MouseEvent e) &lt;br /&gt;    {&lt;br /&gt;    mousex = e.getX();&lt;br /&gt;    mousey = e.getY();&lt;br /&gt;    }&lt;br /&gt;    // What happens on mouse click&lt;br /&gt;    public void mouseClicked(MouseEvent e) &lt;br /&gt;    {&lt;br /&gt;        Vector slist = bridgedata.getSceneSprites(currscene);&lt;br /&gt;        int multi = e.getClickCount();        &lt;br /&gt;        String dest = thisscene.getDest(e.getX(), e.getY());&lt;br /&gt;        // Zone click takes priority&lt;br /&gt;        if (dest != null)&lt;br /&gt;        {&lt;br /&gt;            if (dest.equals(""))&lt;br /&gt;            {&lt;br /&gt;                if (popscene != null)&lt;br /&gt;                {&lt;br /&gt;                    dest = popscene;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;    // Wait process&lt;br /&gt;            Scene waitscene = bridgedata.fetchScene("wait");&lt;br /&gt;            waitscene.songname = songName;&lt;br /&gt;            currscene = changeScene("wait");&lt;br /&gt;            thisscene = bridgedata.fetchCurrentScene();&lt;br /&gt;            displaymanager.refresh(getGraphics());&lt;br /&gt;            currscene = changeScene(dest);&lt;br /&gt;            thisscene = bridgedata.fetchCurrentScene();&lt;br /&gt;        }&lt;br /&gt;        // Click one sprite with another&lt;br /&gt;        else if (isHolding != null)&lt;br /&gt;        {&lt;br /&gt;            for (int ii = 0; ii&lt; slist.size(); ii++) &lt;br /&gt;            {&lt;br /&gt;                Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;                if (!sprite.getName().equals(isHolding.getName()))&lt;br /&gt;                {&lt;br /&gt;                    if (sprite.isHit(mousex, mousey))&lt;br /&gt;                    {&lt;br /&gt;                        bridgedata.collide(sprite.getName(),isHolding.getName());&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;br /&gt;        // Pick up sprite&lt;br /&gt;        if (multi &gt;= 2)&lt;br /&gt;            // Double Click behaviour&lt;br /&gt;        {&lt;br /&gt;            if (isHolding != null)&lt;br /&gt;            {&lt;br /&gt;                boolean success = isHolding.dropSprite(currscene);&lt;br /&gt;                if (success)&lt;br /&gt;                {&lt;br /&gt;                    isHolding = null;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                for (int ii = 0; ii&lt; slist.size(); ii++) &lt;br /&gt;                {&lt;br /&gt;                    Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;                    if (sprite.isGettable())&lt;br /&gt;                    {&lt;br /&gt;                        if (sprite.isHit(mousex, mousey))&lt;br /&gt;                        {&lt;br /&gt;                            sprite.getSprite();&lt;br /&gt;                            isHolding = sprite;&lt;br /&gt;                        }&lt;br /&gt;                    }&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        // Click a sprite when not holding&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            for (int ii = 0; ii&lt; slist.size(); ii++) &lt;br /&gt;            {&lt;br /&gt;                Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;                if (sprite.isHit(mousex, mousey))&lt;br /&gt;                {&lt;br /&gt;                    bridgedata.collide(sprite.getName(),null);&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    public void mouseDragged(MouseEvent e) &lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;    public void mousePressed(MouseEvent e) &lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;    public void mouseReleased(MouseEvent e) &lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;    public void mouseEntered(MouseEvent e) &lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;    public void mouseExited(MouseEvent e) &lt;br /&gt;    {&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;//End of Bridge&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2643113233156721071?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2643113233156721071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2643113233156721071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2643113233156721071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2643113233156721071'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/save-restore-and-mouse-actions.html' title='The Save / Restore and Mouse actions'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-4018972253039249403</id><published>2008-12-08T09:48:00.007Z</published><updated>2009-01-06T19:02:08.511Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>The Bridge Applet - Part 3</title><content type='html'>Now we come to the changeScene function. &lt;ul&gt;&lt;li&gt;It makes sure this is a valid scene name;&lt;br /&gt;&lt;li&gt;If the player is carrying anything, it relocates the object in the new scene;&lt;br /&gt;&lt;li&gt;Displays the hourglass cursor;&lt;br /&gt;&lt;li&gt;Fetches the image for the new scene and all the sprite images;&lt;br /&gt;&lt;li&gt;Tells bridgedata and displaymanager about it;&lt;br /&gt;&lt;li&gt;Flags a song change.&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;I don't understand the comment which appears to imply that time is saved in subsequent visits to this scene because the data is cached. It looks as though the sprite images are remembered during a scene, but if the same sprite is encountered in a subsequent screen its data is reloaded. Having thought all the way round this, I conclude it's the best strategy. But the way it's implemented is silly, isn't it?&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // This function collects the scene and any sprites&lt;br /&gt;    // It also reads in the Images for the background and Sprites&lt;br /&gt;    // this time only. Once the scene changes, the images are assumed to be &lt;br /&gt;    // present.&lt;br /&gt;    // Returns the scene name.&lt;br /&gt;    public String changeScene(String sceneName)&lt;br /&gt;    {&lt;br /&gt;        Scene scene = bridgedata.fetchScene(sceneName);&lt;br /&gt;        if (scene == null)&lt;br /&gt;        {&lt;br /&gt;            showStatus("No such scene:" + sceneName);&lt;br /&gt;            return currscene;&lt;br /&gt;        }&lt;br /&gt;        // Deal with any carried items&lt;br /&gt;        if (isHolding != null)&lt;br /&gt;        {&lt;br /&gt;            isHolding.relocate(sceneName);&lt;br /&gt;        }&lt;br /&gt;        currCursor = Cursor.WAIT_CURSOR;&lt;br /&gt;        setCursor(Cursor.getPredefinedCursor(currCursor));&lt;br /&gt;        MediaTracker tracker= new java.awt.MediaTracker(this);&lt;br /&gt;        URL address = getCurrentUrl("images/"+scene.imagename);&lt;br /&gt;        backcloth = getImage(address);&lt;br /&gt;        tracker.addImage(backcloth, 0);&lt;br /&gt;        Vector slist = bridgedata.getSceneSprites(sceneName);&lt;br /&gt;        int serial = 1;&lt;br /&gt;        for (int ii = 0; ii&lt; slist.size(); ii++) &lt;br /&gt;        {&lt;br /&gt;            Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;            Vector sfnames = sprite.getAllFilenames();&lt;br /&gt;            for (int jj = 0; jj &lt; sfnames.size(); jj++)&lt;br /&gt;            {&lt;br /&gt;                String fn = (String)sfnames.elementAt(jj);&lt;br /&gt;                URL addr = getCurrentUrl("images/"+ fn);&lt;br /&gt;                Image im = getImage(addr);&lt;br /&gt;                tracker.addImage(im, serial++);                &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            tracker.waitForAll();&lt;br /&gt;        }&lt;br /&gt;        catch (InterruptedException e)&lt;br /&gt;        {&lt;br /&gt;            showStatus("Scene Load Media Tracker Interrupted");&lt;br /&gt;        }&lt;br /&gt;        // cache images with sprite        &lt;br /&gt;        for (int ii = 0; ii&lt; slist.size(); ii++) &lt;br /&gt;        {&lt;br /&gt;            Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;            Vector sfnames = sprite.getAllFilenames();&lt;br /&gt;            for (int jj = 0; jj &lt; sfnames.size(); jj++)&lt;br /&gt;            {&lt;br /&gt;                String fn = (String)sfnames.elementAt(jj);&lt;br /&gt;                URL addr = getCurrentUrl("images/"+ fn);&lt;br /&gt;                Image im = getImage(addr);&lt;br /&gt;                sprite.addImage(jj, im);                &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        currCursor = Cursor.DEFAULT_CURSOR;&lt;br /&gt;        setCursor(Cursor.getPredefinedCursor(currCursor));&lt;br /&gt;&lt;br /&gt;        bridgedata.setCurrentScene(sceneName);&lt;br /&gt;        displaymanager.setBackground(backcloth);&lt;br /&gt;        songName = scene.songname;&lt;br /&gt;        songFlag = true;&lt;br /&gt;        return sceneName;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Straightforward function to create absolute url from relative url.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Form url from relative string and base&lt;br /&gt;    URL getCurrentUrl(String relative)&lt;br /&gt;    {&lt;br /&gt;        String urlstr = codebasestr.concat(relative);&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            URL urlurl = new URL(urlstr);&lt;br /&gt;            return urlurl;&lt;br /&gt;        }&lt;br /&gt;        catch (MalformedURLException e)&lt;br /&gt;        {&lt;br /&gt;            showStatus("Error" + urlstr);&lt;br /&gt;        }&lt;br /&gt;        return null;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here is the function that is called by Javascript when the Inventory button is clicked. It sets a flag to request a scene change to the Inventory.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;I remarked earlier that a change to Inventory ought not to take place if the current scene is already Inventory. I could duplicate this test here.&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Called from Javascript&lt;br /&gt;    public void goInv()&lt;br /&gt;    {&lt;br /&gt;        showStatus("goInv");  // gil temp&lt;br /&gt;        if (!currscene.equals("inventory")) invFlag = true;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Called from Javascript&lt;br /&gt;    public String checkSong()&lt;br /&gt;    {&lt;br /&gt;        String noSong = new String("none");&lt;br /&gt;        showStatus("checkSong");  // gil temp&lt;br /&gt;        if (songFlag)&lt;br /&gt;        {&lt;br /&gt;            songFlag = false;&lt;br /&gt;            return(songName);&lt;br /&gt;        }&lt;br /&gt;        return(noSong);&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-4018972253039249403?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/4018972253039249403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=4018972253039249403' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4018972253039249403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4018972253039249403'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/bridge-applet-part-3.html' title='The Bridge Applet - Part 3'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-4712647759109162927</id><published>2008-12-07T23:48:00.003Z</published><updated>2008-12-07T23:54:53.666Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>A Little Pause</title><content type='html'>I've stopped the flow of Java code while I cogitate over a few things, and consult references. I had to fetch all my old Java books out of the garage attic, and one thing led to another.&lt;br /&gt;&lt;br /&gt;As a result, it seems that I will implement music via a Java-driven mp3 player thread, rather than the rather lame MIDI implementation in Javascript.&lt;br /&gt;&lt;br /&gt;I am also torn about the possibility of cacheing images rather than downloading them every time. This is such a difficult one, I've got to contemplate the consequences.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-4712647759109162927?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/4712647759109162927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=4712647759109162927' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4712647759109162927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4712647759109162927'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/little-pause.html' title='A Little Pause'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-2153247629492066918</id><published>2008-12-03T23:37:00.004Z</published><updated>2009-01-06T18:52:26.276Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>Update(), Paint(), tick and the TickTimer Thread</title><content type='html'>The (Container) method update() may be called, and the default action includes background clearance. We override this to call just the DisplayManager.paint() function. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Bridge.update() is called when repaint() has been suggested&lt;br /&gt;    public void update(Graphics g)&lt;br /&gt;    {&lt;br /&gt;        displaymanager.paint(g);&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Another overridden Container method    &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    // Bridge.paint() is called when a complete refresh is necessary&lt;br /&gt;    public void paint(Graphics g)&lt;br /&gt;    {&lt;br /&gt;        displaymanager.refresh(g);&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This is the tick() function, the heartbeat of the applet. This is aimed to be called every nth of a second, and all the sprites and the cursor are dealt with.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;I'm not sure about dodging out altogether if cursor is in WAIT state.&lt;br /&gt;&lt;br /&gt;If the current scene is already inventory, we should ignore an inventory request.&lt;br /&gt;&lt;br /&gt;The zone cursor selection should take place before the sprite cursor selection, surely.&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    public void tick()&lt;br /&gt;    {&lt;br /&gt;        int thisCursor;&lt;br /&gt;        // If the current cursor is "hourglass", do nothing&lt;br /&gt;        if (currCursor == Cursor.WAIT_CURSOR) return;&lt;br /&gt;        // Check for flags from Javascript&lt;br /&gt;        if (invFlag)&lt;br /&gt;        {&lt;br /&gt;            invFlag = false;&lt;br /&gt;            popscene = currscene;&lt;br /&gt;            currscene = changeScene("inventory");&lt;br /&gt;            thisscene = bridgedata.fetchCurrentScene();&lt;br /&gt;        }&lt;br /&gt;        if (saveFlag)&lt;br /&gt;        {&lt;br /&gt;            saveFlag = false;&lt;br /&gt;            saveString = saveGame();&lt;br /&gt;        }&lt;br /&gt;        if (restoreFlag)&lt;br /&gt;        {&lt;br /&gt;            restoreFlag = false;&lt;br /&gt;            restoreGame(restoreData);&lt;br /&gt;        }&lt;br /&gt;        thisCursor = Cursor.DEFAULT_CURSOR;&lt;br /&gt;        Vector slist = bridgedata.getCurrentSprites();&lt;br /&gt;        for (int ii=0; ii &lt; slist.size(); ii++)&lt;br /&gt;        {&lt;br /&gt;            // get all the sprites&lt;br /&gt;            Sprite sprite = (Sprite)slist.elementAt(ii);&lt;br /&gt;            // tick them&lt;br /&gt;            sprite.tick(ticks, mousex, mousey);&lt;br /&gt;            // cursor them&lt;br /&gt;            if (sprite.cursoron)&lt;br /&gt;            {&lt;br /&gt;                Rectangle r = sprite.getExtent();&lt;br /&gt;                if (r.contains(mousex, mousey))&lt;br /&gt;                {&lt;br /&gt;                    thisCursor = sprite.cursor;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        int zc = thisscene.getZoneCursor(mousex, mousey);&lt;br /&gt;        if (zc != -1)&lt;br /&gt;        {&lt;br /&gt;            thisCursor = zc;&lt;br /&gt;        }&lt;br /&gt;        if ((thisCursor != currCursor) &amp;&amp; (currCursor != Cursor.WAIT_CURSOR))&lt;br /&gt;        {&lt;br /&gt;            currCursor = thisCursor;&lt;br /&gt;            setCursor(Cursor.getPredefinedCursor(currCursor));&lt;br /&gt;        }&lt;br /&gt;        repaint();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ticktimer runs as a separate thread, attempting to call tick() n times a second. It uses System time in milliseconds. If it misses any ticks, it figures out how many ticks it has missed and increments the variable ticks accordingly. Some activities, especially sprite movement, care that the ticks have jumped, others just ignore it.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    class Ticktimer extends Thread&lt;br /&gt;    {&lt;br /&gt;        private long interval;&lt;br /&gt;        public void run()&lt;br /&gt;        {&lt;br /&gt;            while (true)&lt;br /&gt;            {&lt;br /&gt;                timenow = System.currentTimeMillis();&lt;br /&gt;                interval = timenow-timewas;&lt;br /&gt;                if (interval &gt; FRACTION)&lt;br /&gt;                {&lt;br /&gt;                    interval /= FRACTION;&lt;br /&gt;                    ticks += interval;&lt;br /&gt;                    timewas += (interval*FRACTION);&lt;br /&gt;                    tick();&lt;br /&gt;                }&lt;br /&gt;                try&lt;br /&gt;                {&lt;br /&gt;                    sleep(((FRACTION-1)&gt;0)?(FRACTION-1):(1));&lt;br /&gt;                }&lt;br /&gt;                catch(InterruptedException e)&lt;br /&gt;                {&lt;br /&gt;                    return;&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-2153247629492066918?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/2153247629492066918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=2153247629492066918' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2153247629492066918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/2153247629492066918'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/container-method-update-may-be-called.html' title='Update(), Paint(), tick and the TickTimer Thread'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-9039653661650818783</id><published>2008-12-01T08:56:00.004Z</published><updated>2009-01-06T18:50:59.563Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><title type='text'>Bridge Part 2 -  init() start() stop()</title><content type='html'>Here's the init() function, called by the browser or applet viewer to inform this applet that it has been loaded into the system.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    public void init()&lt;br /&gt;    {&lt;br /&gt;        // Establish the path (URL) of the applet itself&lt;br /&gt;        codebasestr = getCodeBase().toString();&lt;br /&gt;        // Clear the area into which Save data will be copied&lt;br /&gt;        saveString = new String("");&lt;br /&gt;        // Clear the Save flag&lt;br /&gt;        saveFlag = false;&lt;br /&gt;        // Clear the item that indicates a Sprite is being held by the player&lt;br /&gt;        isHolding = null;&lt;br /&gt;        // Set up a class instance for the scene data&lt;br /&gt;        bridgedata = new BridgeData(this);&lt;br /&gt;        // Set up class instances for display stuff&lt;br /&gt;        dirtyrectset = new DirtyRectSet();&lt;br /&gt;        displaymanager = new DisplayManager(this);&lt;br /&gt;        // No music right now&lt;br /&gt;        songFlag = false;&lt;br /&gt;        // Set the initial scene &lt;br /&gt;        currscene = changeScene(bridgedata.startup); // returns scene name&lt;br /&gt;        thisscene = bridgedata.fetchCurrentScene();  // returns scene class instance&lt;br /&gt;        // Initialise the loop timer&lt;br /&gt;        timerRunning = false;&lt;br /&gt;        ticks=0;&lt;br /&gt;        // Set Mouse interrupt functions&lt;br /&gt;        addMouseMotionListener(this);&lt;br /&gt;        addMouseListener(this);&lt;br /&gt;        // No inventory entry now&lt;br /&gt;        invFlag = false;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The start() function, called by the browser or applet viewer to inform this applet that it should start its execution. start() and stop() may be called repeatedly during the applet's existence as the page it is on drops out of focus etc. All we do here is to start the timer if it is stopped, and to create a new timer if there isn't one already. This means we can halt operation and restart, effectively freezing the game time. &lt;span style="font-style:italic;"&gt;I'm not sure we should call timer.start() unless we have just created it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    public void start()&lt;br /&gt;    {&lt;br /&gt;        if (!timerRunning)&lt;br /&gt;        {&lt;br /&gt;            ticks++;&lt;br /&gt;            timewas = timenow = System.currentTimeMillis();&lt;br /&gt;            timerRunning = true;&lt;br /&gt;            if (timer == null)&lt;br /&gt;            {&lt;br /&gt;                timer = new Ticktimer();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        timer.start();&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The stop() function, called by the browser or applet viewer to inform this applet that it should stop its execution. It is called when the Web page that contains this applet has been replaced by another page, and also just before the applet is to be destroyed. Apparently it isn't safe to stop() a timer, so we just flag it as suspended. &lt;span style="font-style:italic;"&gt;I think we ought to check this flag in the tick() function or in the ticktimer, which we don't currently do, otherwise ticks will just keep going ad infinitum even if we wanted the timer to freeze.&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    public void stop()&lt;br /&gt;    {&lt;br /&gt;        timerRunning = false;&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-9039653661650818783?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/9039653661650818783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=9039653661650818783' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/9039653661650818783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/9039653661650818783'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/12/bridge-part-2-init-start-stop.html' title='Bridge Part 2 -  init() start() stop()'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-825350946368335769</id><published>2008-11-30T08:51:00.005Z</published><updated>2009-01-06T18:49:48.346Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>The Bridge Class - Part 1</title><content type='html'>May I apologise in advance to Java experts for (at least) the following irritations they may experience.&lt;ul&gt;&lt;li&gt;Due to a lifetime of chasing brace-matches through C code, I cannot seem to take to the Java habit of failing to line up braces vertically;&lt;li&gt;Further, because I've been programming in many languages since 1964 (yes, 1964), I have a habit of calling methods "functions".&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Now, let's start to work through the Applet. First, the introductory bit, which specifies the standard packages we will use, and defines the Applet:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// Bridge Applet (c)Amazon Systems&lt;br /&gt;&lt;br /&gt;import java.awt.*;&lt;br /&gt;import java.applet.*;&lt;br /&gt;import java.net.URL;&lt;br /&gt;import java.util.Vector;&lt;br /&gt;import java.awt.event.*;&lt;br /&gt;import java.net.MalformedURLException;&lt;br /&gt;public class Bridge extends Applet &lt;br /&gt;          implements MouseMotionListener, MouseListener&lt;br /&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Next, a pile of variables are defined. Many of these are class variables.&lt;br /&gt;Ticktimer is a Thread class handling the timing of the main loop.&lt;br /&gt;BridgeData is where all the Scene data are defined.&lt;br /&gt;DisplayManager and DirtRectSet handle the Graphics.&lt;br /&gt;The variables for communication with Javascript (data and flags) are also defined here.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;//  Timers&lt;br /&gt; private boolean timerRunning;&lt;br /&gt; public Ticktimer timer = null;&lt;br /&gt; private long timewas, timenow;&lt;br /&gt; public long ticks;&lt;br /&gt;    // 1000/n where ticks are 1/n seconds &lt;br /&gt;        private static int FRACTION = 1000/12;&lt;br /&gt;&lt;br /&gt;// Scene control&lt;br /&gt; public BridgeData bridgedata;&lt;br /&gt; public String currscene;&lt;br /&gt; public String popscene;&lt;br /&gt; public Scene thisscene;&lt;br /&gt; public Image backcloth;&lt;br /&gt; public DirtyRectSet dirtyrectset;&lt;br /&gt; public DisplayManager displaymanager;&lt;br /&gt; public int mousex, mousey;&lt;br /&gt; private Sprite isHolding;&lt;br /&gt; public String codebasestr;&lt;br /&gt; &lt;br /&gt;// Communication Area&lt;br /&gt; private boolean invFlag;&lt;br /&gt; private boolean songFlag;&lt;br /&gt; private String songName;&lt;br /&gt; private boolean saveFlag;&lt;br /&gt; private String saveString;&lt;br /&gt; private boolean restoreFlag;&lt;br /&gt; private String restoreData;&lt;br /&gt; private int currCursor;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-825350946368335769?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/825350946368335769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=825350946368335769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/825350946368335769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/825350946368335769'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/11/bridge-class-part-1_30.html' title='The Bridge Class - Part 1'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-5367716549746301736</id><published>2008-11-29T10:38:00.005Z</published><updated>2009-01-06T18:48:52.842Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML Javascript'/><title type='text'>The Applet Call</title><content type='html'>And now, the tiny scrap of HTML that calls the Bridge Applet and handles the buttons.&lt;br /&gt;&lt;br /&gt;The first thing the code does is to start the timeout for checking the applet. Once called, this function continuously calls itself again. I fancy that we are sometimes calling an applet that isn't loaded yet. This causes a confusing message from time to time and I should catch and suppress it (using the self.onerror function that is the first line of Javascript) but while in development, I just let the error show. I hoped there ought to be a cleaner method of starting it off, though it's hard for Java to report to its calling function. &lt;br /&gt;&lt;br /&gt;Next, we set up a table with the applet load instruction on the left and the buttons on the right.&lt;br /&gt;&lt;br /&gt;All the buttons call the applet, either via the javascript functions we talked about yesterday, or directly.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;BODY onLoad = "setTimeout('checkApplet()', 5000);"&amp;gt;&lt;br /&gt;&amp;lt;TABLE&amp;gt;&lt;br /&gt;&amp;lt;TR&amp;gt;&lt;br /&gt;&amp;lt;TD&amp;gt;&lt;br /&gt;&amp;lt;APPLET code="Bridge" archive = "com/bridge/bridge11.jar" &lt;br /&gt;    width = "640" height="480" id="Bridge" &lt;br /&gt;    name="Bridge"&amp;gt; &amp;lt;/APPLET&amp;gt;&amp;lt;/TD&amp;gt;&lt;br /&gt;&amp;lt;TD&amp;gt;&lt;br /&gt;&amp;lt;FORM name = form1&amp;gt;&lt;br /&gt;&amp;lt;input type="button" value="Inventory" &lt;br /&gt;    onClick = "document.Bridge.goInv()"&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;&amp;lt;input type="button" value="Save" &lt;br /&gt;    onClick = "saveGame()"&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;&amp;lt;input type="button" value="Restore" &lt;br /&gt;    onClick = "restoreGame()"&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;&amp;lt;input type="button" value="Switch Music Off" &lt;br /&gt;    onClick = "togglesound()" name="togglebutton"&amp;gt;&lt;br /&gt;&amp;lt;BR&amp;gt;&lt;br /&gt;&amp;lt;/FORM&amp;gt;&lt;br /&gt;&amp;lt;/TD&amp;gt;&lt;br /&gt;&amp;lt;/TR&amp;gt;&lt;br /&gt;&amp;lt;/TABLE&amp;gt;&lt;br /&gt;&amp;lt;/BODY&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-5367716549746301736?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/5367716549746301736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=5367716549746301736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/5367716549746301736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/5367716549746301736'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/11/applet-call_1437.html' title='The Applet Call'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-7047930445803845892</id><published>2008-11-28T15:29:00.026Z</published><updated>2009-01-06T18:48:05.525Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Alerts'/><category scheme='http://www.blogger.com/atom/ns#' term='HTML Javascript'/><title type='text'>The Javascript functions in Page3js</title><content type='html'>&lt;span style="font-style:italic;"&gt;(Boy, did I have a job rendering the code in an acceptable way. Finally got it the way it is, and I'm happy with it but I've modified the template for&lt;span style="font-weight:bold;"&gt; pre&lt;/span&gt; tags.)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The page page3js.htm is the page that arrives in the "mainframe" frame.&lt;br /&gt;&lt;br /&gt;The first section of this is a couple of functions to deal with the midi songs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;There may be an issue with starting and stopping the music when the applet is "frozen", as the music continues in Firefox if it is on a hidden tab.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;HEAD&amp;gt;&lt;br /&gt;&amp;lt;TITLE&amp;gt;Bridge - Page3js&amp;lt;/TITLE&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script language="Javascript" type="text/javascript"&amp;gt;&lt;br /&gt;//self.onerror = function(){return (true);}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;var songname="hush";             //current song&lt;br /&gt;var soundtoggle = "on"           //music on&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// change the contents of the sound frame &lt;br /&gt;// unless it's already playing&lt;br /&gt;function newsong(name)&lt;br /&gt;{&lt;br /&gt;    if (name == songname) return;&lt;br /&gt;    if (name=="c12") parent.soundframe.location="c12.htm";&lt;br /&gt;    if (name=="ara") parent.soundframe.location="ara.htm";&lt;br /&gt;    if (name=="") parent.soundframe.location="hush.htm";&lt;br /&gt;&lt;br /&gt;    songname = name;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// switch music off or on&lt;br /&gt;function togglesound()&lt;br /&gt;{&lt;br /&gt;    var temp = songname;     //remenber the current song&lt;br /&gt;    if (soundtoggle == "on")&lt;br /&gt;    {&lt;br /&gt;        newsong("");     //silence&lt;br /&gt;        songname = temp;&lt;br /&gt;        soundtoggle = "off";&lt;br /&gt;        document.form1.togglebutton.value="Switch Music On";   &lt;br /&gt;    }&lt;br /&gt;    else &lt;br /&gt;    {&lt;br /&gt;        songname = "hush";&lt;br /&gt;        newsong(temp);&lt;br /&gt;        soundtoggle = "on";&lt;br /&gt;        document.form1.togglebutton.value="Switch Music Off";&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The following functions deal with communication to and from the applet, which, for historical reasons that I forget, is called&lt;span style="font-weight: bold;"&gt; Bridge&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;The first function calls two more functions that poll the applet for new Save data and for a request to change the song currently being played. Then it arranges to be called again.&lt;br /&gt;&lt;br /&gt;The communication always takes the form of a function being called, a function of the form: document.Bridge.&lt;span style="font-style: italic;"&gt;function-name(...)&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Note that save data is stored in a cookie. On a request from the Save button press, the game is requested to start collecting save data. When a poll from checkSave() results in some data being there, the javascript stuffs it away. When a Restore is requested, the applet is called with the cookie data.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;function checkApplet()&lt;br /&gt;{&lt;br /&gt;    checkSave();&lt;br /&gt;    changeSong();&lt;br /&gt;    setTimeout('checkApplet()', 2000);&lt;br /&gt;}&lt;br /&gt;function checkSave()&lt;br /&gt;{&lt;br /&gt;    // the term:  + "" added to the result to ensure &lt;br /&gt;    // against a null return&lt;br /&gt;    var savestring = document.Bridge.getSave() + ""; &lt;br /&gt;    if (savestring != "")&lt;br /&gt;    {&lt;br /&gt;        var nextyear = new Date();&lt;br /&gt;        nextyear.setFullYear(nextyear.getFullYear()+1);&lt;br /&gt;        document.cookie = "saved=" + escape(savestring) &lt;br /&gt;          + "; expires=" + nextyear.toGMTString();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;function changeSong()&lt;br /&gt;{&lt;br /&gt;    var appsong = document.Bridge.checkSong() + "";&lt;br /&gt;    if (appsong != "none")&lt;br /&gt;    {&lt;br /&gt;        if (soundtoggle == "on")&lt;br /&gt;        {&lt;br /&gt;            newsong(appsong);&lt;br /&gt;        }&lt;br /&gt;        else&lt;br /&gt;        {&lt;br /&gt;            songname = appsong;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;function saveGame()&lt;br /&gt;{&lt;br /&gt;    document.Bridge.doSave();&lt;br /&gt;}&lt;br /&gt;function restoreGame()&lt;br /&gt;{&lt;br /&gt;    var allcookies = document.cookie;&lt;br /&gt;    var pos = allcookies.indexOf("saved=");&lt;br /&gt;    var start = pos+6;&lt;br /&gt;    var end = allcookies.indexOf(";", start);&lt;br /&gt;    if (end == -1) end = allcookies.length;&lt;br /&gt;    var value = allcookies.substring(start, end);&lt;br /&gt;    value = unescape(value);&lt;br /&gt;    document.Bridge.doRestore(value);&lt;br /&gt;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/HEAD&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Tomorrow I'll continue with the BODY of page3js.htm&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-7047930445803845892?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/7047930445803845892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=7047930445803845892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7047930445803845892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/7047930445803845892'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/11/rest-of-html-and-javascript.html' title='The Javascript functions in Page3js'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-3633958478421051128</id><published>2008-11-27T18:42:00.008Z</published><updated>2009-01-06T18:40:49.225Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='HTML Javascript'/><title type='text'>HTML and Javascript Framework</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_g4a_aq3nffY/SS7qoAoQFWI/AAAAAAAAAAU/ZnDq46PhDRs/s1600-h/jade1.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 300px; height: 187px;" src="http://1.bp.blogspot.com/_g4a_aq3nffY/SS7qoAoQFWI/AAAAAAAAAAU/ZnDq46PhDRs/s400/jade1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5273410186781922658" /&gt;&lt;/a&gt;&lt;br /&gt;When the user starts up the game, he is calling up an HTML page like the one here. It consists of two frames, one of which you can see, the other is "hidden". We'll come back to the hidden frame in a moment.&lt;br /&gt;&lt;br /&gt;The frame you can see has a rectangle where the Java applet resides. The applet is doing most of the work here, but we need to initiate it and communicate with it.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_g4a_aq3nffY/SS7sZIZ-XDI/AAAAAAAAAAc/d6Zm8znAfKw/s1600-h/detail1.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 237px; height: 172px;" src="http://3.bp.blogspot.com/_g4a_aq3nffY/SS7sZIZ-XDI/AAAAAAAAAAc/d6Zm8znAfKw/s400/detail1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5273412130194742322" /&gt;&lt;/a&gt;&lt;br /&gt;There are also four buttons on a Javascript form which communicate with the Java applet.&lt;br /&gt;&lt;br /&gt;Here is the HTML for the outer framework.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;HEAD&amp;gt;&lt;br /&gt;&amp;lt;TITLE&amp;gt;China 11&amp;lt;/TITLE&amp;gt;&lt;br /&gt;&amp;lt;/HEAD&amp;gt;&lt;br /&gt;&amp;lt;FRAMESET rows="90%, 1%"&amp;gt;&lt;br /&gt;&amp;lt;FRAME SRC="./page3js.htm" name="mainframe"&amp;gt;&lt;br /&gt;&amp;lt;FRAME SRC="./hush.htm" name="soundframe"&amp;gt;&lt;br /&gt;&amp;lt;/FRAMESET&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The almost invisible frame "soundframe" enables the game to play midi tunes. The initial page that goes in that frame is hush.htm, which does nothing:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;HEAD&amp;gt;&lt;br /&gt;&amp;lt;TITLE&amp;gt;hush&amp;lt;/TITLE&amp;gt;&lt;br /&gt;&amp;lt;/HEAD&amp;gt;&lt;br /&gt;&amp;lt;BODY&amp;gt;&lt;br /&gt;Bridge hush&lt;br /&gt;&amp;lt;/BODY&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;For debugging purposes, I can open up the frame and see what page is "playing".&lt;br /&gt;&lt;br /&gt;A different page that has a tune on it can be loaded by Javascript at run-time. This is the page for one of the songs.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&amp;gt;&lt;br /&gt;&amp;lt;HTML&amp;gt;&lt;br /&gt;&amp;lt;HEAD&amp;gt;&lt;br /&gt;&amp;lt;TITLE&amp;gt;ara&amp;lt;/TITLE&amp;gt;&lt;br /&gt;&amp;lt;BGSOUND src="./sounds/arabian.mid" loop = "-1"&amp;gt;&lt;br /&gt;&amp;lt;/HEAD&amp;gt;&lt;br /&gt;&amp;lt;BODY&amp;gt;&lt;br /&gt;&amp;lt;BGSOUND src="./sounds/arabian.mid" loop = "-1"&amp;gt;&lt;br /&gt;&amp;lt;EMBED name = "ara" SRC = "./sounds/arabian.mid" autostart="true" &lt;br /&gt;    loop="true" hidden="true" mastersound&amp;gt;&amp;lt;/embed&amp;gt;&lt;br /&gt;Bridge ara&lt;br /&gt;&amp;lt;/BODY&amp;gt;&lt;br /&gt;&amp;lt;/HTML&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that it uses BGSOUND as well as EMBED. This was to cover old Internet Explorer versions. The idea is that it plays in a loop until the game ends or a new song is put in place. There are a number of problems with this system - not every browser gets the right sound or any sound at all. There's a horrible crunch when the song is changed on Firefox, whereas it all works rather well on IE.&lt;br /&gt;&lt;br /&gt;I don't want to dwell too much on this, because I intend to change the mechanism in due course.&lt;br /&gt;&lt;br /&gt;Tomorrow I'll start on the main page that sits in the "mainframe" frame and communicates with the applet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-3633958478421051128?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/3633958478421051128/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=3633958478421051128' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3633958478421051128'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/3633958478421051128'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/11/html-and-javascript-framework.html' title='HTML and Javascript Framework'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_g4a_aq3nffY/SS7qoAoQFWI/AAAAAAAAAAU/ZnDq46PhDRs/s72-c/jade1.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-4325560698947315920</id><published>2008-11-26T23:21:00.006Z</published><updated>2009-03-07T20:06:23.571Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Plan of Action</title><content type='html'>By the way, I'm not going to mess about with extended navel-gazing here. It's my plan to do a top-down analysis of the product to date (bearing in mind its age) and remind myself of how it works as I go.&lt;br /&gt;&lt;br /&gt;At the time it was written, typical users didn't have broadband, and some compromises were made to save transfer volumes and improve speeds. This restriction no longer holds.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;A link to a zip file containing all the sources can be found in the Links section. Just click the link and my phpzilla download page will come up&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Finally, I'll improve it and turn it into the adventure it ought to be, hopefully with some help from my readers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-4325560698947315920?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/4325560698947315920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=4325560698947315920' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4325560698947315920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/4325560698947315920'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/11/plan-of-action.html' title='Plan of Action'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6419069426408917488.post-974886448163489532</id><published>2008-11-26T17:14:00.003Z</published><updated>2008-12-08T10:21:22.266Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='general'/><title type='text'>Introduction</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.nascr.net/~fff/bridge/page11.htm" target=_blank&gt;&lt;img style="float:right; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px; height: 150px;" src="http://www.amazonsystems.co.uk/ebayimages/view1.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;Some five years ago, maybe longer, I started writing an adventure system which could deliver a Myst-like adventure over the web (i.e. through a browser).&lt;br /&gt;&lt;br /&gt;I did a proof of concept small adventure which you can see by clicking the image to the right here:&lt;br /&gt;&lt;br /&gt;It's a java applet operating with some assistance from a javascript framework.&lt;br /&gt;&lt;br /&gt;I caution you... it is pretty lame.  There are only 3 or 4 scenes, the click detection is not correct and the music is delivered via a javascript framework.&lt;br /&gt;&lt;br /&gt;But it contains the basis for an adventure - the circling birds on the front screen, the ability to pick up and drop the key, the inventory, save and restore features, the ability to add scenes and sprites at will via simple java functions. The scenes are generated using POVRAY.&lt;br /&gt;&lt;br /&gt;It began with Mark Tacchi's &lt;a href="http://www.vendini.com/GameletToolkit/" target=_blank&gt;&lt;b&gt;Gamelet Toolkit&lt;/b&gt;&lt;/a&gt;, and I'd hoped to use it almost unchanged, but although there are still chunks of Mark's code in the graphics area, my engine is largely unrecognisable.&lt;br /&gt;&lt;br /&gt;So this is the starting point. Here we go. Comments and offers of assistance are welcome!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6419069426408917488-974886448163489532?l=amazonsystems.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://amazonsystems.blogspot.com/feeds/974886448163489532/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6419069426408917488&amp;postID=974886448163489532' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/974886448163489532'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6419069426408917488/posts/default/974886448163489532'/><link rel='alternate' type='text/html' href='http://amazonsystems.blogspot.com/2008/11/introduction.html' title='Introduction'/><author><name>Gil</name><uri>http://www.blogger.com/profile/08021058996570815548</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://2.bp.blogspot.com/_g4a_aq3nffY/Sbb6hVzs5cI/AAAAAAAAABg/nFc0wtKhKCw/S220/gil2.jpg'/></author><thr:total>0</thr:total></entry></feed>
