Groups | Blog | Home
all groups > flash actionscript > october 2006 >

flash actionscript : Lego game


SMB
10/3/2006 2:09:30 PM

[quoted text, click to view]

First off, you don't need to keep pleading for help by replying to your
post. People see it, and if someone knows the answer they are more likely
to help if they see that you have allowed more than 16 minutes between your
original post and your 1st reply.

You are in college... are you in a Flash class? What is the difficulty of
the class (beginner, intermediate, advanced)???

What is your skill level?

Do you understand OOP and how to utilize it in ActionScript 2.0? What
version of Flash are you using? What do you mean by 'use it to build
something'? Is this going to be a 2d or 3d setup?

Do you have any ideas thus far? Do you have any mock ups, or beginning code
for what you want to accomplish?

Answer these and maybe I can help.

SMB
10/3/2006 2:59:13 PM

[quoted text, click to view]

If you have any means, then upload the SWF where it can be viewed so I can
see what you have started.

For the most part, if you are a beginner, you will need to keep this simple
or else you will need to do a lot of reading and/or practicing.


Menthol Man
10/3/2006 8:03:40 PM
Hey everyone, i need help. I am creating a mini lego game for college and i
want it so i have different colour pieces running down the side of the screen
so when you click and drag, say, an orange one its still on the side of the
screen, but i can now use it to build something. Any ideas?
Menthol Man
10/3/2006 8:19:48 PM
Menthol Man
10/3/2006 9:05:33 PM
Menthol Man
10/3/2006 9:46:00 PM
Im only a begginer really, and no i dont understand OOP and how to utilize it
in ActionScript 2.0. At the moment i have made 4 different coloured isometric
boxs that i can drag onto eachother to make things in an isometric view if you
know what i mean. I just have no idea how to go about having alot of boxes to
move around with out copying them.
NSurveyor
10/3/2006 10:09:53 PM
If you know some ActionScript, you might want to look up the MovieClip methods:
startDrag, stopDrag, duplicateMovieClip, and the MovieClip events: onPress,
onRelease, onReleaseOutside (or the Mouse event: onMouseUp instead). The idea
is, when you click on the clip (onPress), you duplicate and drag it
(duplicateMovieClip and startDrag), and then when the mouse is released
(onRelease+onReleaseOutside or onMouseUp), stop the drag (stopDrag), and then
possibly fix the position of the piece... like if it's off the build zone,
delete it, or snap it into the correct position.
Menthol Man
10/3/2006 10:15:07 PM
NSurveyor
10/3/2006 11:16:53 PM
Okay, so remove all your current code. Give your clips the instance names,
red_mc, blue_mc, yellow_mc, and orange_mc. Attach the following to the frame
that contains your clips:

var depthCount = 0;
var clipArray = [red_mc,blue_mc,yellow_mc,orange_mc];
for(var c in clipArray){
var cClip = clipArray[c];
cClip.onPress = function(){
var nClip = this.duplicateMovieClip('lego'+depthCount,depthCount++);
nClip.onPress = function(){
this.startDrag(false);
this.onMouseUp = function(){
delete this.onMouseUp;
this.stopDrag();
// special positioning conditions go here
}
}
}
cClip.onPress();
}
Menthol Man
10/4/2006 12:15:55 PM
AddThis Social Bookmark Button