Rotate Layer

0 favourites
  • 7 posts
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • I'm building a top-down style helicopter game where the Up/Down arrows control the sprite, up and down. Left and right arrows rotate the BG clockwise and counterclockwise. There are three layers (Background, Main and UI).

    My question is how can I spawn bullets from my helicopter on the main layer towards destructable buildings on the Background layer? Impossible?

    The two methods I tried:

    Spawning the bullets on the background layer. I couldn't get the angle of trejectory to match the helicopter angle. Rather than shoot at the angle of my helicopter (on a different layer) the angle would be inverted.

    Then I tried putting the buildings on the main layer with the helicopter. When on screen, the buildings would rotate around their set postion. I couldn't get the sprites to mimic the rotation of my background layer.

    .capx- http://c2.originalspaces.net/apache.capx

    Buildings at y-axis 3400 (fly north). The two event sheets "Apache Controls" and "Game Events" contain the relevant actions.

    Controls: Up, Down, Left, Right, Ctrl, Space

  • I changed one of the bullets to spawn on the backgroudn an it seems to work as expected....

  • Event 24 of "Apache Controls" - If I change that to spawn on layer 0 the bullets always go up or -90 degrees on the background. They don't spawn from the angle that the helicopter is facing.

  • Or don't use layer rotation, just rotate the helico and make the layout angle follow the helico angle (:

  • This problem has similiraties with the one evoked in this topic.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for pointing that out along with the example Kyatric. I had stumbled upon that topic before but didn't realize how closely it related to the issue I'm having.

    I tried implementing your workaround in my situation (spawning collision masks on the main layer over the buildings in the background). However the collision masks aren't tracking with the background rotation correctly. I can't find the CM's now but did catch a glimpse of one flying past my helicopter.

    Updated .capx- http://c2.originalspaces.net/apache.capx

    Refer to "Game Events"

  • I was re-reading the info here and I think Yann had the right idea. That's my next best bet at least.

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