View Full Version : Basic Game..
MrKingsley
07-05-2007, 06:54 PM
Ok, I have this really basic game of a picture of a crosshair following the mouse and movie clips bouncing around the screen and when you click them they dissapear, so, after you click all the movie clips its done, I cant figure out how to duplicate them so theres infinite amount of fun, not just 9 clicks and complete.:o :eek:
Help please?
Ive attached the game.. its just a rough copy.. Im gonna make a backround and the circles guys.. and im gonna add score
orange gold
07-06-2007, 07:10 AM
well im working on an easy way to get them back in
for the high scores put in dynamic text then under var put score1
then this code "lets say the black balls are called balls"
score1 = "0"
balls.onPress = function() {
score1 = score1 - -1;
}
_root.onEnterFrame = function() {
if (score1 == "100") {
score1 = "you win";
}
}
tell me if this helped
whizkid1990
07-06-2007, 08:02 AM
Did you use duplicateMovieClip() or attachMovieClip right from the start to generate the moving targets ?? Or did you change the _visible property to false instead??
Because if you created the movieclips on the stage dynamically already, all you would need to do is create a function invoked based on a counter which increments when you click the moving target/circle.
You would need to generate dynamic duplicate movieclips or use attachmovieclip so that these movieclips and the data can be removed from stage when you click on them, instead of them hogging up memory and slowing the game down every time you generate more.
Anyway, I've done an implementation of your game using duplicateMovieClip, removeMovieClip, setProperty etc etc. Feel free to take a look at it.
(Both examples in the zip file use almost similar actionscript)
MrKingsley
07-06-2007, 01:06 PM
Thanks, ill try it, i really dont no what i did lol...i kind of searched google for what i needed, noobish thing to do actually but;) i made them buttons at first but i couldnt make them bounce around, so under the properties section i just changed the drop down bar to movie clip and found a random movement code.... ill try this right now and check it out thanks
______
No go on the score, too much of a noob to figure it out...nothing with the duplicating either because I couldnt get the score to work, named the dynamic text box's var: score1 and the code i put in the whole frame with the buttons and renamed the "balls" to the balls name. cant think of what i am doing wrong.
WhizKid: can you post the fla so i can see what i am doing wrong?
whizkid1990
07-06-2007, 01:53 PM
Here is the part of the code used to generate the moving targets blabllablabla
doOver();
count;
function doOver(){
for(var i=0;i<=random(40);i++)
{
duplicateMovieClip (_root.cover, "circle"+i, i);
setProperty("_root.circle" + i, _x,random(500) );
setProperty("_root.circle" + i, _y, random(250));
eval("_root.circle"+i).xmove = random(15)-random(15);
eval("_root.circle"+i).ymove = random(15)-random(15);
count=i;
}
}
and
then everytime you click the moving targets you decrement count--; so that if count reaches below zero you invoke the function. Im sure you get the idea.
you can choose to use attachmovieclip as well. In fact, it may probably be an even better method than duplicatemovieclip.
And oh yea... I think I can't post the fla file here.... sorry.
Im using an older version of flash, and you gotta figure it out yourself anyway.
whizkid1990
07-06-2007, 02:40 PM
Don't worry, you are on the right track
Waait why did I post this for?? Oh yes bump bump bumpetity bum
And oh yes the score is really really very simple....
name the var and name scoretxt, just in case.
on the main timeline put
score=0;
then on the movieclip that you are clicking just put this code
on(press){
_root.score++;
_root.scoretxt.text=""+_root.score+"";
}
there you got it. that simple.
orange gold
07-06-2007, 05:14 PM
you cantname them all balls you give them there orignal names then make them all equivilant to balls using as im working on showing you in a fla file
orange gold
07-06-2007, 05:22 PM
alright its at http://albert.teleinc.com/here.zip
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.