How do I keep platform enemies from running through barriers

0 favourites
  • 8 posts
From the Asset Store
Pixel Enemies for SHMUP consists of 45 enemy ship sprites to be used in your game.
  • My programming works fine but when my enemies start to move faster they run right through the invisible barriers I have in place. Does anyone have a solution for this?

    Also I wanted to include a screen capture but I can't figure out how

  • I have a feeling that this is related to https://www.scirra.com/tutorials/67/del ... ence#h2a12 See Minimum framerate section?

    [quote:34uxwuj4]At very low framerates, dt can become very large. For example, at 5 FPS, dt is 0.2. An object moving at 500 pixels per second is therefore moving 100 pixels per tick. This can cause it to "teleport" through walls or miss collisions with other objects.

    Games are usually unplayable at such low framerates, but it is even worse if they become unstable like that. To help the game stay reliable even at very low framerates, Construct 2 does not let dt get larger than 1/30 (about 0.033). In other words, below 30 FPS, dt stays at 0.033. This does also mean below 30 FPS the game starts going in to a slow-motion effect (described earlier as one of the issues of framerate dependent games), however this is usually a better result than the "teleporting objects" problem.

    If you want to set a different limit to 1/30, you can use the system action Set minimum framerate.

    For your case, I believe that the game runs fast enough, but since you mentioned the enemy move faster, I have a feeling that they might be moving so fast that they just "teleport" through the walls. Could you see whether this is indeed the case?

    For Screen Capture, you can use Snipping Tool. Windows should come with it. But I believe video capturing might be needed more in this case?

  • Somehow I couldn't load your capx. Can you try that again, but change "https://" to "abcde://" so the forums won't parse that as a link and shrink it?

  • drive.google.com/open?id=0B3paAL-Ct0pqQ2NDRnJrNms4dlk

  • Ok when I tried to put "abcde" the form would not post the reply? I just took the "https://" and it let me post. I tried to put the address in my earlier post yesterday and the post got deleted. I guess the forum does not like the abcde?

  • Okay. This is NOT a copy of your layout. The platforms are placed differned. Because. Wel.

    https://

    drive.google.com/open?id=0B1SSuCVV8v74ckRIUmtfbDhIVDQ

    I wanted to show you the difference in performance when you use a tilemap. I put all the platform sprites in 2 tilemaps. A solid and a jumptrue. Before it ran at 20 FPS on my computer. Now it runs at 65 FPS.

    Also, i gave all off screen enemy's a zero timescaling. This is not neccensary. It is just a gimick to lower the collissions/frame even more.

    About Choppy not wanting to turn direction on a collision. Wel, wat you try is tricky.

    You move Choppy with the platform behaviour, wich is fine, but since the barriers are non-solids; the Platform behaviour is pushing Chappy into the barriere. Normaly when u look for collisions you use a way of moving things that have a auto-push-out-of-solids feature. Without that the collision is gone to quick. You cant make the barriere solid, i know that.

    Also, there was a minor picking problem. The chance that 2 choppys needed a direction change at practical the same time was big. But only one got changed.

    In the capx is a very elegant solution. It is a fast one too. How smaller the angle, how smaller the range, how faster. And if you tweak it right, it will never miss. Not even at very high speeds or low framerates. It will change a 1000 choppys in direction at the same time too.

    Hope i helped you some.

  • Thanks for the help I'll have to play around with your ideas

    little background of what I'm doing I got to teach and create an animation and video game design class at my high school since the guy that normally teaches the art/tech stuff didn't have room in his schedule. I start by having the students make a top down shooter which they have a lot of success with. The platform jumpers come out well but there are more glitches I have to figure out. I have a ceramics degree so the computer stuff is out of my area so thanks for you feedback.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ysvw

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