Archive for June, 2007

June 29th, 2007

by Ben

Collision Detection Still Hurts My Brain

function liveJournal()
{
var listeningTo = new Band("killswitch engage");
var mood = "frustrated";
}

Game programming would be so much easier if it weren't for all the damned maths. What frustrates me is I've dealt with this exact same problem before, but my brain's just not in the right place to think about it, no matter how hard I might try.

I've moved away from my Tower Defense style game for the moment to try to put together an entry for a contest I found on the NewGrounds BBS, it's pretty much a derivation of Joust, but with some kiddy graphics and a bit of educational value (which are requirements for the contest). My brain is having difficult working through simple bounding box collisions at the moment though, so I'm not working on it any more tonight.

Sorry, I should say the collisions part isn't what I'm having difficulty with, because MovieClip.hitTest does that for me, it's what to do with each object after a collision is detected. I pretty much just want to do a projection and move the character so it's not overlapping the level object anymore, but that's complicated by the fact that what I'm actually doing the detection against are sub-clips of each object, so the different co-ordinate systems come into play.

It's probably not actually that difficult a problem, but I've been wrestling with it all evening trying to get my head around it, and I'm just not there. (This is why I failed my Maths course at Uni the first time)

 

June 22nd, 2007

by Ben

The 40 Year Old Knocked Up Undeclared Geek

I was excited to go to a special Q & A preview session of Knocked Up last night, thanks to Village Movie Club; I loved The 40 Year Old Virgin, and we've just recently watched all of Freaks And Geeks and Undeclared, so I'm throwing around a lot of Judd Apatow love. Unfortunately, the Q & A session turned out to be a nervous cinema employee asking lame generic questions of Judd, Seth Rogen and Paul Rudd with no audience participation. Lame.

The movie, however, was not lame. The opposite of lame. Hilarious. Very much on par with The 40 Year Old Virgin, if not better, so I'm glad we got to see it a couple of weeks early. Seth Rogen seems like the guy I could hang out and play video games with (I wonder what his GamerTag is...)

 

June 18th, 2007

by Ben

ActionScript 3.0, away!

I'm pretty much back to where I was before I started the upgrade to ActionScript 3.0, with a greater knowledge of Flash in general and ActionScript in particular, which feels good. Now I can really start getting into the meat of the gameplay.

The thread I posted yesterday had quite a few useful tidbits, two of which spring to mind as not being necessarily obvious (at least, they were things I overlooked):

  • All classes need to go within a package {} block
  • Don't forget to put 'public' at the start of your classes, or you'll get an error
  • Event handling functions require an Event object parameter

Just a few things that tripped me up, so hopefully anybody reading this and looking into ActionScript 3 won't spend too long trying to figure out what their problem is.

 

June 17th, 2007

by Ben

*lightbulb slightly dims*

It would seem that in Flash CS3 I can only bind MovieClips to a separate class file if I'm using ActionScript 3, and that means changing a whole bunch of stuff that I learnt from the inital tutorials I went through. So I've got a bit of reading to do to figure out what needs to be changed and how I should be putting my game together.

So far, this article has been extremely helpful, and I'm going to read through most of the tips on this thread over the next couple of days.

ActionScript 3 seems like it's put together quite well and much less of a hack job than AS1 and AS2, so I'm not unhappy about having to port my code across; I'm also kind of glad I started in AS2 because the syntax and structure is a lot more forgiving, so it was a good way to learn the basics of Flash. Fun and games!

 

June 17th, 2007

by Ben

Aha! *lightbulb*

So I finally found a flash tutorial that explained how the object stuff works and how it relates to MovieClips within the interface, so I can step back and design my game a bit better. I'm at that stage in development where it's kind of daunting to have to redo what I've already done though, so I'm going to sleep on it and give it a go in the morning, try to plan it out to some degree. (But not too much, because that's usually where I got bogged down and give up)

 

June 15th, 2007

by Ben

Later that night…

A few hours of programming later, and I've solved a few problems and hit a few more.

Firstly, I solved the problem of the ghost turret catching the clicks by doing something similar to what I proposed earlier: I created a blank GameArea symbol, and placed it's depth higher than the ghost turret's depth via Actionscript. I hit a small snag when I did this though, as when I actually placed the turret it was then lower than the GameArea and could not catch it's own clicks, which I wanted it to be able to do. (Otherwise I'd be trying to feed clicks down again, messy) To fix that I just set a minimum depth higher than that of the GameArea AND the ghost turrets, and it's all good.

A small diagram to demonstrate, in case you're confused (wouldn't surprise me, I don't think I explained that very well):

Depth: 100 ------ Turrets get placed above this depth
Depth : 50 ------ GameArea catching clicks
Depth : 49 ------ Ghost turrets to show placement
Depth : 48 ------ Background and other bits below here

I have no idea whether that's how it's usually done, but it feels OK to me and seems to work, so there you go. If you have a better way that I could do it, feel free to comment.

It's been fairly smooth from there, though I'm finding myself creating a bit of redundant code due to not fully understanding how the inheritance and polymorphism works within this language. Can I extend a MovieClip I have created, so that I can have generic functions that act upon the child classes variables? What happens to the timelines and graphics if I can? If anybody can explain this to me, please do so :-)

Anyway, I've had enough for tonight, I'll try to keep this blogging up as I proceed with my development.

 

June 15th, 2007

by Ben

Broken Theme

Great, my theme has broken because I've got too many items in that sidebar. I'm getting kind of sick of this one anyway, I think I might have a play and come up with something new.

Hrmm, my XNA links are quite outdated too. Revamp time.

 

June 15th, 2007

by Ben

Flash Programming, Rock Band, Witty Title

I've started playing around with Flash to try to develop a game idea I've had for a while, it's a Tower Defense type of game (groan, I know, bandwagon) but I've got a few different ideas up my sleeve so we'll see how it goes.

Dad convinced me that I should start blogging my experiences as I go, since this is the first time I've looked at Flash and Actionscript and it might be useful for others to see how I go about solving problems. I've read enough tutorials to know the basics I think, how media clips and their timelines work and what each piece of ActionScript I write actually applies to.

So anyway, the problem I have at this point of development is that I'm still not quite sure how the depth of movie clips within flash interact with clicks coming in. Specifically, I've got a transparent turret 'ghost' that follows my mouse around, showing where the turret is going to go if you place it (typical RTS mechanic), but when I try to click to place the turret onto the game area, the ghost turret blocks the click.

My first instinct was that there would be a way to make a movie clip transparent to clicks, but there doesn't seem to be anything. I had the brief thought that I'd let the ghost catch the clicks and pass them to the game area, but that would get messy. I think what I'll try is placing a movie clip over the top of the game area, make it invisible but collect the clicks with that, and then it can handle anything that needs to happen based on those clicks. I'll let you know how it goes.

In Guitar Hero and Harmonix related news, a whole bunch of Rock Band details just went up on Destructoid, and it's getting me quite excited. I'm now not sure whether I want to buy GH3 with the guitar (which I thought I might after it's details got released, plus it's wireless), or get the guitar version of Rock Band and buy a cheap USB microphone so I can play the guitar and vocals campaigns. Then there's the drums, which sound really fun but will probably be the most expensive of the bunch; I'm going to have some saving to do I think.

 

June 7th, 2007

by Ben

Winter is here…

...and it's made it a lot harder to get out of bed in the mornings. I've still been managing to do a bit of work on all my projects though, despite all the games I have to play and comics I have to read and TV shows I have to watch. I'd be able to get so much more done if it weren't for work and sleep.

Trevor and I have started messing around with AGS and are working on a Kurodust adventure game (the beat 'em up is still coming, eventually), which has been fun. My spriting skills are improving so I'm hoping the graphics won't turn out too bad, and we've been able to come up with some funny ideas for puzzles and storylines.

Speaking of Kurodust, we finally had another band practise! After 2 years Jay, Rob and I, with the new addition of Trevor, are back together as a band, and with a gig booked at the end of August (Jay's brother's 25th) we'll be working hard to remember how to play our old songs and hopefully will even have time for something new!

I've had another couple of ideas for small games I may want to try in future, either in XNA or flash. No idea when I'll get onto those though.

And through all this I managed to 5 star all of Hard Mode in Guitar Hero 2! Bring on Expert and Guitar Hero 3! (which is looking cool)

 

NAVIGATION

Home

Biography

Contact

Albums

Containment Failure

Live at the Starks '07

Reinitialise

Post Archives

Friends

All images, text and music on this page are licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 2.5 Australia License.