PDA

View Full Version : ideal wall code



nico
May 5th, 2006, 10:44 PM
can you give me the ideal wall code for an rpg game. thanks!!!!

lone_wild_wolf
May 5th, 2006, 11:03 PM
well it wold help if you tell us about it a little more!

Templarian
May 5th, 2006, 11:20 PM
^What he means is it Tiled/Art/Tiled+Art Based Movement.

You probably mean Art. Search HitTest.

nico
May 6th, 2006, 12:24 AM
oops sory, yeah its an art based game, not tile based.

SacrificialLamb
May 13th, 2006, 12:15 AM
i to am also currently making an Art Based RPG. But I feel I should worn you that I am very new to flash (started early this year). This is the script that I attach to every thing that the player hits and can’t move over. The “_root.mane_man.hit_left” is one of 4 rectangles (_alpha=0 so you can’t see them) that are around him. But now that I am trying to get the monsters to move I am finding it hard to work out how to hitTest them with every object and each other.
All the best for your game



// things that go bump
onClipEvent (enterFrame) {

if (this.hitTest(_root.mane_man.hit_right)) {

_global.Mright = 1;
tapr = 1;
} else {
if (tapr == 1) {
tapr = 0
_global.Mright = 0;
}
}
if (this.hitTest(_root.mane_man.hit_left)) {
_global.Mleft = 1;
tapl = 1;
} else {
if (tapl == 1) {
tapl = 0
_global.Mleft = 0;
}
}
if (this.hitTest(_root.mane_man.hit_up)) {
_global.Mup = 1;
tapu = 1;
} else {
if (tapu == 1) {
tapu = 0
_global.Mup = 0;
}
}
if (this.hitTest(_root.mane_man.hit_down)) {
_global.Mdown = 1;
tapd = 1;
} else {
if (tapd == 1) {
tapd = 0
_global.Mdown = 0;
}
}
}

nathan99
May 13th, 2006, 09:24 PM
http://www.n99creations.com/?pID=archives&col=Blue&arch=getBounds_as_walls

is one method for walls.. dont think it would be the best.. but its better than most