A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [Disc/Ideas] Isometric Sidescroller

  1. #1
    the Dervish of Q??
    Join Date
    Mar 2004
    Location
    Abbotsford, BC
    Posts
    103

    [Disc/Ideas] Isometric Sidescroller

    Right now I'm working on something I've never seen implemented before in Flash, an isometric sidescroller, sort of like the old arcade games. Sorta like Teenage Mutant Ninja Turtles on NES. Anyways.

    I'm looking for ways to do hit detection. I have some ideas right now, but I would like to hear some of your ideas about it too. I can't really do tiles, since it would make it very difficult and impractical. Plain old hitTesting won't work either, since then you could be at the bottom of the screen, jump, and attack and you could hit a guy in the middle. Right now I'm shooting for a bounding box 3d system. I'd like to hear some input and ideas on it.

    Link: http://qdervish.netfirms.com/iso_scroller.html

    Ideas!


    Derek

    P.S. Please excuse the graphics, as they're all hand-drawn with the mouse, and we all know that sucks.

  2. #2
    Senior Member sand858's Avatar
    Join Date
    Aug 2001
    Posts
    327
    Bounded 3d boxes? Yikes.. I think that might be overkill.

    The old TMNT/Simpsons/Moonwalker style arcade games probably did little more than 2d circle v. world v. object collisions. I don't see *at all* how 3d collisions are gonna add to the experience of your game here.
    gamedozer games
    Free multiplayer and singleplayer games

  3. #3
    the Dervish of Q??
    Join Date
    Mar 2004
    Location
    Abbotsford, BC
    Posts
    103
    Ok. Maybe it is a little overkill.

    For movement, I wasn't GOING to do anything more than a 2d square. But for collision between, say a fireball and a monster, just a 2d square or circle won't really do the job. For 3d bounding boxes, its just 6 2d squares rather than 1. Also I might use sphere to point intersection since that has an easy formula.

    The whole isometric engine basically hinges on 3d anyway, so it wouldn't take much to add 3d bounding boxes...

    Do you have any other ideas on how I would do it without 3d boxes?


    Derek
    Last edited by Q Dervish; 09-23-2004 at 08:42 PM.

  4. #4
    Senior Member tonypa's Avatar
    Join Date
    Jul 2001
    Location
    Estonia
    Posts
    8,223
    If you would use tiles, then you could do all the hittesting in the plain 2D tiles world and avoid all the complicated stuff.

    But if you dont like tiles, then you can still check the x/y coordinates of objects. If you imagine looking straight down into your game, then each objects can be represented as basic rectangle. You can check collision of 2 rectangles, if you know their corner coordinates, and you do know the coordinates because they are drawn on the screen.

    Lets say you hero would be 60x30 px rectangle at x=10 and y=100. The bush is 20x10 px at x=100, y=100. All you need to do, is to find out if those 2 rectangles collide.

    Picture attached.

  5. #5
    the Dervish of Q??
    Join Date
    Mar 2004
    Location
    Abbotsford, BC
    Posts
    103

    tonypa posted in my thread...

    Hi.

    I'm not opposed to tiles at all, its just I don't really think they would mesh with the ideas I have in mind. Since it's in semi-3d, tiles don't really show all that needs to be hit-tested. Elevation, for example. Maybe you could add an elevation property to the tile? And I know for sure I don't want to have it rendered tile-wise, as that would be too restrictive.

    But, the methods I use to display objects isometrically, and do depth sorting, are very conducive to hit testing a rectangle. Since I keep track of all x, y, and z values, its really quite simple to add the character's width and depth to calculate max and min, width and depth. Make sense?

    In fact, the more I think about this, relatively to a super-imposed tile based system, the more sense it makes. It seems like, using some of the code modified from your tutorials, I could pull off some of the hit detection much easier than I thought. Even some of the rendering *could* be done like that.

    But still, there's the object to object testing. I'm not sure how I'd go about that. Which was really my main issue the whole time... The only way I can wrap my mind around doing that is SOME sort of bounding box system. That's basically how tile-based systems work (I think). Get the corners, check if the point is within them. Just add another dimension.

    Just me thinking here.

    Derek

  6. #6
    Feeling adventurous? T1ger's Avatar
    Join Date
    Mar 2004
    Posts
    850
    Good ol' hitTest does the trick! Just hitTest the exact same way as if it was not-3d-emulated, in other words a normal sidescroller, and then again check for the depth of the player versus the depth of the bullet.

  7. #7
    the Dervish of Q??
    Join Date
    Mar 2004
    Location
    Abbotsford, BC
    Posts
    103

    Brilliant!

    Wow! That's it! Thanks T1ger, guess you just had to think outside the bounding box (hehehe guess how long it took me to come up with that one). That just about cleans it up!

    In other news, the tile-based char to world hit testing is done. A little messy, maybe, but it works. I'm working on a fix as we speak. Check out the latest version at:

    http://qdervish.netfirms.com/iso_scroller_ver_0_1.html


    Right now you can go into infinity into the sun, and down too, but the hit testing works. That's what counts.

    Thank you everybody for your input, suggestions and ideas! I'll keep you updated on the progress of the engine!

    Derek
    Last edited by Q Dervish; 09-26-2004 at 01:17 AM.

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