Is there a script for pictures, making them rotate in a certain angle?
I only found this script call:
$game_screen.pictures[picture number].angle = angle
It only is shows the pic. But i want it to rotate continuously to it's new angle.
You have to keep calling this code repeatedly and increasing the angle every time. You can use a variable for that, it makes things simpler.
Unfortunaltely I don't know how to put a variable in a script. :^_^':
$game_screen.pictures[picture number].angle = $game_variables[variable ID]
Is it possible to make a normal movement, too?
What exactly do you mean? Moving the picture around? Yes, it is.
$game_screen.pictures[picture number].x = $game_variables[variable 1 ID]
$game_screen.pictures[picture number].y = $game_variables[variable 2 ID]
Ok, that's good, too. But I meant something different:
The picture should move within a specific time from its actual angle to a new angle, released by a single script call. I don't want to animate it like this:
> Wait for 1 second
> Angle +1
> Wait for 1 second
> Angle +1
> Wait for...
I want it to be like:
> Rotate from actual angle to new angle within 10 seconds
It would require a Real (decimal number) to keep track of the increments. But it's basically
- Get current angle and target angle and find their difference
- Divide this difference by (time_in_seconds * 40)
- Every frame, add/subtract the current angle by the amount you calculated above
I guess you could also event it, although it won't be perfect, by doing
- Get current angle and target angle and find their difference => Store in Variable 1
- Calculate how long it should take in frames (time_in_seconds * 40) => Store in Variable 2
- Divide variable 2 with variable 1
- Create Variable 3 and set it equal to Variable 2
- Parallel Process: Decrease Variable 3 by one. Conditional Branch: if Variable 3 is less than or equal to zero, set Variable 3 to Variable 2 and increase/decrease picture's angle by one
- Repeat until desired angle, then stop