A Flash Developer Resource Site

Page 3 of 14 FirstFirst 123456713 ... LastLast
Results 41 to 60 of 261

Thread: [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [Resolved] [

  1. #41
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    Exelent example,
    Did you notice that if you go the next screen the yelowhead will be there also

    Code:
    onClipEvent (enterFrame) {
    if ( _root.hero.frame=="a"){ // get the currant screen 
    this._visible=true;
    	if (this.hitTest( _root.hero )) {
    		if (event[0] eq _root.hero.event[0]) {
    			_root.text.text = reply[1];
    		} else {
    			_root.text.text = reply[0];
    		}
    	}
    }else { this._visible=false;}// so I will show only in one room..
    }
    even tho this is not pervect because the MC is still there and you will have problem walkin arround it another way of doing it is to use gotoAndStop on empty frame and thus to remove the yellowhead..

    mad_sci

  2. #42
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    loving it ......loving it...
    although i 'd like better a pop up window for the talkin
    part maybe with some transparency

    hey what about the ugly grass ground?
    is that gonna be on all the rooms?
    ummmmm and then again why ought to be grass inside the room??? well maybe the hero is a vegetarian hi hi hi !!


    good work guys

    ciao
    magnetos




  3. #43
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    I updated my example.
    Added redhead (probably Ian), who has transparent popup window in the center of movie.

    I also moved diamond and both NPCs inside the back mc. Diamond should be there for sure, but I don't know about NPCs. If they are in back mc, then we don't need to check them with hittest separately and we don't have to worry about them appearing in the other scenes. But maybe this causes some other problems.


    http://www.hot.ee/tonypa/flash/flas/madsci.html
    http://www.hot.ee/tonypa/flash/flas/madsci.fla

  4. #44
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    look what 5 minutes of tempering can do

    http://digilander.iol.it/magneto1/rpg.swf


    i wasn t able to change the graphics on the second windows
    though

    still you have to consider the file size
    is already 89kb and it has only 2 rooms no enemies and stuff

    ciao

    magnetos

  5. #45
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    i forgot

    for each message you use a different window
    i think you should make it in a way
    that you use only one window
    where you output all the text
    scrolling text will be also be nice

    just a tought !!!






  6. #46
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    i forgot

    for each message you use a different window
    i think you should make it in a way
    that you use only one window
    where you output all the text
    scrolling text will be also nice

    just a tought !!!




    ciao
    magnetos

  7. #47
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    The size of the swf worried me too, but it will not grow much, when there are more rooms, because we can use same tiles.

    I actually left second text window just to look, how much better new one was
    I think text window should be somehow different, when you speak to different person. Color maybe...

    Please, can't you make your fla available, your graphics are so good

  8. #48
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756
    WOW that was cool..I dont thik you need me anymore guys..

    mad_Sci

  9. #49
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    You are not serious, mad_sci?

    It's not finished at all. It's just a beginning. We still need enemies and battles and all the interface (life metter, money, score, bonus points, invetory, how to use items from the invetory, pick things and drop things in different screens, like you promised in the beginning) plus AI. I can continue forever...

    Thing we have here now is just a bit prettier, then your original

    I also made light version (<10 kB swf and 40kB fla) without bitmap graphics:
    http://www.hot.ee/tonypa/flash/flas/madsci_light.html
    http://www.hot.ee/tonypa/flash/flas/madsci_light.fla
    [Edited by tonypa on 10-12-2001 at 03:41 PM]

  10. #50
    incredibulus-actionscriptum magnetos's Avatar
    Join Date
    May 2001
    Posts
    2,160
    hey mad-sci where you think you going???
    we still need you

    all we have done so far is make ir prettier (like tony said!!)

    here is the fla that i make it nicer before i also fix room2

    http://digilander.iol.it/magneto1/madsci.fla

    please mad sci don't leave us aloneeeeeeeeeee !!!!!

    ciao

    magnetos



  11. #51

    wow!

    Hey you guys, I have been following this awesome tut from when it started, and I have to tell you that im very grateful that someone has finally decided to make one of these. Anyway, here is my contribution...it isn't much different, but it's got somewhat refreshing graphics. I was feeling very "zelda-ish" when i put it together ^_^

    http://www.geocities.com/darkerspoonz/Movement.html

    Spoonz

  12. #52

    hmm

    for some reason my post didnt seem to appear...oh well, here it is again. blah blah blah, here is my version, obviously very similiar to all of yours. mine is probably a bit refreshing as far as graphics are concerned however, i was feeling zelda-ish...

    http://www.geocities.com/darkerspoonz/Movement.html

    ~Spoonz

    wow, there is my other post all of a sudden...

  13. #53
    ok, ive got the character moving and maybe im a little slow but, I don't think so because i basically just copied a bunch of code. So, I have a problem my character moves around and stuff, but when you stop pressing the key then my character guy spins around so that hes facing south. I've checked, double checked, compared with the rest, but he just keeps doing it... also i should probably mention that its only a 4 way movement (don't know if that'll effect it) and I made the excess code that I thought was useless for me into comments.

    http://www.angelfire.com/va2/starwars/character.fla

    and if that doesn't work...

    http://www.angelfire.com/va2/starwars/character.html


  14. #54
    Senior Member
    Join Date
    Mar 2000
    Location
    New York, New York
    Posts
    124

    Re: hmm

    Originally posted by DarkSpoonz
    mine is probably a bit refreshing as far as graphics are concerned however, i was feeling zelda-ish...
    Very Very nice looking game. I really like the graphics. One thing you might want to add to this little game is a more defined hitarea around the character. I noticed small little errors like I could get stuck in some of the plants and the tops of trees on the second scene. I think if you made a MC that looked like a shadow around the bottom of your character then did all of your hit tests off of that MC, it would work a little cooler. Then again that is just what I have always done with games like this that rely heavily on hittest to keep players within a boundary. This would also work really good with trees and you can put to tops of the trees on a higher level to give the feeling of depth, by only hittesting the trunk of the tree. This way the player could walk right under the tree. Just another thought, keep up the good work!


  15. #55
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    to DarkSpoonz.

    I like the style.
    Just noticed, that your hero gets stuck into other characters and back sometime. I run into that too and made a little addition to the hittest part in the hero:

    Code:
        if (_root.back.hitTest(this._x+30, this._y, true) and old_x<this._x) {
            this._x = old_x;
        }
        if (_root.back.hitTest(this._x-30, this._y, true) and old_x>this._x) {
            this._x = old_x;
        }
        if (_root.back.hitTest(this._x, this._y+30, true) and old_y<this._y) {
            this._y = old_y;
        }
        if (_root.back.hitTest(this._x, this._y-30, true) and old_y>this._y) {
            this._y = old_y;
        }
    So, we check the direction and hittest only in front of hero. I am not sure, but maybe you can use this.

    http://www.hot.ee/tonypa/flash/flas/madsci_light.html
    http://www.hot.ee/tonypa/flash/flas/madsci_light.fla

    Also added fade transition between rooms and NPC turn to hero, when they talk.



  16. #56
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    to voicesinsidemyhead.

    I changed your fla a little and it walks right now.

    http://www.hot.ee/tonypa/flash/flas/character1.fla

  17. #57
    Thanks alot for the code Tonypa, but unfortunately it did not entirely fix my problem...i changed the hit test code, but my characters still seem to move onto my bushes and the top of the trees. Im certain it's still a problem with hit test...anyway, thanks again

    ~Spoonz


  18. #58
    Junior Member
    Join Date
    May 2001
    Posts
    9

    Question awesome thread

    To all who have posted so far let me say that I'm really enjoying this thread. Very informative.

    I've been tinkering myself with an rpg type game but am having problems with the hero running through objects like trees, walls and houses.

    I thought I had figured it out and what I have sort of works but something is wrong. When the arrow keys are pressed and held down my character walks right throught stuff. But when the keys are only tapped the hero doesn't go through objects.

    I'm thinking I have something coded wrong in the movement but I'm not sure. Here's the code in my hero:

    **************
    onClipEvent (load) {
    moveSpeed = 8;
    }
    onClipEvent (enterFrame) {
    old_x = this._x;
    old_y = this._y;
    if (Key.isDown(Key.RIGHT) and this._x<585) {
    gotoAndPlay (3);
    this._x += moveSpeed;
    } else if (Key.isDown(Key.LEFT) and this._x>15) {
    gotoAndPlay (4);
    this._x -= moveSpeed;
    }
    if (Key.isDown(Key.DOWN) and this._y<375) {
    gotoAndPlay (2);
    this._y += moveSpeed;
    } else if (Key.isDown(Key.UP) and this._y>20) {
    gotoAndPlay (5);
    this._y -= moveSpeed;
    }
    }
    onClipEvent (keyUp) {
    gotoAndStop (3);
    if (Key.getCode() == Key.RIGHT) {
    }
    }
    onClipEvent (keyUp) {
    if (Key.getCode() == Key.LEFT) {
    gotoAndStop (4);
    }
    }
    onClipEvent (keyUp) {
    if (Key.getCode() == Key.UP) {
    gotoAndStop (5);
    }
    }
    onClipEvent (keyUp) {
    if (Key.getCode() == Key.DOWN) {
    gotoAndStop (1);
    }
    if (_root.wall.hitTest(this._x+8, this._y, true)) {
    this._x = old_x;
    }
    if (_root.wall.hitTest(this._x-8, this._y, true)) {
    this._x = old_x;
    }
    if (_root.wall.hitTest(this._x, this._y+8, true)) {
    this._y = old_y;
    }
    if (_root.wall.hitTest(this._x, this._y-8, true)) {
    this._y = old_y;
    }
    }
    **************

    That final part is the section that supposed to stop the hero from going through walls. But like I said, it doesn't work all the way.

    Any help would be appreciated. Thanks!

    freaklad

  19. #59
    thank you so much Tonypa!

  20. #60
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    to freaklad.

    You have put your hitTest inside last onClipEvent (keyUp) event. It means, hitTest is checked only, when down key is released. You have to put it inside onClipEvent (enterFrame) event. Then it will be checked all the time.

    You have also made mistake here:
    onClipEvent (keyUp) {
    gotoAndStop (3);
    if (Key.getCode() == Key.RIGHT) {
    }

    gotoAndStop should be in the If statement.


    Here, correct code:

    Code:
    onClipEvent (load) {
        moveSpeed = 8;
    }
    onClipEvent (enterFrame) {
        old_x = this._x;
        old_y = this._y;
        if (Key.isDown(Key.RIGHT) and this._x<585) {
            gotoAndPlay (3);
            this._x += moveSpeed;
        } else if (Key.isDown(Key.LEFT) and this._x>15) {
            gotoAndPlay (4);
            this._x -= moveSpeed;
        }
        if (Key.isDown(Key.DOWN) and this._y<375) {
            gotoAndPlay (2);
            this._y += moveSpeed;
        } else if (Key.isDown(Key.UP) and this._y>20) {
            gotoAndPlay (5);
            this._y -= moveSpeed;
        }
        if (_root.wall.hitTest(this._x+8, this._y, true)) {
            this._x = old_x;
        }
        if (_root.wall.hitTest(this._x-8, this._y, true)) {
            this._x = old_x;
        }
        if (_root.wall.hitTest(this._x, this._y+8, true)) {
            this._y = old_y;
        }
        if (_root.wall.hitTest(this._x, this._y-8, true)) {
            this._y = old_y;
        }
    }
    onClipEvent (keyUp) {
        if (Key.getCode() == Key.RIGHT) {
            gotoAndStop (3);
        }
    }
    onClipEvent (keyUp) {
        if (Key.getCode() == Key.LEFT) {
            gotoAndStop (4);
        }
    }
    onClipEvent (keyUp) {
        if (Key.getCode() == Key.UP) {
            gotoAndStop (5);
        }
    }
    onClipEvent (keyUp) {
        if (Key.getCode() == Key.DOWN) {
            gotoAndStop (1);
        }
    }

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