The World of Dan

The Homepage of Daniel Hollands: Web Development Graduate!

Archive for the ‘(COMP3133) Advanced Multimedia Scripting’ Category

Wish me luck, it’s due in today

As I type, the report which is due to accompany my ActionScript 3.0 code and application, is being printed. I did print it out yesterday, but have since found some extra bits to talk about in the report, so after spending the past two hours adding them, It’ll now soon be read to hand in.

This is possibly the largest assignment I’ve ever handed in, weighing in at over 70 pages (poor trees). The report itself is only 17 pages long, the rest is made up of printouts of the code listings, the UML diagram, a test plan & log, and a statechart. Along with the report is a CD containing the source code and application.

I was going to hold off on publishing the game until it had been marked, but I’ve decided that it should not cause any harm releasing it now, so feast your eyes below for some tasty gaming action. (more…)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

I’ve had a change of heart

It’s just over a week until my Flash assignment is due in, and I’ve changed my mind again. Don’t worry, hopefully it’s a change for the better.

The original idea for the project was to build four or five different mini-games, each one demonstrating a different type of game play, to cover all of the requirements for the assignment. I’ve now ‘finished’ two of the games, and was just about to start planning the next one when I decided to review the requirements – and discovered that what I’ve already developed pretty much cover everything I need!

So what do I do? Build the games anyway? I could do that, but even though the game play will be different, the mechanics behind each game would be very similar, and won’t demonstrate anything more advanced. Wrap it all up and call it a day? No, that would be too easy. I’m very much aiming for as good a grade as I can: A or bust! (more…)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

My Multimedia Scripting assignment is due in two weeks, which should be plenty of time to finish it! Or at least would be, if it wasn’t for an Oracle assignment due in a week, and the fact that I’ve just started the project again from scratch!

Why am I starting again? Well, the way I look at it, the previous editions of the game were all just practice editions, designed to help me understand ActionScript 3.0 and what it’s capable of. Unfortunately, due to the trial and error method of development, i.e. trying new things and hoping they work, I’ve ended up with something which works, but is very confusing to navigate though the code and understand, which could result in a poor grade.

As a large part of the assignment is based around OOP principles, and “cohesive object design”, I need to make sure that everything makes logical sense. As a result of this, I’ve spend most of the past two days using UML to design and plan out my classes and how they all fit together. (more…)

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Assignment status: 40%

Sorry for the fact there hasn’t been an update for a while, but I’ve been spending the best part of the past week working on my assignment. I would love to show you what I’ve done so far, but it’s far from complete (about 60% away – or 160% based on the Pareto principle), and I’m not planning on releasing it to the public until it’s been submitted and marked.

So far I’ve built a simple game where you have to run around a dungeon collecting bags as they fall from the sky, in addition to the basic functionality of a second game, where you have to bounce people and bags, who jump out of a tower’s window, across the floor to safety. Sounds weird huh?

The last two games involve throwing items over a wall, and jumping across platforms. I might add a fifth RPG style game, but that depends on how well I get on with the rest, and if they cover the criteria I need for the assignment.

Although I can’t show you the game, I can show you it’s characters:

Suitman Woman Dude

Created by Sofi, who is creating all the graphics I’m using for this game, they’re named, left to right, Suitman, Woman and Dude.

Anyway, the assignment is due in on the 18th May, over a month away, so I should have plenty of time to get the project finished, I just need to try and find time for my other three assignments.

UPDATE: Whoops, I almost forgot, very big thank you to Fruitloop for all the help he has been giving me.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Air Raid and Shape Invaders

Another day (or two), another tutorial complete.

This game is based around the idea of an Air Raid, using an anti-aircraft gun to shoot planes out of the sky as they pass over.

Air Raid

When I found this tutorial in the book, I was looking forward to completing it so I could compare it with my own efforts to build a similar game.

Shape Invaders

Vastly different as I’m sure you’ll agree. Nope, don’t expect any more large circles to appear, there is only one, once it’s gone, it’s gone.

Although basic, however, I do feel that my attempt was quite good, and had I decided to work upon it more, I could have got something far better with multiple enemies, etc. I’m glad I didn’t attempt to finish it as I’ve now discovered that I was not doing as well as I could have, and have learnt a lot about how ActionScript works thanks to the tutorial.

Next tutorial is creating a paddle game similar to Breakout – but before I do that (after a couple hours playing Alone in the Dark and chilling out), I’m going to attempt to make a ball roll. Sounds easy right? We’ll see.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Memory Game – it’s finished!!

Just a short post this time to show the finished edition of the memory game. This edition now features a card-flipping animation, along with sounds when the cards are flipped, and a 2 second time limit on how long two incorrectly matched cards should remain before flipping back over. I’ve also fixed a bug/feature which allowed you to flip a card back over if it was the first one selected – I could have removed this functionality, but decided to set a penalty of 5 points instead, the same penalty you get for an incorrect match.

Anyway, here it is:

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Memory Game

It’s been a while since I posted anything on this blog – and I know that no one is reading it, so I’m not sure why I need to – but I figured it was time to post something fresh.

The next two weeks are Easter, which means no lectures, lots of chocolate eggs, and apart from two trips into Birmingham – lots of sodding work!!! The majority of this work is going to be learning ActionScript, which I’m quite looking forward to, but also a bit of database which I’d be more than happy to forget.

Anyway, to give myself a head start I’ve been reading a book on game programming in Flash by Gary Rosenzweig. It’s the book our tutor uses, so I figured it would be a good place to start. As a result of this, I’ve been able to produce a very simple memory game. I can’t claim any credit for it as I’ve just been following the tutorial, which means I also can’t share the source code with you, but as it’s part of my journey to becoming an ActionScript programmer, I figured I should post an example here now.

It’s not finished yet as I need to code in the effect of flipping the card, as well as a few other things, but I’m running out of time to work on it today, and figured this was as good a place as any to show and tell.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Hunter 2

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);
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Hunter game – so far…

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);
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Make a snowman – in a Flash

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.

Update

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);
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Latest Tweets

  • @cosryan Bad day? - posted 22 hours ago
  • I think we got the best of a bad lot for #eurovision . Josh had a good voice, but it's a crap song and we don't stand a chance. - posted 3 days ago
  • Britain has just been rickrolled by the BBC. #eurovision - posted 4 days ago
  • Sat in costa after a long day at work, enjoying a coffee. Very soon this shall be my local costa :) - posted 4 days ago
  • @nelfaciel Pfft... girls - is that all you think of? - posted 4 days ago
  • The Evesham <--> Worcester trains are useless. I'm so glad to no longer need them soon. - posted 5 days ago
  • @nelfaciel Xbox, but it belongs to Sofi, so when I move at the end of the month, I'll have to get my own copy, which might be for the PS3. - posted 5 days ago
  • @TomCampbell @cosryan No one bums my man!! - posted 5 days ago
  • @nelfaciel From what I've seen so far, when you get to a save point, you can access shops from there. Not played enough to really know yet. - posted 5 days ago
  • @nelfaciel Are you playing FF13? What do you think of it? I've played the first chapter, but don't have much time these days. - posted 5 days ago
  • Hopefully, before the end of the month, I'll have a new - HUGE - flat in Evesham! Should make getting to work each morning much easier! - posted 5 days ago
  • Support Xbox 360, add a #twibbon to your avatar now! - http://bit.ly/1VaWAI - posted 2 weeks ago
  • http://twitpic.com/167bhm - Sat in a park enjoying the sun for lunch. I only wish I didn't feel so shit. - posted 2 weeks ago
  • @nelfaciel We've got some water here... come and get as much as you want :) - posted 2 weeks ago
  • Does this count as a googlewhack? http://tr.im/QeM8 - posted 2 weeks ago
  • Follow @ukgamedeals and retweet this for a chance to win an FFXIII Super Elite Xbox 360! - http://bit.ly/9QT3Pe - posted 2 weeks ago
Follow me

Calendar

March 2010
MTWTFSS
« Feb  
1234567
891011121314
15161718192021
22232425262728
293031