Before I start my adventure in coding, I just wanted to present how I'm going about the inner workings of the game. I know there are a lot of good flash developers here and I just want to see if what I'm thinking will make sense. Again, bear with me as I'm still new to Flash game development. Here is the initial basic structure of the game, where I just stack all the elements and make the appropriate object visible when it's needed:
I realized.. after I made these images that I may not need to pool the objects off stage, that I could possibly have all objects on the stage at once and just have a certain number of them visible per map. The game has to run smooth with the max number of people objects scrolling across the stage anyway.
For smoothly passing the briefcase, the following images are self explanatory:
Again, in the first image, just ignore the object pool area. It just shows path and layout for all objects. The people objects for the most part won't pass directly through objects... other than the odd bench or large object that may span across path lines. Also, the image shows what I meant by smooth swapping.
As long as the 2 people objects are aligned either by X or Y, when the briefcase object disappears from one and attaches to the other, it should be barely noticeable... as in you're not going to see the briefcase continually disappearing and then jumping large distances.
I don't know how accurate Flash is though for detecting if the X or Y of 2 objects match perfectly on a single frame. My brain had a 503 error or something... since the object paths are on angles.. I think as long as the x and y coordinates of both are within 20 pixels - should work fine.To explain the second image... I'm using an "no one and everyone is a spy" approach. Instead of the game having to keep track of which people object instance is the spy, the briefcase object can be attached to any instance. As long as it is the briefcase object that gets clicked on (shot)... the "spy" is shot.
So as I said in the first post, I may have some difficulty with certain things in the game which could be ridiculously simple to other more experienced developers.
1. Here is my thought on how to advance levels:
Use a simple spyShot counter:
if(spy has been shot){spyShot++;}
if(spyShot == 0){Map1: Level 1}
if(spyShot == 1){Map1: Level 2}
etc. etc.
Swapping the briefcase is something else I may have problems with, but of course I should code first before even thinking this is going to be a problem. Still, I want to see what opinions are.
There's 5 subclasses of the people object class. Example: Business Man is one of the 5 subclasses. For map 1 only 25% of the Business Man instances are visible and able to swap briefcase. Map 2 = 50% instances, etc.
if(Map == 2){Business Man instances 6-10 are visible}
Every single people object can carry the briefcase, however they can only pass on to certain instances of other people classes (basically to a select few of the ones travelling in the other 3 directions). Example (for just passing on to 1 instance):
if(this._x == _root.punkKid3._x || this._y == _root.punkKid3._y)
edit: within 20 pixels, not aligned.
{
if(_root.punkKid3._visible == true)
{
passBriefCase();
}
}
So just to clear any confusion, groups of people objects travel in 4 directions. No object can turn or change directions... some will walk through things such as large objects. They will all walk through or pass other people objects. When they move off stage, they are transported back to their starting point on the other side of the stage and just continually scroll across the screen.
The last thing I'm wondering about is about swapping depths with prop objects in a map. I don't know yet if a map needs to be a complete object with prop objects nested inside. If so, is it tricky to swap depths with nested objects? Or is it just as simple as:
if(this._y >= _root.Map1.bush7_y){swap depths}?
Trying to become ambidextrous?
Is that even how you say it...Actually yes. Oddly enough, I am already left-handed with certain things like baseball, hockey, hacking limbs with a machete. It's actually good for the brain... but don't ask me to explain that. Ask a neurologist lol.