Excal's Forum Posts

  • Here's an updated version of the project.

    The player is now correctly 'bouncing' off of the enemy upon collision, but the enemy remains in place. I'm not sure how to make the enemy 'bounce' (completing Newton's Law). Any help in this area would be appreciated.

    Here's a screenshot of the events where the collision is handled.

    <img src="http://i.imgur.com/AxpmsLU.png" border="0">

    CollisionNotWorking2.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No idea on the sprite and parallax, I'm probably just getting confused because I'm working on a space shooter that uses multiple moving backgrounds.

    There isn't one method that's better than the other in the case of sprite with wrap versus tiled background object. My claim was that he was doubling the size of the tiled background and repositioning it after it got off the screen, and I felt that it could be more optimized.

  • What do you mean by 'letterbox scale'?

    I noticed you're trying to make the background scroll by doubling the size of the background at program start and then having repositioned once it gets off the screen. This is a little inefficient in my opinion.

    Just make a layer for the background, load the background image as a sprite, and then set that sprite to wrap. Have the sprite move some number of pixels on every tick, set the parallax to the background layer to something like 100, 30 and that should do it (you may have to make a few tweaks).

  • Title basically says it. Sometimes the enemy spawns and doesn't move. Other times (more often), the enemy spawns and chases the player as per the Pathfinding behavior.

    EnemySometimesStuck.capx

  • I removed the player setting to stop custom movement so now the player seems to collide and react well.

    The enemy still does not react to the collision, instead staying there like a brick during the collision.

    UPDATE: I think I solved the issue. The AI pathfinding was causing it to continue moving along the found path during the collision, which overrides the physics behavior that would cause it to bounce. Stopping the enemy's movement along the AI path during collision seems to allow the physics behavior simulate a collision.

  • Have the player object be bound to layout.

    Use (in the event sheet):

    System: Every Tick -> System: Set scroll X to scrollx + 8 * dt (or whatever number you prefer)

    This should move the screen slowly to the right every few seconds.

  • Right now, when the player collides with the enemy, the enemy doesn't move, nor does the player "bounce" off of them.

    I want to simulate realistic physics where if the player hits an enemy, the two 'bounce' off each other.

    Does anyone know how to do this?

    CollisionNotWorking.capx

  • Updated file. The 500 reputation limit is kind of annoying right now; should probably be 250.

    Collision and Wrapping Not Working

  • I've cleaned up the project a bit and removed aspects I felt were unnecessary.

    I changed Bullet behavior with Pathfinding behavior, although I'm not sure the settings I've used are optimal (I'm finding a new path and regenerating the obstacle map every 0.5 seconds).

    Collisions aren't working and I don't know why. My goal is to have the player and enemies collide and then bounce off each other.

  • Okay, the enemy not wrapping has to do with the fact that it is not accelerating due to it's speed being dropped to zero on impact (only way I could get the impulse to work).

    I'm not sure how to simulate realistic colliding physics while also causing the enemy to accelerate to counteract the collision impulse and eventually start chasing the player again.

  • Title says it all. EnemyCrescent has the Wrap behavior but is clearly not wrapping. Easiest way to test this is to collide with the enemy and watch it go off the screen.

    Also, if anyone has any ways on optimizing my physics for a more realistic collision, tips are appreciated :)

    Go to post #4 for the latest update.

  • Ah, it works now. I guess the reason why it didn't work when I first tried your advice is because I didn't clear local memory or something. I kept getting the same problem. Thanks!

  • I did a search for Ghost Rain tutorial and didn't find it on the forums or the tutorials section of the site.

  • I added an event to rotate the enemy 90 degrees clockwise as soon as it spawns, but that doesn't seem to fix the issue.

    I've tried rotating it to player.X and player.Y upon spawn (and then having it slowly keep rotating towards the player's position every tick), but it's still chasing the player sideways.

  • I'm having an issue where my enemy sprite is not facing the player upon spawn. It chases the player at an angle, which makes it look weird. Does anyone know how to fix this?

    EnemyFacingIssue.capx

    This project is based on the Asteroid Clone in 100 Events or Less tutorial.