Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Food Fight!

Status
Not open for further replies.
Jan 26, 2001
550
GB
Hey guys, im in the initial stages of designing a kind of food fight game. Its going to be pretty simple (no skill involved to play the game). Here are the files so far:


when you click throw, the movieclip called armleft plays (the arm throwing motion), and in turn tells the 'throwset' movieclip to play frame 2(which is in turn yet another clip with a tomato being thrown). This is the theory anyway, but im having trouble getting the 'throw1' and 'throw2' movieclips to play. At the moment i have set it only to play throw1 but what i actually want is to randomly select either throw1 or throw2 so it is luck if your tomato hits or misses. Eventually i want to add several other items of food to be thrown as well.

I hope this makes sense; i think this should be pretty simple to solve but its doing my nut at the moment!

Any ideas would be appreciated!

Cheers guys Nick Price
nick.price@misuk.net
 
hi Nick, I'll check the links in a tick.

In case you haven't visited it yet (and if your interested), have a look at and select "milking the cow" from his flash list. Then use the drop-down menu to get at about 15 other games in Flash. (Taught the guy everything he knows) LOL I wish!

dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
cheers m8 looking at it now ;) Nick Price
nick.price@misuk.net
 
bloody hell! i think it'll be a while until I do something quite as complex as the cow game! enjoyable though hehe Nick Price
nick.price@misuk.net
 
brilliant dave, you astound me yet again. Something tells me I haven't got the right sort of logical mind for scripting in flash!
Thanks for your help, and by the way i'll put a link up to that furniture thing soon cause its almost done.
Nick Price
nick.price@misuk.net
 
hehe like it dave, like it very much! (you gotta teach me how to blow smoke rings like that!) Nick Price
nick.price@misuk.net
 
There is something i still dont quite get from your .fla dave- the 'random' command is Random(1)+2.....Forgive my crap logic if im wrong but doesn't this always give a result of 3? the reason im asking is cause i have to add a few more random paths for the food to take and im having trouble making it work properly....

If I want to do a random of 4 frames but NOT the first frame should i be using Random(3)+1???

Nick Price
nick.price@misuk.net
 
random(1) returns a value of 0 or 1, hence when you add on 2 the values become either 2 or 3, which happens to be the frame numbers that are being targetted in the movie.

To get the 4 but not 1, you would use random(3)+1

dave davdesign@pinkzeppelin.com

^^^^^^^^^^^^^^^^^^^^^
 
cheers mate! I think im slowly getting the hang of this! Nick Price
nick.price@misuk.net
 
Sorry to bother you again but i've got yet another problem that i can't seem to solve. This time it seems pretty simple: ive added a pie to the movie, the animation for which lies further down the timeline of the main arm movieclip. The tomato animation still works fine (it just loops around the first part of the movieclip), but the movieclip will just not work when i tell it to play from frame 8. Ive tried adding a label to the frame but it still wont work? Can u shed any light?


Thanks again for all your help Nick Price
nick.price@misuk.net
 
ok no need to bother answering that last post i think i worked it out....the gotoandplay command was outside the tell target brackets. have fun ! Nick Price
nick.price@misuk.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top