famiies and layers collision problem (classic)

This forum is currently in read-only mode.
From the Asset Store
Perfect Particles
$2 USD
80% off
Particles support animations, collisions, effects and etc.
  • 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

  • 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.

  • 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..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Anytime

  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)