A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: This Action Scritp command is right?

  1. #1
    Junior Member
    Join Date
    Dec 2000
    Posts
    27

    Question

    I'm making a game,like Pacman!

    I'm using this system for the walls : if(this.hitTest(_root.Pacman.Esquerdo)
    tellTarget("/Pacman"){
    setProperty("", _x, (_x)-7);
    etc, etc....

    It's works, but not well as I want, beacuse if I put the moviment of the pacman = 15, I have to put "reaction" of the walls 15 too, but, sometimes this do not allow the pacman to go in some places, beacuse he can't pass.
    So, I think in another way to do this, this way is:
    I had put a button, and this command in it:
    on (keyPress "<Left>") {
    tellTarget ("/Pacman") {
    gotoAndPlay (1);
    if (pe.hitTest(_root.Pacman.Esquerdo)) {
    teste = 0;
    } else {
    teste = 15;
    setProperty ("", _x, (_x)-teste);
    }
    }
    }
    What are my objective with this? My objective is when he hit the wall (pe), the variable teste will be equal 0, and he will not be able to continue moving... And when he isn't hitting the wall(pe), he will be able to move normaly...

    But this command didn't work!! :-( , I don't know why, problably is a stupid mistake, that I made, or not! I don't know!
    Any one can help me? Check this code, and tell me if I'm doing something wrong???

    Thanks a lot!





  2. #2
    Junior Member
    Join Date
    Dec 2000
    Posts
    27
    PLEAAASEEEEEEEE!!!
    ANYONE, GIVE ME A HAND!!!!!!!!!!

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