famiies and layers collision problem (classic)

For questions about using Classic.

Post » Sat May 23, 2015 8:07 am

Hi, I hope I can explain this well.

I am working on a top down scrolling shooter.

To prevent the Y scroll affecting the bullets, I have to use a seperate layer for them with Y scrolling at 0%

The player sprite and bullets are also on this layer to prevent any weird movement on Y as the speed of scrolling changes.

I have ground based enemies on the scrolling background but my player bullets are not colliding with the enemy family.

in short, my ground enemies are locked to the scroll, but my bullets are not, and I cant get them to interact via families..

Any suggestions?

thanks
B
10
S
4
G
5
Posts: 161
Reputation: 2,401

Post » Sat May 23, 2015 9:52 pm

Hmm, try doing this check instead:

+Bullet IsOverlappingAtOffset (Bullet.X, Bullet.Y + scrollY) with EnemyFamily
->Subtract Bullet.Value('Damage') from EnemyFamily.Value('HP')

The Bullet.X might need to have "+ scrollX", but it sounds like only the Y axis is locked on your layer. Overall I haven't tested this, but it sounds like it's having a problem getting the "world Y" that the bullet is supposed to be in, so this might be one way to convert it.
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Sun May 24, 2015 10:43 am

Thanks again Jayjay!!

I also have the reverse issue, where the destroyed enemies leave point pickup coins that home in on you to save moving around the screen too much to collect them - right now they zoom up off the screen because in the world, the player is right at the top of the screen.. :(
B
10
S
4
G
5
Posts: 161
Reputation: 2,401

Post » Sun May 24, 2015 2:04 pm

Anytime :) and sure to fix that do the same thing, instead of moving to Player.X and Player.Y have them go to Player.X and Player.Y + ScrollY, then do the Is Overlapping At Offset check again for player and coin :)
"Construct 4 lets YOU make advanced games! (but not play them)" Construct Classic - Examples Kit Dropbox is a pile of trash and if you need my old files PM me! :)
B
116
S
41
G
17
Posts: 2,204
Reputation: 19,545

Post » Sun May 24, 2015 3:23 pm

its a bullet that rotates toward the player , so how would I add this to a line such as

"rotate 12 degrees toward player"

might it be better to spawn the coin on the layer where the player is plus some kind of offset?? I dunno...

thx!
B
10
S
4
G
5
Posts: 161
Reputation: 2,401


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest