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!!
Printable View
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!!
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...
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.
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
cool thanks i messed around with it and it kinda works now!!
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.
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!!
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.
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!! lolQuote:
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.
well later