Why am I still getting stuck in the walls?

0 favourites
  • 9 posts
From the Asset Store
Wall Pin Board is a hyper causal game developed for fun and inspired by YouTube video whose link is given in description
  • This is becoming more than an annoyance.

    My players & bad guys are constantly getting stuck in the walls of the games I make.

    At one point I literally copied the code from the C3 Pacman game because nothing else was working and that's not working.

    Why doesn't solid mean solid? If I go running head long into a brick wall, I don't because part of it. Solid should work the say way.

    At the start of the game it's the worst, but it can happen at any time.

    In this case when the O rolled over the teleport sprite it's supposed to teleport to the next teleport sprite, which typically works, but sometimes the O get stuck in the wall before it has time to teleport. Or if I roll the player (O) backwards to fast at the beginning of the game the player may get stuck in the wall on the other side of it's starting position.

    And the Xs (they're the bad guys) they randomly get stuck in walls or go completely through the walls all over the game. (The Xs can't teleport)

    Nothing seems to stop objects from randomly passing through or getting stuck in the walls.

    Please tell me there is a fix.

    I've spent a year working with C3, I don't want to start over with another generator, but I can't make a successful game if I can't keep sprites from getting stuck in other sprites.

  • How are you causing your sprites to move? Are they moving along a path, setting position at various points, etc? It might be an issue with your moving code.

  • Bpratt107

    Thank you for your reply.

    I posted an image of the setup below. The player is moved by titling the phone, that part works great.

    I removed the solid behavior from both the player and the walls, in the hopes that the player would at least go through the wall instead of getting stuck in it, but that didn't help. Clearly I don't want the player going through the walls either, but at least the player could keep playing.

    I'm completely at a loss.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I remember sending you a demo with this code:

    It helps to prevent getting stuck in corners.

    Also, you should not use "Wait" inside "Player is dirChange" event. If you change the direction quickly several times, delayed "waits" from previous direction changes will mess the things up. Use Timer behavior - restart the Timer on every direction change.

  • C3 Reminds me of a genie in a bottle, no matter what you ask for you soon realize that it will never give you what you were expecting. lol

    dop2000

    Yes, the demo you made worked well, but the ball floated around no matter how tight I made the walls. I messed around with it for a bit but couldn't get it to be as accurate as the pacman demo.

    I'm using 'wait player.moveDuration seconds' to change the speed on different levels. I used it before to change the speed of a little race car game, guess I should figure something else out. I wonder if Start Timer would work better..... Mmm

    Thanks for the tip. Back to the drawing board.

  • Hi dazedangels

    Firstly just checking that you had the bullet "bounce off solids" behaviour enabled when you had the walls and ball set as solids?

    I've attached a small .c3p for the teleport behaviour let me know if it helps. If you explain your situation a bit more I might be able to help.

    https://1drv.ms/u/s!AkmrWgxeuxlKg_5uCwV0lB07dG29HA?e=SN5O33

  • calminthenight

    Thank you for the info.

    I think I figured it out, at least for the player. When the player comes out of the transport sometimes the phone is tilted to the side a bit so it's rematerializing (so to speak) inside the wall. This could be important information for future transporter operations (lol)

    Guess I'll be doing some MacGyvering to fix that.

    Thanks again.

  • If you added set speed to zero while teleporting on the teleport example I gave you it would solve that issue. The ball would only appear at the designated spot. Then the controls would be reengaged and the speed and direction would return. With bounce off solids enabled the ball would then not enter the wall.

    Good luck

  • calminthenight,

    Thank you. I'll work on that tonight.

    I know how to get it to stop, but I can't think off the top of my head how I would get it going again. But I will figure that out tonight.

    Thanks again.

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