move character exactly along with other character at a certain distance

Started by spook1, Mon 21/11/2005 12:01:31

Previous topic - Next topic

spook1

I have a vehicle which can be steered by dahusting the wiring during driving./

Therefore I need a set of characters (I have too many for objects to be used, > 20) to move IN FRONT (drawn on top) of the vehicle.
These characters must move exctly along with the vehicle. E.g. the headlights must move along.

The trick with cCharacter.x = cMain.x + offset works quite ok, except that the cCharacter moves just after the main character.
It is drawn behind the main caharacter.

Any suggestions on how to do this would be greatly appreciated.

martijn

Elliott Hird

I can't help you, but I think you're making it FAR too complicated.

Maybe use FollowCharacter?

spook1

No offset is available in follow character.
That's why.

It is not really complicated:

all I need to do is figure out the cMain position (cMain.x, cMain.y) and place the active characters at the corresponding coordinates.
This can be done is a small loop.

Clicking the character will rsult in it turning trnasparent, clicking again will undo the transparency.

Quite simple I would think, but the small AGS typic problems prevent it from working correctly right now :-(

Ashen

You should be able to use the Character.Baseline property. Just set the clickable characters baselines to be 'lower' than cMain's (e.g. cBlah.Baseline = cMain.y + 1;) and they should appear on top (you'll need to refresh that, when you update the x,y coords). You might have to make it lower (on screen) than cMain.y +1, though - if you set it too close to cMain.y, it might be shown behind, when cMain is moving down the screen. You'll just need to try that out.
I know what you're thinking ... Don't think that.

Bernie

Hmm... are you controlling the vehicle with one of the .Walk() commands or controlling it directly with the X and Y-values? Also, is anti glide-mode on?

SMF spam blocked by CleanTalk