I’ll post an FLA shortly
btw, what’s the code for anyways? I mean, are we not using the classes we wrote earlier to handle all that?
I’ll post an FLA shortly
btw, what’s the code for anyways? I mean, are we not using the classes we wrote earlier to handle all that?
at this point, it is for my own edification. However, if you use classes, wont you still have to bring them to the stage? I really don’t know, Im kinda learning about some of this as I go.
There are some problems with this code, but I believe the logic is there… Im still sorting through it. I am posting it in hopes to gain momentum
Guys/Gals… if this is not for you, or if you just dont feel like participating, please let me know. No offense taken at all. I will delete the thread and try it myself.
Really, no offense…
So, I will post this, if no replies or anything… I’ll stop posting and we’re all still friends
To Ilyas and Ahmed… I believe your code will be better than this and this is not refuting your code. This is simply my interpretation of the ideas. Ultimately we will fit everyone’s ideas into one of your codes using your conventions.
[AS]
//store 12 seeds in a seed variable for use later
seeds=[];
for(k=1;k<13;k++){
seeds.push(“s”+k);
}
//establish the well function which will exist in every well class (movie clip).
myWell = function(){
this.content=[]; //start with an empty array.
this.quantity=this.content.length; //this will tell us how many items in each well
this.onRelease=function(){//every time they click on a well…
trace("this well is "+this._name); //for debugging purposes
trace("the value of the content array is " + this.content);//same here
if(this.content.length!=0){
currentwellnumber=Number(this._name.substr(4));//gives a numerical starting point
for(i in this.content){ //for every seed in the well
seedmover=this.content*; //store 1 seed in a variable
this.content.splice(0);//delete one seed from the array
trace("value of seedmover = "+seedmover);
nextwell=currentwellnumber+1;
if(nextwell==4){//After the last well, go back to the first.
nextwell=1;
}
_root["well"+nextwell].content.push(seedmover);//put the seed in the next well
currentwellnumber+=1;
}
}
}
}
well.prototype = new MovieClip();
Object.registerClass(“well”,Mywell);
for(n=1;n<4;n++){
attachMovie(“well”,“well”+n,n);
_root[“well”+n]._x=n*150;
}
well1.content.push(“s1”);
well1.content.push(“s2”);
this.onEnterframe=function(){
onetext.text=_root.well1.content.length;
twotext.text=_root.well2.content.length;
threetext.text=_root.well3.content.length;
}[/AS]
I know I currently have problems with moving the contents of one array into another. I had it working for a while and then I screwed it up. I’ll find it soon (I think). The basic concept lies in that we know all wells will be called “well” plus a number…
so, I’m extracting the number from the name so always know which well is next to receive a seed.
The length of the array will, of course, give us the number of seeds in each well.
Finally, if the next array = well15, then we know to change the value to well1. Anyway, in the example above, I was trying with three wells, for starters.
I hope it makes some sense… or we can all laugh together.
One more time, I dont want to waste your time or mine. Honesty is appreciated This is just a pet project to get the mental juices going… no biggie.
*Originally posted by Iammontoya *
**Guys/Gals… if this is not for you, or if you just dont feel like participating, please let me know. No offense taken at all. I will delete the thread and try it myself. **
lol, what’s makes you think so? I indeed am interested in working on this, i’ve just been busy these two days with school stuff to look at your code closely or make an fla
I edited the code above again… I just keep posting the edits back over there. Hope you dont mind.
the test fla so far…
[AS]
//store 12 seeds in a seed variable for use later
seeds=[];
for(k=1;k<13;k++){
seeds.push(“s”+k);
}
//establish the well function which will exist in every well class (movie clip).
myWell = function(){
this.content=[]; //start with an empty array.
this.quantity=this.content.length; //this will tell us how many items in each well
this.onRelease=function(){//every time they click on a well…
trace("this well is "+this._name); //for debugging purposes
trace("the value of the content array is " + this.content);//same here
if(this.content.length!=0){
currentwellnumber=Number(this._name.substr(4));//gives a numerical starting point
for(i in this.content){ //for every seed in the well
seedmover=this.content*; //store 1 seed in a variable
this.content.splice(0);//delete one seed from the array
trace("value of seedmover = "+seedmover);
if(currentwellnumber>3){
currentwellnumber=1;
}
nextwell=currentwellnumber+1;
if(nextwell==4){//After the last well, go back to the first.
nextwell=1;
}
_root["well"+nextwell].content.push(seedmover);//put the seed in the next well
currentwellnumber+=1;
}
}
}
}
well.prototype = new MovieClip();
Object.registerClass(“well”,Mywell);
for(n=1;n<4;n++){
attachMovie(“well”,“well”+n,n);
_root[“well”+n]._x=n*150;
}
well1.content.push(“s1”); //for testing purposes
well1.content.push(“s2”);
this.onEnterframe=function(){//probably go onRelease
onetext.text=_root.well1.content.length;
twotext.text=_root.well2.content.length;
threetext.text=_root.well3.content.length;
}
[/AS]
I’m sorry, I don’t have Flash during the week, so I can just post bad ideas right now. I’ll see about that this weekend. And concerning your dissident Bantumi, I think we have to decide which one we’ll be working on. If we work with the one I posted based on Ahmed’s code, then the next step is to take the seeds out of the well clips so that we can move them. And if we’re using yours, wel, tell us what’s next =)
I know Im doing this the wrong way… please someone tell me what is the best way…
Right now Im making adjustments to each well’s _x and _y after they load in order to put some “invisible” wells in their correct spots, according to the electrongeek’s board design.
example:
w1._x=120;
w1._y=120;
w2._x=
and so on…
can’t be right, there must be a better way…
Is there a better way?
Ilyas, is that what you were talking about before?
Well… here’s my latest. Again, I would imagine this would all be consolidated into someone’s FLA… this just my way of understanding what is going on. I share with you so there’s some progress…
Next Step:
Figure out how to populate each well with the initial 4 items of each array.
Match seed MC’s with corresponding array items into the well.
Move seed mc’s based on their name being in a different mc’s array. (although only the number of seeds is important at this time)
Keep in mind that this is work in progress and that we ALL have different styles and ways of doing this.
Ahmed… I know your code is better and more OOP and THAT is what I want to use. This, one more time, is my interpretation and it DOES NOT have to be part of the final solution.
I promise, i’ll look at it soon, i’m just a little too busy, just letting you know, im not like ignoring your posts or anything
No problem. Im still moving forward and have already loaded the numbers correctly and they move around fine. No game logic built in yet.
Next I have to make sure the array contents are correct, because they will help in visual seed movement of the mc’s. We’ll see.
Holy crap this has come a long way. Sorry I haven’t been around much, I started my new job recently, and before that I was studying for my new job, so it’s like… argh!
Ivan >> Will review this weekend
Lost >> I’m sorry I missed that, but what can of job did you find? Is it web-related?
Nope, not web related, theres not much high demand for web related things in my specific area unfortunately.
I am a cook at a restaurant. So far it’s not bad, i’m learning a lot. But unfortunately it takes me an hour and a half by bus to get to work so I gotta get up at like 5:30-6am to be in work on time, so I go to bed early too.
the latest file and code…
Update:
I have gotten 4 movie clip names into each well’s array.
You can no longer click on well 7 and 14, which keep any seeds that fall into them (more on that later).
changed the updatenumber() to initiate when you click (onRelease) on the well.
Problem:
for some reason, I can’t get the _x value of s1 (name of one of the seed movie clips). Weird.
Next:
1. Figure out how to place a seed movie clip into each well.
2. Figure out how to “stagger” seed mc’s so they’re at the bottom of the well, but not directly on top of each other.
3. Establish turns-based rules.
Well, I got bit again by the same deal about attachMovie and for/loops
it simply will not work. So, I had to add and name all seeds by hand. Oh well.
Im also gonna have to use different color seeds, since setRGB and transform will not work with the look that EG provided. No biggie there either. Im simply going to do 4 rows of 12 seeds. Each row a different color.
Ivan, I’m having a very hard time modifying your file I’ll see if I can switch back to the old code, and incorporate some of your functions in it
:: Copyright KIRUPA 2024 //--