Posted By: boyax
vec_to_screen problem - 09/03/09 08:46
Hi,
I want to do is that if the entities/objects in my level are not visible in the screen I don't want to play/move the objects...
Ex. code:
But the code above is not working.. I put the "flagCowTest" to know if the cow animation is played and the code is executed.. but when it's already rendered on screen the cow animation code is not executed...
I don't know why? If you have some idea, pls. let me know.
Thanks
I want to do is that if the entities/objects in my level are not visible in the screen I don't want to play/move the objects...
Ex. code:
Code:
//-------------------------------------------------------------------- // Action: Cow //-------------------------------------------------------------------- action act_cow() { VECTOR vecTemp; vec_set(vecTemp.x, my.x); var anim_percentage = 0; set(my, POLYGON); while(1) { while( vec_to_screen(vecTemp, camera) != NULL) //visible to screen { flagCowTest += 1; ent_animate(my, "CowEat", anim_percentage, NULL); anim_percentage += 2 * time_step; anim_percentage %= 100; wait (1); } wait(1); } }
But the code above is not working.. I put the "flagCowTest" to know if the cow animation is played and the code is executed.. but when it's already rendered on screen the cow animation code is not executed...
I don't know why? If you have some idea, pls. let me know.
Thanks