terence's Recent Forum Activity

  • That works well. Thanks. I didn't use containers initially because destroying sprites in one destroys the sprites in all other instances, but making the unwanted sprites invisible is a good workaround. Hopefully it won't impact performance too much.

  • I have a top down game where each enemy is made up of several sprites, and the enemies follow a path based on one of the waypoint tutorials.

    I'm facing the following issues and not sure what is causing them:

    1. The z-order of the sprites pinned to the enemy sprite seem to change randomly

    2. Pinned objects randomly disappear

    3. Pinned objects (enemy legs and head) seem to detach from the enemy sprite and when this happens none of the events relating to enemies execute any longer (e.g. dying after colliding with player sprite).

    CAPX: filedropper.com/pintoenemywithwaypoints

    Thanks in advance

  • Capx file was very helpful. I see what I was doing wrong now. Using imagepoints for measuring distances also seems to work better.

    Thanks a lot.

  • I'd like to destroy the feet and disable the bullet behavior for only the enemy instance the player collides with.

  • No, I don't think the feet were the issue. The problem I'm having is that when the player and enemy sprites collide the feet (and other sprites) pinned to all other enemy instances are also destroyed. But the bullet behavior is correctly disabled for only the enemy instance that collides with the player.

  • One thing I forgot to put in the capx is that apart from the "Enemy" sprite the other sprites pinned to the enemy and player (such as feet) will have collisions disabled, so this is why I haven't selected enemy feet in the collision event.

  • In my top down shooter I have different enemies made up of several sprites each which are pinned to the main enemy sprite. When an enemy collides with the player or player projectiles I want some of the sprites of the enemy to disappear, some to stop moving and others to change frames/animation based on the nature of the collision or overlap.

    At this stage I don't want to use families and containers don't seem to be suitable. I'm trying to pick each of the sprites for a given enemy using "pick instance by comparison" and instance variables, but I'm unable to achieve the desired result, probably because my system pick events are not correct.

    The .capx linked below contains a simplified example. Any suggestions appreciated.

    copy.com/JdsiG1uaT4e1

  • In some cases, I'd like the bullet to carry on. The workaround I came up with was to have the object being hit spawn a new bullet with the same angle/speed, and this seems to work OK.

    The bigger issue I have with custom movement is that it cuts the frame rate from 60 to 20-30 frames at certain times. My layouts are fairly large (10000 square) and I can have upto 15-20 bullets on screen at once. For accuracy, I need to have at least 10 pixels per step.

    Other than destroying the bullets when they are outside the layout or hit other objects, is there anything else I can do to improve performance? If not I may need to rethink using custom movement.

  • Thanks, both suggestions work but will go with EncryptedCow's approach as it's easier to implement.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a bullet I want to bounce off some solid objects but pass through others. For those objects where I don't want the bullet to bounce, I have tried disabling the solid (and collisions) on collision. But the bullet still bounces off the object once if I have the "bounce off solids" option set to yes.

    I have also tried adding two bullet behaviors (on my bullet) using the method described in the post linked below (one with bounce, one without), and switching between the behaviors at the time of collision but I still find that the bullet bounces (once) off the objects I want the bullet to pass through.

    scirra.com/forum/turn-off-bounce-off-solids-via-Event_topic53021_page1.html

  • Thanks for all the replies. Will test out each method to determine what works best for my project.

    Ramones, the custom movement bullet example you provided seems to work well, but I have one issue. On collision I have functions being called in actions depending on the object the bullets are colliding with.

    Now that I'm using the is overlapping event (instead of on collision), I find that my functions are being called multiple times instead of just once as required, I guess because of the increased accuracy.

    The "stop custom movement stepping" is my first action on overlap (as per your example) before calling my function. Is there any way to execute my functions just once when the is overlapping condition is true - for many ticks?

  • MACPK: I'm avoiding Physics in my project, but as a test I enabled physics collisions on the objects and set the physics bullet property to yes on the projectile, and it didn't seem to make any difference. Is there any other non-framerate dependent/non-physics method of detecting collisions for small fast moving objects (with a speed of 10000+)?

    Colludium: I think I understand the method you're describing. An example would be helpful.

terence's avatar

terence

Member since 7 Sep, 2013

None one is following terence yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies