Bird eye view - dont walk through objects

Started by Rocco, Fri 23/11/2007 23:23:55

Previous topic - Next topic

Rocco

I'll use partially bird eye view in my next games, so i have one question.
How can i avoid chars from walking cross by objects or other chars?
The baseline is not enough to achive this.

Radiant

Have a different walkable area on the spot where an object might appear, and disable this walkable area when the object is there.

Rocco

im aware of that, but this is no option for me.

some objects are moving, and i also need a solution for overlapping chars.

Ashen

There's the Character and Object BlockingHeight/Width properties (e.g Character.BlockingHeight).
It'll form a rectangular area around the Character/Object the player can't enter (wich is already there if they're set to 'Sollid', but this'll expand it to cover the whole thing). It's not pixel-perfect unfortunetely, but it might do. Since BlockingHeight is centered on the Baseline (it'll be above and below it), you'll probably need to dynamically alter the baseline of moving Objects in the Room script - but that shouldn't be too hard.
I know what you're thinking ... Don't think that.

Rocco

big thx, this is what im searching for.  :)
i'll check this out.

Rocco

unfortunatly it wont work and i dont know why.

i have this code in before fade in:

oTro.Solid = 1;
oTro.BlockingHeight = 200;
oTro.BlockingWidth = 200;

oEdsel.Solid = 1;
oEdsel.BlockingHeight = 200;
oEdsel.BlockingWidth = 200;

but i can walk across the objects without problems, there is no block around the object (with 200 the 3/4 screen should be blocked)
any suggestion whats the reason?

Khris

Is the player character set to solid, too?

Btw, you can do something like this in rep_ex:

Code: ags
  int i, h;
  Object o;
  while(i<Room.ObjectCount) {
    o=object[i];
    h=Game.SpriteHeight[o.Graphic];
    o.Baseline=o.X-h/2;
    o.BlockingHeight=h;
    i++;
  }

Rocco

#7
yes, the playercharacter is solid.

thanks for the snippet, this might come in handy later on.

edit: gamesources sent


Shane 'ProgZmax' Stevens


SMF spam blocked by CleanTalk