How to get a good framerate with large collisions?

For questions about using Classic.

Post » Fri Feb 08, 2008 7:47 pm

I have a laser in a game I'm making that is the length of the screen, and aims in 360 degrees. It runs smoothly until I try to test for collisions. I tried box collisions, but the collision box doesn't rotate with the laser, and results in incorrect collisions. Any thoughts?
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Fri Feb 08, 2008 8:37 pm

You want to make like "Laser Pointer" for a gun or something like that?
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Fri Feb 08, 2008 8:51 pm

Close enough (it acts similarly), but it needs to shoot stuff. The game runs smoothly until an enemy comes within the bounding box of the laser and construct starts testing per-pixel collisions.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Fri Feb 08, 2008 9:07 pm

Ok i get it, Here's an example of the laser killer stuff :P
[url:2lm4chiq]http://www.sendspace.com/file/kqs5aj[/url:2lm4chiq]
Laser and Targets have Collision per pixel.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Fri Feb 08, 2008 9:26 pm

That's what I tried - I miscommunicated, sorry. What I mean is how can I do it without dropping the frame rate? You example seems to run smoothly, but in the game I'm working on, at 800x600 and with a larger laser, doing that causes the framerate to go from 120fps to about 10.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Fri Feb 08, 2008 9:28 pm

How big the laser is from beggining? if its small? mine is 32x32 then i stretch it.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Fri Feb 08, 2008 9:31 pm

The graphic itself is about 300x100, and it's stretched to the length of the screen. Construct has no problem displaying it at all, it's the collisions that cause the frame rate to be at 10fps, because when there are no enemies on screen it runs smooth as silk.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Post » Fri Feb 08, 2008 9:32 pm

Doppels example ran fine on a laptop with no real video card at 800 x 600.

Is it still slow if you build an exe, close Construct and run that?
B
2
S
2
G
5
Posts: 391
Reputation: 2,432

Post » Fri Feb 08, 2008 9:32 pm

Hmmm i can't figure it out @_@. Maybe post screenshot or better a .cap itself.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Fri Feb 08, 2008 9:38 pm

Same framerate issues with an exported .exe. I'll make a .cap.
Moderator
B
88
S
32
G
33
Posts: 3,005
Reputation: 27,432

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests