The Homepage of Daniel Hollands: Web Development Graduate!
13 Mar 2009
For my Independent Study at university I’m going to be working on an idea that I’ve had for a few years now.
It’s not a totally unique idea, as my inspiration was an old CGI script that had the same basic functionality, only my plan is to expand on the concept and make it all that it can be. It’s also not the first time that I’ve actually built and published an edition of the idea, but hopefully will be the first time I succeed in making it everything I want it to be.
The idea is that of an interactive fiction site called UnknownTales.net.
So what is interactive fiction? It’s the ability to control the direction of the story that you’re reading!
It’s very much like the classic read your own adventure and Fighting Fantasy game books. You start by choosing the book that you’re interested in, then read the first chapter. At the end of the chapter you’ll often be given a choice between different routes available to follow. You choose the route of most interest, turn to the chapter number indicated, then continue reading, repeating the process of choosing your route as and when it is presented to you.
This is a fantastic way of being able to read the same book several times, with a different story each time you read. Only a lot of the time you’ll find that the general story arc remains the same, and that different routes ultimately end up at the same place.
UnknownTales.net will be an evolution on this concept. You start by reading the first chapter, at the end of which you’ll be presented with a pre-determined number of different paths that can be followed. Upon choosing the path of most interest, the next chapter will be presented, along with more paths to choose from. Unlike the game book stories, which will link back into the main story arc, each path available at the end of each chapter will take you to a totally new chapter which is inaccessible via any other route than the one you’ve just taken.
Cool right? But that’s only the first level of interactivity. The second level is discovered once you find a chapter that hasn’t been added to the story yet. This is where the system shines at it’s brightest, as it provides you – the reader – the ability to write your own chapter for the story.
Although initially I was planning on building this site just for the sake of building it, since starting at university I’ve discovered I have an interest in web site usability. That is, making sure that web site interfaces are as intuitive as possible, so that the users of the site instinctively know how to use it without needing to think. Due to this I’m going to be taking a keen interest in the usability aspects of the site, and conduct various studies and tests to make sure that the site is as good, and usable, as possible.
Anyway, although I’ve started planning some parts of the project, I’m not going to get started until the summer, so until then, keep an eye on the blog for updates about the project, and let me know if you’re interested in helping out at all – I’m going to need creative people to help start the stories.
11 Mar 2009
I would just like to take a moment to thank Google for providing a fantastic service. Why am I thanking them? Because I’ve just set-up a direct synchronisation between my Windows Mobile phone and my Google account.
Up until now, I had been syncing my phone with Outlook, which would then sync with my Google calendar – and this works, all except for the fact that it required two different sync-systems to work (doubling the chance that something could go wrong – which it did), and that it didn’t sync my contacts.
Now, thanks to Google being awesome, I’m able to sync my phone with my Google account directly – over the air – without the need for the Outlook middleman – not only that, but it also syncs my contacts as well.
There are some issues with it, such as my phone’s instanstance on making single name contacts (i.e. Amy) their surname, but these are minor problems. My ultimate aim is to get a T-Mobile G1, but this will have to wait until my current phone contact expires.
In other news, I’m meant to be working on the assignment that’s due in tomorrow – but instead I’m installing Windows Se7en beta on one of my laptops.
10 Mar 2009
Although I’ve never created any XML code myself, I already have an understanding of what it is, and the structural rules that need to be followed for it to be valid. Popular types of XML include XHTML and RSS feeds, technologies which have used it to it’s full potential.
I’ve also experienced environments where XML was used to translate data from an Access database to that of an MySQL one, with the former creating XML documents, containing the relevant data, which a PHP script then translating this data into SQL queries for loading into the latter.
Whenever I look at XML, it always feels like a multi-dimensional array. I use these on occasion when programming PHP and often think that should I ever need to export the data contained within the array, XML would be a good way to do it – but so far have never needed to.
I’ve blitzed though the XML tutorial at Tizag as most of it’s content was very basic, but now I’ve reached the part on XSLT, I’m going to slow down and pay closer attention.
8 Mar 2009
Presenting Hunter 2
This should be a huge improvement over Hunter, in both game play and graphics.
The game play now requires that you click to shoot the enemy, rather than just hover over it like in the previous game, which works fine, apart from the fact that in order for the click to register as a hit, the cross-hair graphic ends up behind the enemy, rather than on top. I also built in a function that makes this site load when you click on the logo in the bottom right corner – but the same issue that causes a problem with the cross-hair and monster, means that this feature also doesn’t work.
I’m going to work on Hunter 3 today, and hopefully by the end of the week it should be finished. This should provide some additional improvements over that of Hunter 2 by including features such as limited ammo, with the ability to reload, a sound when the gun is fired, a gradual fading in of the monster when it reappears, an explosion to indicate that the monster has been hit, and a working link back to the homepage. It should also be more modular as I start to explore some of the OO aspects of ActionScript.
Before I post the code for this game, I would like to very much thank Sofi for providing the graphics and concept for the night vision, one which I think works fantastically well. Anyway, here is the code.
// hide the mouse
Mouse.hide();
var link:URLRequest = new URLRequest("http://www.theworldofdan.co.uk/");
/* functions */
// generates a random number
function randomBetween(a:Number, b:Number):Number
{
return (a + Math.floor(Math.random()*(b-a+1)));
}
function shootPrey(event:MouseEvent):void
{
// trace("Hit");
prey_mc.x = randomBetween(50, 500);
prey_mc.y = randomBetween(50, 350);
score = score+1000;
scoreBoard.text = score.toString();
}
// hunter movement
function moveHunter(event:Event)
{
hunter_mc.x = mouseX-30;
hunter_mc.y = mouseY-30;
}
// load homepage
function loadHomepage(event:Event)
{
navigateToURL(link);
}
/* main code */
// move prey
prey_mc.x = randomBetween(50, 500);
prey_mc.y = randomBetween(50, 350);
// load score
var score:Number = new Number();
score = 0;
scoreBoard.text = score.toString();
/* listeners */
hunter_mc.addEventListener(Event.ENTER_FRAME, moveHunter);
prey_mc.addEventListener(MouseEvent.CLICK, shootPrey);
logo_mc.addEventListener(MouseEvent.CLICK, loadHomepage);
6 Mar 2009
Here it is, my second published Flash production
It’s not finished yet, as I still need to do things like make a score count only when clicked (like shooting a gun), then add things like ammo and the ability to reload, enemies to avoid, and then make the sprites more interesting (like a crosshair for the hunter, and some random monsters for the prey), but I’m proud of what I have so far.
Once again, here is the code used to make it.
// import classes
import flash.display.Sprite;
import flash.events.MouseEvent;
Mouse.hide();
/* functions */
// generates a random number
function randomBetween(a:Number, b:Number):Number {
return (a + Math.floor(Math.random()*(b-a+1)));
}
// hunter movement
function pullHunter(event:Event)
{
hunter.x = mouseX;
hunter.y = mouseY;
}
// checks if hunter hits prey
function checkHit(event:Event)
{
if (hunter.hitTestObject(prey))
{
prey.x = randomBetween(20, 530);
prey.y = randomBetween(20, 380);
score++;
scoreBoard.text = score.toString();
}
}
/* load objects */
// load prey object
var prey:Sprite = new Sprite();
prey.graphics.beginFill(0xffffff);
prey.graphics.drawCircle(0,0,20);
// move to random location
prey.x = randomBetween(20, 530);
prey.y = randomBetween(20, 380);
addChild(prey);
// load hunter object
var hunter:Sprite = new Sprite();
hunter.graphics.beginFill(0xFF0000);
hunter.graphics.drawCircle(0,0,10);
addChild(hunter);
// load scoreboard object
//var scoreBoard:TextField = new TextField();
//addChild(scoreBoard);
// load score
var score:Number = new Number();
score = 0;
scoreBoard.text = score.toString();
/* listners */
addEventListener(Event.ENTER_FRAME, pullHunter);
addEventListener(Event.ENTER_FRAME, checkHit);
5 Mar 2009
I found this online and wanted to share it.
Through my Twitter account, fellow Twitterites and myself have created the ultimate web developer/action movie.
It’s called Position:Absolute. It’s about z-index, played by Sylvester Stallone, a web developer who gets fired for supporting other browsers besides IE. The villain of the story would be Strikethrough, played by Jeremy Irons, who stole z-index’s code, had him fired and forced the entire web department to only support IE. Strikethrough’s sidekick Scope Creep would be played by Jack Black. Mos Def would be the token #000000 guy, named mos:def;. And Alyson Hannigan would play the spunky love interest of the story named Fire Fox.
This is also open to be part of a trilogy with Position: Fixed being the second part where z-index has been commissioned by FBI to stop a bunch of IE hacks (z-index’s FBI agent point of contact with would be played by Samual L. Jackson) and the final chapter, Position: Relative, would be about z-index’s son having to clear his dad’s name after he is wrongfully imprisoned.
Also, all the web development transition scenes would look like the hacking scenes from Hackers.
“This summer, Stallone is going to paint the town #FF0000! Rated R for violence and pwnage.”
This is pure Action-Blockbuster-Gold. I just have to wait for Hollywood to come calling.
4 Mar 2009
OK, so I realise that no one reads this blog (apart from Sue – who has to because of her job, hi Sue), but I figure I might try and do a bit more with it, and make it work for me.
I really like the idea of blogging everything I learn, the technique we use in the Advanced Web Design module, as it provides a useful place for reflection, in addition to a resource for the future, both to myself, and anyone else who might stumble upon it. Because of this, I want to extend this blog’s role to include posts about another one of my modules: Advanced Multimedia Scripting.
This module uses Flash – or more specifically ActionScript 3.0 – to teach scripting concepts, and as it’s a fairly hands on module, we normally end up building one or two examples of what we’ve just learnt after each session.
Up until now, there hasn’t been much of interest to share as we have been dealing with simple programming constructs such as conditional selection and loops, with nothing more than a traced output to show that our script was working, but this week we started to get to the juicy stuff, allowing me to actually build something fun.
So here it is, my first published Flash production.
It’s a snowman – or at least, an unfinished snowman.
It might not look like much (and to be honest with you, it probably isn’t much), but this was built using nothing but ActionScript code. I should go on to finish it: add some arms, maybe a mouth, etc. but I’d rather just skip to the next task – to make a simple hunter game.
I’ll get that uploaded as soon as I’ve finished it, but until then, enjoy the snowman.
In case anyone was interested, here is the code I used to make the Snowman.
var bgFrame:Shape = new Shape(); bgFrame.graphics.lineStyle(6, 0x000000); bgFrame.graphics.beginFill(0x00ff00); bgFrame.graphics.drawRect(20, 20, 500, 350); bgFrame.graphics.endFill(); addChild(bgFrame); var body:Shape = new Shape(); body.graphics.lineStyle(3, 0x555555); body.graphics.beginFill(0xeeeeee); body.graphics.drawEllipse(190, 120, 170, 240); body.graphics.endFill(); addChild(body); var head:Shape = new Shape(); head.graphics.lineStyle(3, 0x555555); head.graphics.beginFill(0xeeeeee); head.graphics.drawCircle(275, 120, 50); head.graphics.endFill(); addChild(head); var eye1:Shape = new Shape(); eye1.graphics.lineStyle(3, 0x000000); eye1.graphics.beginFill(0x111111); eye1.graphics.drawCircle(250, 110, 3); eye1.graphics.endFill(); addChild(eye1); var eye2:Shape = new Shape(); eye2.graphics.lineStyle(3, 0x000000); eye2.graphics.beginFill(0x111111); eye2.graphics.drawCircle(280, 110, 3); eye2.graphics.endFill(); addChild(eye2); var nose:Shape = new Shape(); nose.graphics.lineStyle(3, 0xFF6600); nose.graphics.beginFill(0xFF6600); nose.graphics.moveTo(265, 130); nose.graphics.lineTo(275, 140); nose.graphics.lineTo(255, 140); nose.graphics.lineTo(265, 130); addChild(nose);