:-0 -->[Mad Sci ]
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: :-0 -->[Mad Sci ]

  1. #1
    Senior Member
    Join Date
    May 2000
    Posts
    107

    Smile

    hey man...this collision detect/distance/hotspot thing is driving me mad =)

    I'm working on my flashgame where I need to stop my little gamehero from walking into diffrent areas etc...(remember?)

    I just can't make it work :-)

    Then I saw illumin8d1's Zelda game just now and he's doing exacly what i've been trying to acheive the last couple of days...(only I tried with collision detect witch he probably did't)It looks really sweet!

    He wasn't allowed to share the code on the board but if you've got the code mailed you know how he did it (as far as I understood it was ok with HIM to share the code)

    You gave me a nice hint on how to do distance coding yesterday but it just wasn't enough for me to be able to make it all work (after all I'm not at all good at scripting)

    could you be a bit more specific on how I should wright the code or do I have to wait for your huge tutorial on "the art of mooving a little fellow across the stage in flash"---you ARE making one, right??;-)

    (yeahhh...another diffrence between my and illumin81's game... the first things I put in there were the monsters..and NOW i'm stuck...he he he (unexperiensed flasher huh?)

    cheers!




  2. #2
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Buddy ok I was talking for a maze game the Zelda game has too many wide open spaces. So again let me give you another hint:
    1. you can do is deffine space in wich your herro is allowed to move. Cover the other with stuff. Buildig block bush or something. This can be achieved by running containtment reaction. For example your herro is inside of sqr. here is simpl code

    in the sqr. define the top,bottom,right,left sides usual way. use lets say my_top,my_bottom etc.
    now use if thent statements to pass permition to your guy.

    my_top<=guy_top, my_bottom >= guy_bottom, my_left<=guy_left and my_right >= guy_right if this is correct pass variables like go_up=1 go_down=1 go_left=1 go_right=1 to the movie clip which is your man.

    in the MC of your herro. make all movements up,down,left right only if the variables go_up=1 etc. and most important make in the same movie clip those variable 0 by deffault.

    so when your guy exits the sqr no movement will be allowed.


    now the question is ok but this is one sqr. right how can I do irregular shapes. answer simply overlapping two of those sqrs. you can shape em but remember they run containtment now collision.
    Mad-Sci

    Ill share the code for Zelda of cource. But first I have to have the guys pepmition for that.

  3. #3
    Senior Member
    Join Date
    May 2000
    Posts
    107
    txanx man!

    I'll go working on it right away...I'm still not 100% sure what you mean (24% rather =))but I'll givit a go!

    It suits my game quite nice cause it's all squares...

    ..and I still don't have to code every single square he's allowed to step on but I can copy the one I make to every place where I want him to go?

    an Idea-->:maybe I could use a tell target to tell the instance=square he is stepping on to highlight or something (a bit of that old disco feel ya know)...

    I'll be comming back for more advice so dont go away on a holliday or anything;-)

    thanx.

  4. #4
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Dont give up. Ill continue with Making maze games basics here on this board. I started with Path Finding ( a way to move monsters arround ) which is kind of difficult. The next step will be to post how to make maze and move arround it. I have 3 ways of doing it all of them will be posted as fla with explanation. I was not very clear about the collisions but its not easy cos the code is kind of complicated to explain but once you get it no limits for ya.
    Ok tonight Ill post some samples.
    Mad-Sci

  5. #5
    Senior Member
    Join Date
    May 2000
    Posts
    107

    Smile

    oh...I woun't give up that easy but I have to say there is quite a big gap between understanding let's say tell target stuff and using set/get property/setting variables...I mean REALLY understanding that stuff so you can usit in exactly the way you want....as you say once you get the hang of that distance thing so you can build real scenes for your games I can think of about one million ideás for games using only that, collision detect and tell targets...:-)

    I'll check out your samples as soon as they're up...

    cheers!


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com