tag:blogger.com,1999:blog-17165036196278403242024-02-20T14:04:10.359+00:00Grizzle's Caveprogramming, python, game development.Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-1716503619627840324.post-70818591058377713262010-03-29T14:00:00.000+01:002010-03-29T14:00:43.267+01:00Games Programming - Menus need love too!First of all let me apologise to both of my followers for not posting something sooner. ;-)<br />
<br />
Now when it comes to indie games development one of the most over-looked aspects is designing the main interface. It occurred to me that a game needs a start screen menu, probably an options menu and possibly some sub menus as well. What my latest video shows is how I have chosen to tackle this need. Menus! Wooo exciting!<br />
<br />
Anyway, because I would like to reuse my code. I chose to create a Menu class that can take a number of buttons and their corresponding actions as arguments and draw a menu dynamically according to a size variable. This way I can re-use the same code for all the menus in this game or another I may or may not choose to make.<br />
<br />
The video simply shows me changing the size argument and then changing the number of buttons.<br />
<object height="385" width="480"><param name="movie" value="http://www.youtube.com/v/U9OE8Jf0bAI&hl=en_GB&fs=1&color1=0x234900&color2=0x4e9e00"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/U9OE8Jf0bAI&hl=en_GB&fs=1&color1=0x234900&color2=0x4e9e00" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com1tag:blogger.com,1999:blog-1716503619627840324.post-5933896556972452772009-12-16T05:43:00.000+00:002009-12-16T05:43:31.490+00:00Psyco == AwesomeAs I mentioned in my last post, Project Euler is dominating my coding time as of late. I have currently solved 20 out of the 268 on there. The last being this <a href="http://projecteuler.net/index.php?section=problems&id=14">one</a>. The code I wrote was slow, taking around a minute to get to the correct answer. It did get the job done, but I decided there had to be a way to speed things up. That was when I remembered reading about <a href="http://psyco.sourceforge.net/">Psyco</a>.<br />
<br />
<i>"So what does Psyco do?"</i> I hear you cry. In a nutshell it claims to speed up Python code by a factor of 2 to 4 times. Being a natural sceptic I tested it on the code in my last post. It took my code only 0.047 seconds using Psyco which is a pretty good improvement over the 0.5 seconds it takes with vanilla Python.<br />
<br />
Quite impressed with the performance increase I decided to try it with the game I have been working on. This is when I became very impressed. I do not have exact figures, but it runs A LOT faster now. Which means I get to add more particle effects, more explosions and generally more stuff on screen without suffering massive lag.<br />
<br />
On a completely different, but somewhat related topic all this Psyco talk reminded me of a classic tune from my youth, way back when Hip-Hop was actually worth listening to. I remember this tune was playing on my stereo the first ever time I got over 300 lines in Tetris. All done on the original Gameboy no less. I know, I am old! Anyway here is a link to Psycho by Lords of the Underground.<br />
<br />
<object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/CpG5eiJIX5w&hl=en_GB&fs=1&rel=0&color1=0x234900&color2=0x4e9e00"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/CpG5eiJIX5w&hl=en_GB&fs=1&rel=0&color1=0x234900&color2=0x4e9e00" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><span style="font-size: 10px; white-space: pre;"><br />
</span></span>Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com1tag:blogger.com,1999:blog-1716503619627840324.post-27505998972639034482009-12-09T10:45:00.003+00:002009-12-17T18:41:35.482+00:00Project Euler. A good distraction!<span style="font-size: small;"><span style="font-size: 13px;"></span></span><br />
<span style="font-size: small;"><span style="font-size: 13px;"></span></span><br />
<span style="font-size: small;"><span style="font-size: 13px;"></span></span><br />
<span style="font-size: small;"><span style="font-size: 13px;"><div>I am currently taking a break from coding the game. I have reached a point where my lack of artwork, sound FX, music is impacting development. In the new year my artist finishes her MA in animation and will commence providing me with concept designs and sprites to work with. So fear not! My commitment has not waned at all.<br />
</div><div><br />
</div><div>I realised that I needed some bite-sized programming projects to work on. I needed something fun and challenging to sink my teeth into. This is when I remembered the brilliant website <a href="http://projecteuler.net/">http://projecteuler.net</a>.<br />
</div><div><br />
</div><div>Project Euler is a website that contains a number of maths problems that can be solved via programming. So far I have solved 10 of the 267 problems. In doing so, it has reminded me how badly I suck at mathematics. Luckily I am focused and never give up until I have figured something out even if that takes me a lot longer than most.<br />
</div><div><br />
</div><div>Yesterday I solved problem 5.<br />
</div><div><br />
</div><blockquote>2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.<br />
</blockquote><blockquote>What is the smallest number that is evenly divisible by all of the numbers from 1 to 20?<br />
</blockquote><div><br />
</div><div>### SPOILER ALERT ###<br />
</div><div>I will now explain how I solved it using Python. If you don't want to know the answer and wish to solve it yourself stop reading now. Do come back when you have finished it just to compare notes though.<br />
</div><div><br />
</div><div>First we need to define a win condition.<br />
</div><div><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">def</span> <span style="color: blue;">checkFactors</span>(value, factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: lime;">"""Returns True if value is evenly divisible</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: lime;">by all numbers within factors.</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: lime;">"""</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>value == 0: ## Because 0 divided by any number in Python returns 0.</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return </span><span style="color: purple;">False</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">for </span>n <span style="color: orange;">in </span>factors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>value%n != 0:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return </span><span style="color: purple;">False</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">elif </span>value%n == 0:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">pass</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return </span><span style="color: purple;">True</span></span><br />
</div><div><br />
</div><div>All well and good, but we still need a way to pass <span style="font-family: 'Courier New', Courier, monospace;">value</span>s to the <span style="font-family: 'Courier New', Courier, monospace;">checkFactors</span> function until we find the correct answer. The first step we could take is a brute force approach as outlined below:<br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">def</span> <span style="color: blue;">bruteForce</span>(factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> answer = factors[-1]</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">while </span><span style="color: purple;">True</span>:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> divisible = []</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">for </span>number <span style="color: orange;">in </span>factors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>checkFactors(answer, factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return <span style="color: black;">answer</span></span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> answer += 1</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
</div><div>This technique works quite well for the example given in the problem. For the range 1-20 however it takes ages. I left it running, boiled the kettle, made coffee, had a chat with my girlfriend's dad about the paper and it still hadn't finished. Clearly there is room for improvement.<br />
</div><div><br />
</div><div>We can speed it up by increasing the variable <span style="font-family: 'Courier New', Courier, monospace;">answer</span> by the maximum value in factors each round of the loop. We know that the number we are looking for has to be divisible by 20. So we can eliminate the next 19 possible values straight away.<br />
</div><div><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">def</span> <span style="color: blue;">bruteForce</span>(factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> answer = 0</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> increase = factors[-1]</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">while </span><span style="color: purple;">True</span>:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>checkFactors(answer, factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return <span style="color: black;">answer</span></span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> answer += increase</span><br />
</div><div><br />
</div><div>I timed this method and it took Python just over 38 seconds on my dual-core laptop with 2GB of RAM. While 38 seconds falls within the one minute rule of Project Euler I still thought that there must be a faster way. Not only does the number we are looking for have to be divisible by 20, it also has to be divisible by 19 as well. 19 multiplied by 20 equals 380. So we can be even faster by increasing <span style="font-family: 'Courier New', Courier, monospace;">answer </span>by 380 on each iteration of the loop. We can amend the function like so:<br />
</div><div><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="font-family: Arial;"></span></span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><span style="font-family: Arial;"></span></span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><span style="font-family: Arial;"></span></span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><span style="font-family: Arial;"><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">def</span> <span style="color: blue;">bruteForce</span>(factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> answer = 0</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> increase = factors[-1] * factors[-2]</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">while </span><span style="color: purple;">True</span>:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>checkFactors(answer, factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return <span style="color: black;">answer</span></span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> answer += increase</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
</div></span></span><br />
</div><div>This time around it only took just under 2 seconds to produce the correct answer. However it occurred to me that for each iteration of the while loop the <span style="font-family: 'Courier New', Courier, monospace;">checkFactors</span> function has to iterate over 20 different values and that a lot of the checks are actually redundant, because some of the numbers in the range 1-20 are factors of other numbers already within the range. For example:<br />
</div><div><br />
</div><div>2 is a multiple of 20<br />
</div><div>4 is a multiple of 20<br />
</div><div>5 is a multiple of 20<br />
</div><div>10 is a multiple of 20<br />
</div><div><br />
</div><div>If the value being passed to <span style="font-family: 'Courier New', Courier, monospace;">checkFactors</span> is evenly divisible by 20 it is also evenly divisible by 2, 4, 5 or 10 so we don't need to check them. What we need is another function.<br />
</div><div><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">def </span><span style="color: blue;">findUniqueFactors</span>(factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> ufactors = <span style="color: purple;">list</span>(n <span style="color: orange;">for </span>n <span style="color: orange;">in </span>factors)</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">for </span>n1 <span style="color: orange;">in </span>factors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">for </span>n2 <span style="color: orange;">in </span>factors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>n1 == n2:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">pass</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">elif </span>n1%n2 == 0:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>n2 <span style="color: orange;">in </span>ufactors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> ufactors.remove(n2)</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return </span>ufactors</span><br />
</div><div><br />
</div><div>When we call this function with the variable twenty the ouput in the interpreter is the following.<br />
</div><div><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;">>>>twenty = <span style="color: purple;">range</span>(1,21)</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;">>>>uTwenty = findUniqueFactors(twenty)</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;">>>><span style="color: orange;">print</span> uTwenty</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: blue;">[11, 12, 13, 14, 15, 16, 17, 18, 19, 20]</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;">>>><span style="color: purple;">len</span>(uTwenty)</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: blue;">10</span></span><br />
</div><div><br />
</div><div>That means we have halved the number of values we need to check for each loop. So, lets put it all together!<br />
</div><div><br />
</div><div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">def</span> <span style="color: blue;">checkFactors</span>(value, factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: lime;">"""Returns True if value is evenly divisible</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: lime;">by all numbers within factors.</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: lime;">"""</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>value == 0: ## Because 0 divided by any number in Python returns 0.</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return </span><span style="color: purple;">False</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">for </span>n <span style="color: orange;">in </span>factors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>value%n != 0:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return </span><span style="color: purple;">False</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">elif </span>value%n == 0:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">pass</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return </span><span style="color: purple;">True</span></span><br />
</div><div><span style="color: purple; font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
</div></div><div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">def</span> <span style="color: blue;">bruteForce</span>(factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> answer = 0</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> increase = factors[-1] * factors[-2]</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">while </span><span style="color: purple;">True</span>:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>checkFactors(answer, factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return <span style="color: black;">answer</span></span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> answer += increase</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
</div></div><div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">def </span><span style="color: blue;">findUniqueFactors</span>(factors):</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> ufactors = <span style="color: purple;">list</span>(n <span style="color: orange;">for </span>n <span style="color: orange;">in </span>factors)</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">for </span>n1 <span style="color: orange;">in </span>factors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">for </span>n2 <span style="color: orange;">in </span>factors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>n1 == n2:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">pass</span></span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">elif </span>n1%n2 == 0:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">if </span>n2 <span style="color: orange;">in </span>ufactors:</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> ufactors.remove(n2)</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"> <span style="color: orange;">return </span>ufactors</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><br />
</span><br />
</div></div><div><span style="font-family: 'Courier New', Courier, monospace;">twenty = <span style="color: purple;">range</span>(1,21)</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;">answer = bruteForce(findUniqueFactors(twenty))</span><br />
</div><div><span style="font-family: 'Courier New', Courier, monospace;"><span style="color: orange;">print </span>answer</span><br />
</div><div><br />
</div><div>When I timed this final version, Python found the correct answer in about half a second! While there still exist faster methods. I am more than happy to move on to the next challenge.<br />
</div></span></span><br />
<div><span style="color: orange; font-family: 'Courier New', Courier, monospace;"><br />
<br />
</span><br />
</div>Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com2tag:blogger.com,1999:blog-1716503619627840324.post-46304025414955724332009-10-30T14:04:00.001+00:002010-01-13T01:08:27.833+00:00Behold, the plasma cannon mark 2New this time around;<br />
<br />
-- Options can fire in both left and right directions.<br />
-- Particle effect when enemies are hit.<br />
-- Even bigger particle effect when they die.<br />
-- The plasma cannon has been reimplemented as a beam weapon.<br />
<br />
<object height="344" width="425"><param name="movie" value="http://www.youtube.com/v/CuvZjIOY7p4&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/CuvZjIOY7p4&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com0tag:blogger.com,1999:blog-1716503619627840324.post-1137618370328736312009-10-21T21:04:00.000+01:002009-10-21T21:04:41.861+01:00I want more options....and a PLASMA WAVE CANNON!Despite there being no update for a while I have not forgotten this project.<br />
<br />
Here is a vid of my latest endeavours.<br />
<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/1ArkiT08Yew&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/1ArkiT08Yew&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<br />
New this time around:<br />
- Bit Mask for pixel perfect collisions<br />
- Enemies can fire<br />
- Player can die<br />
- More power ups.<br />
- The plasma wave cannon<br />
- Two escort options that can shoot and remove enemy bullets.Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com0tag:blogger.com,1999:blog-1716503619627840324.post-4618785746942100372009-10-05T19:55:00.000+01:002009-10-05T19:55:56.992+01:00Bigger and better guns!As promised an update. A combination of Cam Studio and Youtube has absolutely destroyed the quality. The starfield looks tonnes better on my laptop.<br />
<br />
Vid 1 - Better weapons for the player.<br />
<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/5Dgzrh-RXkM&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/5Dgzrh-RXkM&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br />
<br />
Vid2 - Collectable powerups.<br />
<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/44W3z5lU8rI&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/44W3z5lU8rI&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com0tag:blogger.com,1999:blog-1716503619627840324.post-83483242483191031532009-10-05T17:33:00.001+01:002009-10-05T17:33:03.556+01:00USB broadband dongles SUCK!I currently have at least two videos to upload, but I am unable to because of my crappy connection. As soon as I get near a real broadband connection I will be uploading and updating on here.Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com0tag:blogger.com,1999:blog-1716503619627840324.post-82849997793007664772009-09-22T05:33:00.000+01:002009-09-22T05:33:29.958+01:00Animated SpriteAnother step in the right direction!!!!<br />
<br />
An animated sprite! Obviously my animation skills are very very crude. However my girlfriend is doing the final year of her Masters in Animation. I can sense a <i>"Honey, can you help me please. Pretty pretty please!"</i> coming on! ;-)<br />
<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/RblDUJ7zk_Y&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/RblDUJ7zk_Y&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com0tag:blogger.com,1999:blog-1716503619627840324.post-3323368161084385572009-09-17T06:33:00.000+01:002009-09-17T06:33:19.002+01:00What good are guns if there is nothing to shoot?Did a little work on the collison detection for my side scrolling shooter. The code is not perfect yet, but it is another step in the right direction.<br />
<br />
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/00g9l2xJ6ao&hl=en&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/00g9l2xJ6ao&hl=en&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com0tag:blogger.com,1999:blog-1716503619627840324.post-52654243967782802822009-09-15T14:42:00.001+01:002009-09-15T14:44:09.788+01:00I want to shoot!Here we have my next tiny milestone. A sprite that can shoot!<br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/PPC0-bR-TP4&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/PPC0-bR-TP4&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>Big Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com0tag:blogger.com,1999:blog-1716503619627840324.post-74134218224467694452009-09-15T03:44:00.002+01:002009-09-15T03:56:50.461+01:002D Scrolling Shooter - PygameHere is a quick clip of me tinkering with pygame and parallax scrolling...<br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/mVdMCNE_8xA&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/mVdMCNE_8xA&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><br />...and here we have something similar to the video above but with a movable sprite! <br /><br /><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/5iqmTNyefkQ&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/5iqmTNyefkQ&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object><br /><br />I will be posting more videos as development moves along. I intend to tinker away trying to implement a single feature at a time in a test script. At least until I feel comfortable that I have the knowledge to glue it all together and make a shooter I can be proud of and is hopefully fun to play.<br /><br />The scope of what can be done is daunting. For example...<br />- Collision detection<br />- Power Ups<br />- Multi Player<br />- Boss Fights<br />- Enemy A.I.<br />- Environments<br />- Port to XNA? iPhone? <--- LOL even if I knew how I wouldn't make an app for iPhone.<br /><br />I'm not promising that I will implement anything into a final product, I am a hobbyist and don't code for a living after all, but I am going to try. Watch this space!<br /><br />Until next time...<br /><br />Peace<br /><br />Big GrizzleBig Grizzlehttp://www.blogger.com/profile/17037050219618621698noreply@blogger.com1