1
Technical forum / Moving a sprite?
« on: July 22, 2009, 11:32:53 AM »
OK I may be doing this very badly since our game is 3D so we have not looked at sprites and stuff much at all.
We have a character that wants to throw something. So we figured we'd just have a 3D model with a 'throwing' animation and once it plays we'll draw a sprite to screen and then use a loop to movie it across the screen till it gets where it needs to be.
So I made an entity which contains the image of the thrown item, and in the script I have this code:
Is there a more elegant or better looking way to do this?
We have a character that wants to throw something. So we figured we'd just have a 3D model with a 'throwing' animation and once it plays we'll draw a sprite to screen and then use a loop to movie it across the screen till it gets where it needs to be.
So I made an entity which contains the image of the thrown item, and in the script I have this code:
Code: [Select]
var thrown = Scene.LoadEntity("entities\item\item.entity");
thrown.SkipTo(4355, 725);
thrown.Visible = true;
while(thrown.X != 4665)
{
thrown.SkipTo((thrown.X + 10), 725);
Sleep(100);
}
Is there a more elegant or better looking way to do this?