Alternative to collision polygon?

Get help using Construct 2

Post » Tue Feb 12, 2013 12:12 pm

Hi guys im making an orthographic citybulder kinda.

My problem is that for each building i have collision polygon at the base of the building to use for pathfinding.

But when the building is taller it doesnt feel better, cant easily select the building.

So is there a way to select that building by, for example, the visible pixels or something?

The only thing i came up with was to attach emty object with another collision polygon, but as i plan to have many of that objects, im worried for the performance.

Here is an example of what i mean.

So guys, any ideas?
B
12
S
3
G
1
Posts: 120
Reputation: 1,829

Post » Tue Feb 12, 2013 12:22 pm

You could use single tiles for pathfinding and collisions, and seperate sprites for buildings on top of them.
ImageImageImageImage
B
140
S
58
G
36
Posts: 2,547
Reputation: 31,170

Post » Tue Feb 12, 2013 1:51 pm

Thanks for the reply
Though im not quite sure i do understand you.
I think you mean to have 2 objects right?
Im concern about the object count in later stages of the project, because i plan to have quite. But still it sounds as the only way...

B
12
S
3
G
1
Posts: 120
Reputation: 1,829

Post » Tue Feb 12, 2013 4:13 pm

Yes, or you can have collision checks that test if the player is higher than a certain y value of the building and if so move the building up or down a layer depending on if you need it in front or behind the player. Someone posted a system for doing this in the forums I just don't have the link handy.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,428

Post » Tue Feb 12, 2013 11:01 pm

Yeah nice approach
Dont thing will work for me because for z order i use a plugin, so all stuff should be on 1 layer. But anyways that is good trick to learn
Thanks
B
12
S
3
G
1
Posts: 120
Reputation: 1,829

Post » Tue Feb 12, 2013 11:15 pm

Disable collision for visible sprites, you should create another sprite or tile background as "helper" fill the sprites that you would adjust the collsion and it must be invisible, it would work.
B
96
S
25
G
20
Posts: 3,055
Reputation: 22,646


Return to How do I....?

Who is online

Users browsing this forum: Callan S, gamecorpstudio and 11 guests