A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [help]how to make a water/lava tile...

  1. #1
    _One of a Kind_ j.manfogle's Avatar
    Join Date
    Aug 2005
    Location
    Philippines/usa
    Posts
    198

    [help]how to make a water/lava tile...

    hi
    well i'm making a tile based adventure game and all but i cant figure out how to make a life system or have a water/lava tile that if u go in u loose a life!

    any help would be very much appreciated!!
    thanks!!
    Fogle

  2. #2
    Feeling adventurous? T1ger's Avatar
    Join Date
    Mar 2004
    Posts
    850
    I don't know how experienced you are..

    But all you have to do, is to check wether the player is in such a tile or not, and perform the appropriate action. You serve no code, so it's impossible for us to give you code.. And we shouldn't either, it's basic flash if you can make a tilebased game...
    I don't have a photograph, but you can have my footprints. They're upstairs in my socks.

  3. #3
    _One of a Kind_ j.manfogle's Avatar
    Join Date
    Aug 2005
    Location
    Philippines/usa
    Posts
    198
    Code:
    game.Tile7 = function () {};
    game.Tile7.prototype.walkable = true;
    game.Tile7.prototype.frame = 5;

    ok thats my code for the lava tile and what i need is that when the hero goes in the lava i have to have him start back at the beginning of the present map he is on and loose a life would making it like a door work??

    and i am kinda experienced with flash i have been using it now for a little bit more than 5 months.
    Fogle

  4. #4
    Style Through Simplicity alillm's Avatar
    Join Date
    Mar 2004
    Location
    Wales
    Posts
    1,988
    add somting like
    game.tile7.prototype.damage = true

    then you can check to see if the tile the hero is on will damage you in the same way you would check to see if a tile is walkable.

    Not sure how your code is set out, so i cant help you with reseting the hero.

    Ali

  5. #5
    _One of a Kind_ j.manfogle's Avatar
    Join Date
    Aug 2005
    Location
    Philippines/usa
    Posts
    198
    cool thanks i messed around with it and it kinda works now!!
    Fogle

  6. #6
    Say hello to Bob Kakihara's Avatar
    Join Date
    Jul 2004
    Location
    kent, England
    Posts
    1,067
    Its just the same as what you have just shown, basically what Ali says would work and then just check the same way as you have done for the walkable tiles, then its just if it is hitting a damagable tile then reset the level, basically you already have placed the player before at the start of your game so do it again.

    Im guessing you are just copying and pasting Tonypas tutorials into a flash file if not you wouldnt need to ask this so do yourself a favour and actually learn the code.
    If our body is a clock ticking away and if while we experience all that this world has to offer time has still continued to pass, are we living or just experiencing a slow death?

  7. #7
    _One of a Kind_ j.manfogle's Avatar
    Join Date
    Aug 2005
    Location
    Philippines/usa
    Posts
    198
    i did get it from tonypa but i'm going over each bit of code so nxt time i dont have to get it from somewhere!!
    Fogle

  8. #8
    Say hello to Bob Kakihara's Avatar
    Join Date
    Jul 2004
    Location
    kent, England
    Posts
    1,067
    Im glad to hear it.

    Thing is you could have read about the prototype and checking for collision part of the code before you posted here and you would have sorted it yourself.

    No matter though, ive done this kind of thing myself a couple of times where I post here thinking I cant figure something out and then it hits me immediatley after a couple of minutes of mucking around with the code, you have to make sure you have tried everything.

    Good luck anyway.
    If our body is a clock ticking away and if while we experience all that this world has to offer time has still continued to pass, are we living or just experiencing a slow death?

  9. #9
    _One of a Kind_ j.manfogle's Avatar
    Join Date
    Aug 2005
    Location
    Philippines/usa
    Posts
    198
    No matter though, ive done this kind of thing myself a couple of times where I post here thinking I cant figure something out and then it hits me immediatley after a couple of minutes of mucking around with the code, you have to make sure you have tried everything.

    Good luck anyway.
    thanks!! and that's almost exactly what happened i was like in the middle of doing something els and wamm it hit me i was like wow how stupid am i!! lol
    well later
    Fogle

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