It looks like you're new here. If you want to get involved, click one of these buttons!
[CarObject]
Graphic = CarGraphic
Position = (300, 200, 0)
Speed = (0, 20, 0)
UseRelativeSpeed = true
[CarGraphic]
Texture = car.png
Pivot = (28, 10, 0)
car = orxObject_CreateFromConfig("CarObject");
orxSTATUS orxFASTCALL Run()
{
...
if(orxInput_IsActive("Left")){
orxFLOAT rotation = orxObject_GetRotation(car);
rotation += 0.01;
orxObject_SetRotation(car, rotation);
}
...
}
Comments
I updated the phrasing in CreationTemplate.ini to reflect that.
Regarding your options, I can see two main ones:
1. Retrieve the relative speed before rotating your object and re-apply it afterward
2. Manually rotate the speed as well, which will allow you to dissociate the orientation from the speed if that's something desirable with your design. This option is also slightly more efficient, performance-wise.
Here are some quick code examples:
1.
2.
I've placed both examples over at:
http://orx-project.org/wiki/examples/objects