GIGJ.COM
welcome to my space
X
Welcome to:gigj.com
Search:  
NAVIGATION: Home >>

help with game :-\

Published by: jane 2010-03-18
  • Help Your Game::
    At Custom Clubs Unlimited we are here to help your golf game. Send mail to with questions or comments about this web site. Copyright © 2003 Custom
    http://www.ccugolf.com/help_your_game.htm
    HOME
    I need a little help with my game. I'm making a game like missile command and I duplicate the missiles that you fire and the enemy missiles that fly down. When you fire missiles it like overwrites the enemy missiles that fly down. I know it has something to do with the depth when I duplicate the two movie clips but I dnno how to fix it so that they don't overwrite eachother.

    I tried searching and nothing really helped me. I tried using something like...

    m++;
    duplicate(_root.missile, "missile" + m, m)
    e--;
    duplicate(_root.enemy, "enemy" + e, e)

    and that didn't really work either... I need a hitTest to work with the duplicated movie clips and I found something that I thought would work when searching but didn't : So if anyone can help me I would greatly appreciate it :D

    Heres the .fla for it...


  • k :)

    When missile and enemy collide I want missile to play a little animation im going to add. When the two first collide I want enemy to be removed and once missile's new animation has finished playing that be removed as well.

    Im using flash mx.

    I really appreciate the help btw :D


  • Your one loop could go from 0 - 500 and the other from 501 to 1000even better... of course ;)


  • HEre you go man... It's quite allright to have code inside of your missles... As in our case.. The missles won't have too much code.

    in the player's bullet movieclip



    on(enterFrame)
    {
    // move missle up.. or left or however you have it

    if(this.hitTest(_root.enemy))
    Funny-Games.biz Help Page::
    GENERAL HELP. Q: I am trying to play a game on Funny-Games.biz but it is not loading/working? Sometimes a game wont recognize your keystrokes until you click on it with the
    http://www.funny-games.biz/help.html
    HOME
    {
    _root.enemy.gotoAndPlay("death");
    }
    }



    Now.. if you have multiple enemies... Have a variable in the main movie part (main frame that loops) hold the number of enemies currently on screen. Keep those enemies numbered in a certain way so that they can be accessed through means of enemy0, enemy1, enemy2, etcetera....



    on(enterFrame)
    {
    // move missle up.. or left or however you have it

    for(i=0; i<_root.numEnemies; i++)
    {
    if(this.hitTest(_root["enemy"+i]))
    {
    _root["enemy"+i].gotoAndPlay("death");
    }
    }
    }


  • Umm, I'm kinda confused... What do you mean by that junahu :S


  • It's a complicated procedure at times..

    First off... I just have some small questions...

    1. Do you want the missles to be able to cancel each other out?

    2. WHat version of Flash are you using.

    I'll gte back to you later on possibly.


  • I'd suggest making the variables and depths like the such...

    Your one loop could go from 0 - 500 and the other from 501 to 1000

    if(m > 500){m=0;}else{m++;}
    if(e > 1000){e=501;}else{e++;}

    And that's all there is to it man... The chance of you having 500+ shots onscreen is very unlikely.


  • Ok, now I feel retarded... : Movie clip containers? Do you mean like a layer for them or...?

    Sorry for my stupidity :-


  • Thanks for the help, how do i use the currentDepth though? Like duplicateMovieClip(_root.missile, "missile" + _root.currentDepth, _root.currentDepth) ? Sorry for my stupidity :P

    Also, any ideas on the hit test thing?


  • w00t thanks a lot Marz. How would I go about doing the hitTest on these movie clips now :S


  • hmm...

    The hitest shouldn't be too hard, assuming you did the earlier suggestion of spawning the missiles and enemies into separate movieclips. But of course I don't know that. Did you?


  • Originally posted by splict
    Elbudster,

    Another solution would be to place all your missles inside of a movieclip, called missles and all of your enemies inside their own movieclip container called enemies. (I'm real creative ;))



    In this way you can have each missile hitest the movieclip enemies (e.g. _root.enemies.hitTest(_x,_y,true)) rather than having each missile hitest each enemy

    The origin of the movieclip missiles has to be 0 though, otherwise you'll be hittesting the wrong coordinates which is rarely a good thing.


  • Elbudster,
    It is a lot better to have your code on an empty frame instead of attached to movie clips. One of a few reasons is because it is easier to organize if you have it all together - IMO.

    With your movie, when you add 1 to i it becomes 2,3,4, etc. when you add 1 to e it is the same thing. so whenever e and i are equal, you are putting movieclips at the same depth - which, as you know, doesn't work.

    One solution would be to use the same variable for both. Such as _root.currentDepth in place of your 'e's and 'i's. That way if a missle is attached on to 5 and then an enemy is attached it will know to go on 6.

    Another solution would be to place all your missles inside of a movieclip, called missles and all of your enemies inside their own movieclip container called enemies. (I'm real creative ;))

    You still have a few other problems, though, cause after I shoot 3 missles, there is so much slowdown I can't move my mouse. :(

    -splict





  • Nortel Unveils Vision, Strategy for Israeli High-Performance Net
    Busy Friday Leads to Strong Close for Net Stocks
    PRINT Add to favorites
    #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about help with game :-\ , Please add it free.
  • digital camera using vista
  • my new digital camera comes with a 26mb internal memory about how many pictures will that be
  • i have lost my camera booklet please help
  • sony cyber shot dsc w55 blurry pictures
  • what is better out of these 2 cameras
  • questions for printing photots yes it may be stupid but i need help
  • my card reader will not work and memory card from camera
  • my digital camera keeps putting these weird horizontal lines through my pictures why
  • are they going to dis continue ef s lenses
  • point and shoot camera
  • canon sd750 zoomed in picture is always blurry
  • what is an slr camera
  • same ccd size same resolution same quality
  • what is pixel how many pixels make up one centimetre
  • which is the best digital camera brand
  • overall what do you say about this camera
  • what would be the best pan tilt zoom wireless ip cam
  • what is the best camera phone
  • are there any slr cameras under 500
  • sony cyber shot camera question
  • canon l series lens on a nikon dslr is it possible
  • and whats the best filter lense for nikon d40 nikkor af s 18 55mm 3 5 5 6 g ii ed dx lens thanks
  • whats a good rofessional camera
  • gsm based robot is normally for to control it over very long distance but how we observe robot take views
  • do u have the kodak easyshare c813 8mp digital camera
  • i am looking for a digital camera for under 300 needs to have a great zoom and take great pictures
  • camera help sony cybershot

  • About us -Site map -Advertisement -Jion us -Contact usExchange linksSponsor us
    Copyright© 2008 gigj.com All Rights Reserved
    Site made&Support support@gigj.com    E-mail: web@gigj.com