Adrian Drago's Recent Forum Activity

  • If you want sliding, use 8direction behavior. You can move the sprite by setting vectors:

    > Set vector X to max_speed*cos(angle(self.x, self.y, Mouse.x, Mouse.y))
    Set vector Y to max_speed*sin(angle(self.x, self.y, Mouse.x, Mouse.y))
    

    To detect when the character is behind a wall - use a separate invisible non-solid wall sprite with a larger collision mask. But I think having a semi-transparent copy of the character displayed on top of everything is a much better solution.

    It worked perfectly. Thank you!

  • I can't download your project, it says "Access denied".

    If you want the character to walk around obstacles, you'll need to use the Pathfinding behavior — check out the official examples.

    A simple way to make the character sprite visible behind walls and trees is to make a copy of it (a clone object). Set its opacity to, say, 50%, attach it to the real character sprite and place it on a layer above.

    My apologies — the link should be working now:

    drive.google.com/file/d/1-bdRyXHK57srm2AKmoZ0pQJdy6i6Turg/view

    I don’t want the character to walk around obstacles — just move toward the mouse position and stop or collide with solids.

    I figured out why the opacity effect wasn't working properly — the wall's collision polygon only covers half of the sprite height, so the player never actually touches the area that's supposed to trigger the 30% opacity.

    Could you help me fix this?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm trying to create a system where the player moves toward the mouse position while the left mouse button is held down — similar to how movement works in the game Magicka, for those who are familiar with it.

    The only simple solution I could come up with is shown in lines 1 and 2 of my code. However, I'm facing two issues:

    The player stops completely when colliding with a solid object. I know this is because the "Stop on solids" property is enabled in the Player's MoveTo behavior, but I couldn't find a way to make the Player slide along solids — similar to how it works with the 8 Direction behavior.

    In lines 4 and 5, I tried to reduce the wall's opacity so the player remains visible when behind a wall. However, something isn't working properly — the opacity effect doesn't behave as expected (for reference, I'm aiming for something similar to how Stardew Valley fades out trees when the player walks behind them).

    I'd really appreciate any help. Here's my .c3p file:

    drive.google.com/file/d/1-bdRyXHK57srm2AKmoZ0pQJdy6i6Turg/view

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

Adrian Drago's avatar

Adrian Drago

Member since 21 Nov, 2024

None one is following Adrian Drago yet!

Trophy Case

  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

3/44
How to earn trophies