Using sprites

Posted By: Realspawn

Using sprites - 10/09/15 23:35

i am trying to use the bouncing script on a sprite. However
the sprite does not appear flat but gets rotated 90 degrees. The game is top view dus de sprite has to be visible while now its not.

how to i change this script so it will work ?
any ideas ? I tried pan tilt and roll settings but no effect.

Code:
function bounce_off() // ball's event function
{
vec_to_angle(my.pan, bounce); // change the direction as expected from a "real" ball
my.pan += 5 - random(10); // add some randomness at each collision (don't allow the ball to get stuck)


}


action my_sprite() // attach this action to your ball
{
my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY); // the object is sensitive to block and entity collisions
my.event = bounce_off;

while(1)
{

c_move(me, vector(5 * time_step, 0, 0), nullvector,  IGNORE_PASSABLE | GLIDE);  // move ahead, in the direction given by the pan angle
wait(1);
}
}

Posted By: 3run

Re: Using sprites - 10/10/15 11:37

As far as I know, when you change any angle of the sprite, it won't rotate automatically to camera.

In order to avoid such situations I could advice you to use an invisible box model for sprite collisions and make sprite itself passable and attach it to that invisible "collision" box.

Greets laugh
© 2024 lite-C Forums