Need character to walk backwards [SOLVED]

Started by NiksterG, Mon 14/08/2006 21:51:23

Previous topic - Next topic

NiksterG

In my game, the main character climbs up a ladder, and then back down again later. The going up part is easy; I just have cplayer.walk(...) and he goes the right way. But when he comes down again, he's not facing the ladder. I tried using FaceLocation before he moves, and I also tried animate the character and move him at the same time. These didn't work. Any suggestions?
Check out my games! (Not all made with AGS)

Arcangel

#1
Character.FaceLocation(int x, int y, optional BlockingStyle)

If need to look some object before (your ladder)
Character.FaceObject(Object* object, optional BlockingStyle)


Down the ladder (Character back) maybe you need to change the view
Character.ChangeView(int view)

Or move the animation in (Backwards)
Character.Animate(int loop, int delay, optional RepeatStyle,
                  optional BlockingStyle, optional Direction)

NiksterG

I tried to do what you suggested, changing the blockingstyle and objects, and I tried having it in repeat, among other things. They don't work. The only thing I can think of doing is making a whole new view, but I don't want to do that unless absolutely necessary. Isn't there some way I can change the character.x value or something while he's moving to make him face a certain direction? The best way I can describe it is having the character do a moonwalk.

Also, i have a question about blinking views. I want there to be a bird which is always in the air. In other words, when the bird is not moving anywhere (standing), I want him to be flapping his wings repeatedly. I tried to use blinking view and the blinkinterval property, but it doesn't make the player do anything. Is that because the blinking view can't be the same as the normal view?

Thanks for any help.
Check out my games! (Not all made with AGS)

Alynn

#3
Not tested but this should work... or at least point you in the right direction

player.Animate(3, 1, eRepeat, eNoBlock);
while (player.y < yValueYouWantToMoveTo) {
Ã,  Ã, player.y++;
Ã,  Ã, Wait(1);
}


You may or may not need the wait there to make it look right, and you will most likely have to play with the start and end y values to get him centered, but it should work. Just make sure the player isn't moving before you do this.

EDIT:

Also for your question about blinking view,  use the idle view instead and set the idle interval to 0. The bird will now constantly flap his wings.

Ishmael

Just create a new view where the loop you're now see as the backward one is the same, but flipped, and change to that view before he climbs down the ladder, and back when he's down.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SSH

12

Arcangel

#6
lol

What AGS version u use?
Its possible to view part of your code. (Character down ladder)

NiksterG

Thanks alynn, I tried your code, and after a little bit of editing (adding a lockview to stop animation) I got it to work perfectly. And thanks for the idleview help, too... I wouldn't have checked there  :P

Thanks everyone else for your help!
Check out my games! (Not all made with AGS)

SMF spam blocked by CleanTalk