my last bug in the game i cant fix - character gets on top of the walls while sliding

0 favourites
  • 11 posts
From the Asset Store
Antisuspend Plugin
$7.20 USD
20% off
Antisuspend Plugin for Construct 3 prevents the runtime from getting suspended.
  • I have a game where we solve the maze by swiping right and left on the road. there are walls in the game. when I swipe the character to the right, it slides in the direction I swipe until it hits the wall, and when it comes to the wall, there are sensors indicating that it touches the wall, in this way, when it receives the information that it touches the wall, it centres its position just 1 square next to the wall, that is, on the road, but sometimes this code block runs late or slowly, so it throws itself back after it gets on the wall, so when playing the game, it gives the impression that the game is running momentarily. When this happens several times in a row, it stands out too much, I couldn't solve it no matter what I did.

    The bug :

    youtube.com/shorts/-866PwK8D0Y

    As you can see in the first and last move, it goes over the wall, but this does not happen in the others.

    so the code

  • There really isn't enough information in the screenshot to be able to answer your question. To really be able to help you fix a bug in your code, it would be best if you attached your project for us to work with.

    However, without actually playing with your code, I believe a project I built to answer a previous question can help you as well. Take a look at this:

    drive.google.com/file/d/1BFP_BkjSzgAKj7A2-rRAQ4g-jKEUIcqp/view

    Specifically, take a look at the setPlayerStopPosition function.

    Hopefully that gets you what you need. Good luck with your project.

  • thanks for your answer I didn't want to share the work directly in case of copying but I can send it privately if you want

    I also sent an access request for the file

  • There really isn't enough information in the screenshot to be able to answer your question. To really be able to help you fix a bug in your code, it would be best if you attached your project for us to work with.

    However, without actually playing with your code, I believe a project I built to answer a previous question can help you as well. Take a look at this:

    https://drive.google.com/file/d/1BFP_BkjSzgAKj7A2-rRAQ4g-jKEUIcqp/view?usp=drive_link

    Specifically, take a look at the setPlayerStopPosition function.

    Hopefully that gets you what you need. Good luck with your project.

    thanks for your answer If I give you my e-mail address, can you help you if I send the file from there? or another contact address

    thank you very much for the file you sent, it helped a lot, but when you make the bullet speed 1500, it jumps over the walls, and when you make it below 1500, the game is very slow.

  • Just have it shoot a bullet. Then when it makes contact with a wall, have Construct pick the wall closest to the impact point. Then have the moving block or whatever it is tween to that location. That would allow you to include cool tweens like bounce, to really improve the look of the impact.

  • Just have it shoot a bullet. Then when it makes contact with a wall, have Construct pick the wall closest to the impact point. Then have the moving block or whatever it is tween to that location. That would allow you to include cool tweens like bounce, to really improve the look of the impact.

    thanks for the answer but i don't quite understand what you want to say, give the tween effect to the character so that it looks like it is not instantaneous, but as if it has crashed and returned?

  • > Just have it shoot a bullet. Then when it makes contact with a wall, have Construct pick the wall closest to the impact point. Then have the moving block or whatever it is tween to that location. That would allow you to include cool tweens like bounce, to really improve the look of the impact.

    thanks for the answer but i don't quite understand what you want to say, give the tween effect to the character so that it looks like it is not instantaneous, but as if it has crashed and returned?

    Send me the code and I'll show you what I mean :)

    Just realised this forum has no DM stuff... are you able to invite me to a discord or join mine? discord.com/invite/KaWdcYx

  • > > Just have it shoot a bullet. Then when it makes contact with a wall, have Construct pick the wall closest to the impact point. Then have the moving block or whatever it is tween to that location. That would allow you to include cool tweens like bounce, to really improve the look of the impact.

    >

    > thanks for the answer but i don't quite understand what you want to say, give the tween effect to the character so that it looks like it is not instantaneous, but as if it has crashed and returned?

    Send me the code and I'll show you what I mean :)

    Just realised this forum has no DM stuff... are you able to invite me to a discord or join mine? discord.com/invite/KaWdcYx

    i cant add do u add me onur.#9545 dc name

  • Did you guys solve it or do you still need help?

  • It is possible that your bullet is too fast and is missing the collision with the wall.

    Try enabling the "Step" property in the bullet behavior.

    Either way, I think using tilemaps and the tile based movement for this would be better for you.

    Some other movement behaviors are set to no go through objects with "solid", so that is also an option to try.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Did you guys solve it or do you still need help?

    AnD4D was very helpful and resolved the error very nicely thnx for the helping

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