Pin Sprite to Player Issue Between Layers

0 favourites
  • 5 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Hi, all!

    I'm working on a platform game and I'm having some issues bringing my player character from one layout to another or keeping my character sprite at the top layer while the Player sprite is below it. Going between the "Dying Screens" (aka Level1Dead and TrainingDead) and the previous layouts is sometimes ok but there are issues where the sprite Darius doesn't pin at the exact position as the Player sprite as it was when you initially play.

    The bug some of my testers came up with is the fact that between Layouts Level0 and Level 1, the "Player" is active, but the Darius sprite is either not pinned properly (it's not positioned properly compared to the player sprite) or even worse, the Darius sprite is not visible at all.

    Here's a CAPX file of the project I'm working on. I tried many eventsheet combinations but came up with the same result:

    dl.dropbox.com/u/42828331/Journey%20of%20Darius/JoDv2.capx

    What's a better way to go about transitioning between layers without having these issues?

  • I have looked at your CapX, and the problem was that, after completing the first level when you tell the game to start ignoring player's input and wait 8 seconds, you moved the Player sprite's position but you didn't move the Character's position. they are two different objects so moving the Player's position does not automatically move the character's position, it only does that if the Player sprite is moving pixel by pixel on screen.

    I have re-uploaded your CapX with a comment above the changed Event:

    http://www.sendspace.com/file/7x4wok

    hope that helps. and nice game :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Things seem to be fixed, however, I have a feeling I may have to adjust my image points as the sprite still goes off a bit after Darius dies or if he transitions between layers. Is there an alternative if this doesn't work? I also think I may have to re-adjust sizing and image points for my character and player so they're the same. It's a start. Thanks!

  • Is there any particular reason you're using the pin behaviour? If you just want your sprite on top of your "Player" object at all times, put your imagepoints at the bottom middle of both sprites and use the "Set position to another object" condition instead.

  • you can try what Nimtrix said by using System - Every Tick: 'Set position to another object'

    or you can use the 'set position' action with X as Player.X and Y as Player.Y and add a value to the Y/X value. for example, if you want the sprite to be a little bit higher, you can put: Player.Y -10 etc.

    up to you, hope that helps

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