The Daily Click ::. Forums ::. Klik Coding Help ::. is there a way of detecting whether an object is in the 'active' window or not in TGF?
 

Post Reply  Post Oekaki 
 

Posted By Message

OscarS



Registered
  10/08/2005
Points
  6
11th August, 2005 at 11:32:55 -

im working on a spawn system where there are a number of invisible spawn points and a counter which swiches fast between 0 and any number dependign on how fast i want the monsters to spawn if the number is 1 to 5 and there are less than a certian number of monsters in the level a monster will spawn at the corresponding spawn point, ive got it working ok but im having problems with monsters spawning at points which arnt visible on the current scroll area, is there a way to set it so for example a monster will only spawn at a spawnpoint if the spawnpoint is in the active area or if the point is within a certian distance from the player (and im trying not to use too many huge active objects so it runs ok on slower computers too)

thanks

 
n/a

hishnak



Registered
  18/04/2004
Points
  994
11th August, 2005 at 14:02:49 -

Simple.

Spawn point X is less than X cordinate of right visible edge
+Spawn point X is greater than X cordinate of left visible edge+ Spawn point Y is less than Y cordinate of bottom visible edge+ Spawn point Y is greater than Y cordinate of top visible edge.

This will make it so enemies can only spawn if there in the visible area. Keep in mind that the Y axis is inversed in TGF.

To get to the cordinates of the visible edges just go to the Cordinates of the player then retrieve data from the storyboard icon--Play field. Hope this helped.

 
I'm feeling a bit wella
   

Post Reply



 



Advertisement

Worth A Click