PDA

View Full Version : Avoider game problems


scottywatty_flash_man
04-23-2009, 11:11 PM
Hi, I am working on my game: "The Adventures of Beastly Guy in a Shopping Cart!"
There are some problems...first of all, it is WAAAAAAAY to easy to die. in fact, it's almost impossible to live...

What i would like to do is make it so there is a "hit" movie clip on the car's that are zooming by, I want to change it from where if Beastly Guy hits the car, he dies, to when ever Beastly Guy hits the "hit" movie clip, he dies. Is this possible?

Another thing, I would like levels. So there would only be so many of each car to pass. Then, when you dodge all of the number, a different car comes, and so on and so forth. I have an idea you could use :

cars left=15
if cars left =0{
then removeMovieClip(car1)
add movieclip(car2)
}

I know the scripting sucks, but you get the idea.

One more problem...after you die, the cars keep on running past the screen. I want to stop this too...

ahhh, my flash game has SOOOO many problems....

The .swf of the game is Here (http://1234.static.googlepages.com/shoppingGame_v4.swf) and the .fla(source code) of the game is Here (http://1234.static.googlepages.com/shoppingGame_v5.fla)

Any help is welcome, even if it is just a little!
Thanks

ImOnCloudNine69
04-23-2009, 11:23 PM
yeah i can do this for you. your code is all way off.

first thing your going to want to do:

draw a box the size you want the hitBox to be.

then convert it to a movie clip. call it hitBox, and give it an instance name.

now select the movie clip "hitBox" and press ctrl-x (cut. i am assuming windows is in use here)

now double click on your car so it will open up the edit mode of your car.

press ctrl-v (paste) your black box should show up inside of your car. now place the box where you want it to be on the car. then i would right click on hitBox and go to arange, then send to back. then in the left corner below the timeline click back on frame 1 or whichever frame you are on.

you can now refer to this hitBox as CAR.hitBox

thus you can do:


if(PLAYER.hitTest(CAR.hitBox))
{
}


and there you go.

the best way to do this is to have that one you copied off screen, and duplicate it like this.


var i:Number = 0;

function createCar()
{
i++;
if(i <= 15){
_root["carA"].duplicateMovieClip("CAR"+i, _root.getNextHighestDepth());
// this gives you copies of it that are renamed CAR1, CAR2, CAR3 and so on
}else if(i >15 && i <= 30){
_root["carB"].duplicateMovieClip("CAR"+i, _root.getNextHighestDepth());
}

//now use them like this.

_root["CAR"+i].onEnterFrame = function(){
this._x -= 10;


if(PLAYER.hitTest(this.hitBox))
{
}
}
}

scottywatty_flash_man
04-24-2009, 12:09 AM
thanks man!(or girl) that helps alot...now just fixing the other problems.:mad: oh well, the job of an un-proffesional flash desinger is never done...
P.S how is my code screwed up? I thought it was pritty beastly...:)

P.S.S anyone else want to help improve Mr. Beast's game? I sure could use the help...