Page 1 of 1

Actor turning

PostPosted: Thu Jan 12, 2006 5:55 pm
by Troodon
:oops: I know that this can sound stupid for you pros, but how can I turn my actor. I meen that how can I make this:

1.a car is driving and we see it from up
2.when I press for example -space-, it will shoot a ball from one cannon in front of the car
3.when I press -right- the car turns to right
4.after turning the car 90 degrees, I press -right- and the car shoot the ball from the cannon, not from the left side of the car

Please answer in my email: mike.touati@gmail.com

PostPosted: Thu Jan 12, 2006 7:36 pm
by makslane
After change the car animation from right to left, you need change the shoot direction.

Some thing like this:
Right: xvelocity = 5;
Left:xvelocity = -;

re:

PostPosted: Fri Jan 13, 2006 1:28 pm
by Troodon
Thank you!

re:

PostPosted: Fri Jan 13, 2006 3:36 pm
by Troodon
er...Must I change animation and all actor events if I want to rotate my actor?

PostPosted: Fri Jan 13, 2006 4:01 pm
by makslane
Go to the Help menu, and look the tutorial:
Demo Making Of -> Platform Game

re:

PostPosted: Fri Jan 13, 2006 4:52 pm
by Troodon
I've looked all the tutorials wich are available and I don't mean that. I mean that when I press one button in the game mode, the actor rotates 360 degrees without changing the animations.

PostPosted: Fri Jan 13, 2006 5:12 pm
by makslane
You can't rotate the actor, sorry.

re:

PostPosted: Sat Jan 14, 2006 7:52 am
by Troodon
I downloaded your asteroids game where the ship turns with animation forward and animation backward events. But the most amazing thing it's that the ship shoots the shot allways from the front of the ship. Eden when the ship turns. I found this code in your shot, is it this the code with makes shot fly in the right direction?
angle = (ship.animpos/ship.nframe)*360.0;
directional_velocity = 10;

PostPosted: Sat Jan 14, 2006 3:59 pm
by makslane
Yes, with this code you tell to shot actor to move in the direction pointed by the current frame animation in the ship actor.