Gamestudio Links
Zorro Links
Newest Posts
Fun Arcade Car Physics (nfs style)
by Ezzett. 08/02/26 21:11
ZorroGPT
by TipmyPip. 07/31/26 22:56
Wolfram Mathematica with Zorro
by TipmyPip. 07/30/26 02:07
What are you working on?
by rayp. 07/24/26 22:58
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
New Zorro version 3.11
by jcl. 07/21/26 13:42
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,512 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
vec_to_screen problem #287919
09/03/09 08:46
09/03/09 08:46
Joined: Mar 2009
Posts: 276
Cebu City, Philippines
boyax Offline OP
Member
boyax  Offline OP
Member

Joined: Mar 2009
Posts: 276
Cebu City, Philippines
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:
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

Re: vec_to_screen problem [Re: boyax] #287922
09/03/09 09:23
09/03/09 09:23
Joined: Aug 2007
Posts: 1,922
Schweiz
Widi Offline
Serious User
Widi  Offline
Serious User

Joined: Aug 2007
Posts: 1,922
Schweiz
use the CLIPPED eflag to see if the entity is on the screen or not


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1