Max Layout Size / Object Count?

For questions about using Classic.

Post » Wed Oct 20, 2010 4:00 pm

[quote="madster":27z58xb1]Does "is on screen" account for rotated zoomed layer plus rotated zoomed system crazyness? 'cause I'm using a lot of that >_<[/quote:27z58xb1]

It doesn't work with zooming, haven't tried rotating.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Wed Oct 20, 2010 4:03 pm

guess I'll stick with my distance-based filter instead of "is on-screen"
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Oct 27, 2010 11:56 pm

Makes me wonder though if it optimizes it at all, since it has to be tested on all the trees, and calculating square roots isn't exactly all that fast. And surely collision detection starts with bounding box testing, so that if bounding boxes do not overlap, no per-pixel calculation is done. And I'd think bounding box overlaps would be a lot faster to calculate for all trees compared to their distance to player.

But if you really want to do some sort of distance checking, I think something like this (using Is number between) would be more optimized:

Is tree.X between player.X-ScreenWidth/2*Zoomlevel and player.X+ScreenWidth/2*Zoomlevel
Is tree.Y between player.Y-ScreenHeight/2*Zoomlevel and player.Y+ScreenHeight/2*Zoomlevel
-> Check for overlap
B
16
S
8
G
4
Posts: 136
Reputation: 3,144

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests