A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: [Help]Stairs problem in ISO game

  1. #1
    The Last Starfighter
    Join Date
    Feb 2004
    Location
    The Tower of Babble
    Posts
    96

    [Help]Stairs problem in ISO game

    Using Tonypa's code for the ISO world I am creating a 3D world for a person's website in the ***** Hotel look.

    The structure of this site is going to be like a tower, hence the name Tower of Babble. Now in order to get to the next floor, obviously you need to walk onto the stair tile.
    Attached Files Attached Files
    Last edited by SamusKreations; 05-24-2004 at 04:37 AM.

  2. #2
    Member
    Join Date
    Apr 2004
    Location
    PA
    Posts
    65
    I tried it and it said "Error opening include file npc.as: File not found". If you post that I will can see what I can do.
    Time Consuming Productions Presents

    www.maxbag.net
    (in the works)

  3. #3
    The Last Starfighter
    Join Date
    Feb 2004
    Location
    The Tower of Babble
    Posts
    96
    just take out that code. I forgot to remove that little snippet.

    Here's my real problem: Doors!

    I just can't seem to get the code right. If the char even moves near the door space you automatically go to the next map. I don't want that. What I want is for the char to actually stand ON the space and THEN go to the next map.

    I think Tonypa said that I don't need to change the code but shouldn't you have to convert it to iso? the code he had was for TBW.

  4. #4
    curiouser and curiouser LittleRed's Avatar
    Join Date
    Mar 2004
    Location
    Nottingham
    Posts
    335
    In my door detection code, I first test to see if the hero is over the door tile, and then do the pythogoras distance test that Tonypa uses for the collision between hero and enemy, but testing the distance between the hero's centre and the door tile's centre. That way I know that the hero is roughly in the centre of the tile, and hasn't just got one corner over the tile.
    Last edited by LittleRed; 05-24-2004 at 06:40 AM.

  5. #5
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    You can try
    code:

    if (game["t_"+ob.ytile+"_"+ob.xtile].door and ob == _root.char) {
    if(ob.x%game.tileW==0 and ob.y%game.tileW==0){
    // make new map
    changeMap(ob);
    }
    }



    Note, that your stairs object wont work correctly:

    game.Tile13.prototype = new game.Doors([game.currentMap-1], 1, 4);

    this will be run in the start of the game, and game.currentMap is not later updated. So if the game starts at floor1, then all the stairs going down will send you to floor0.

  6. #6
    curiouser and curiouser LittleRed's Avatar
    Join Date
    Mar 2004
    Location
    Nottingham
    Posts
    335
    nice - that's a much more elegant (and I guess, quicker!) solution

  7. #7
    The Last Starfighter
    Join Date
    Feb 2004
    Location
    The Tower of Babble
    Posts
    96
    ok here's what I got so far. THe stair code Tonypa gave m worked like a charm. I fixed all the door codes by giving each stair its own tile in the door code. I don't know if that's an easy way to do that but It works for me.
    Now I have a few more problem that I keep seeing.

    my "teleporters are up against the walls, but they look like they are in between the floor and the wall. kinda like its wedged under the wall.

    The other problem is that all of the objects i have in the floors look like they're levetating off the ground. the char kinda goes under them. I tried fixing the depth code but it won't work.

    I also want the character to be the same height as the tiles. He looks so small compared to the objects.

    so far those are my biggest problems

    check out the swf here
    http://www.geocities.com/babblemansion

  8. #8
    curiouser and curiouser LittleRed's Avatar
    Join Date
    Mar 2004
    Location
    Nottingham
    Posts
    335
    the characters height shouldn't be a problem - as long as you've centred the clip to his feet (and all depth sorting is done to this centre), then you can make the character's height anything you want.

    I think the character moving under the objects (like the candle sticks) could be corrected in your collision detection, so that he doesn't move close enough to look like he's under the object.
    Of course, if you need objects that he can move over, then you'll need to carefully depth sort by the objects _y value

    one thing that I find odd, is that the character moves down a stair in the far corner but then appears on the next floor a distance away from that. I think it would be better if the character appeared in the tile next to the stair
    Last edited by LittleRed; 05-25-2004 at 03:40 AM.

  9. #9
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    I noticed your char is not centered to the tile. It should look like this (picture attached).

  10. #10
    The Last Starfighter
    Join Date
    Feb 2004
    Location
    The Tower of Babble
    Posts
    96
    maybe that has something to do with why it looks a little wrong.

    I still haven't got right yet is the npc placement. I am trying everything known to man from using them as tiles with a purpose to using tonypa's stupid enemy tutorial. Using that one made the npc up in the air nowhere near a tile it should be. maybe i calculated it wrong. it probably needs to be written like the main character placement, and call a function for its brain.

    any comments or help is very appreciative. I even took a look at edmack's iso world, but he uses XML to store his maps. that's something I haven't fooled around with it much.

    I just want to let everyone know that they have helped me along through my rough spots and even help fine tuning it.

    I have a working on geocities, but most of the tile work is done by my assistant damien, who is not right in the head. I will make the fial tiles when it's ready for the web.

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