The Daily Click ::. Forums ::. Klik Coding Help ::. Objects move offscreen, ignoring collisions
 

Post Reply  Post Oekaki 
 

Posted By Message

KlikFactory



Registered
  11/01/2002
Points
  692
29th January, 2004 at 22:20:57 -

Okay I have some enemies in my level (surprise). They use ball movment, and basically they bounce up and down and back and forth.

When they are on the screen they work just like they're supposed to.

However, if I put an enemy further in the level where it starts offscreen, it simply ignores events that tell it to bounce off the backdrop and falls out of the level.

I've messed with Object Properties but nothing works. It seems like this SHOULD be really simple. Any advice?

 
Why's there a star next to the Sig? What if I don't want a sig? This sucks.

KlikFactory



Registered
  11/01/2002
Points
  692
29th January, 2004 at 22:39:09 -

Thanks a lot for the fast reply!

I knew I'd done it before, but I forgot how.

Really, thanks. This was holding me back from working on it more tonight but now I can.

 
Why's there a star next to the Sig? What if I don't want a sig? This sucks.

Cybermaze



Registered
  03/04/2003
Points
  853
2nd February, 2004 at 05:50:49 -

Only calculating collisions onscreen (in small resolutions like 320*240/640*480 etc) is WAY faster than calculating collisions offscreen (often large areas as 4000*5000 or something).

Thats why ... Most of the time you really only need to calculate things onscreen. What happens offscreen should not matter. When the player moves away from enemies (they go offscreen) simply deactivate them (stop them) and activate them again when they come onscreen.

 
If you knew, I would have to kill you...

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
4th February, 2004 at 04:18:31 -

That dosen't work if your using interia, The objects x/y position
is still altered even when the inactive if far from window is on.
(This has killed my plans many times.)

Also, If you have timed shooting, the objects shoot when inactive, leaving
20-30 shots waiting for you when you approach a baddy.

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click