Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, alibaba, 7th_zorro, 2 invisible), 1,034 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 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 | chip programmers | 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