Ben James :: adventures in gaming

100101.org

15
Jun

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.

Leave a Reply

Powered by Wordpress 2YI.NET Web Directory