Problems w/ Enemy Movement [See latest post]

This forum is currently in read-only mode.
From the Asset Store
Be discreet and rescue your friends from behind enemy lines.
  • + ToyGirl: Angle Equal to 0

    + ToyGirl: ToyGirl overlaps Block

    -> Block: Set horizontal speed to 205

    + ToyGirl: Angle Equal to 180

    + ToyGirl: ToyGirl overlaps Block

    -> Block: Set horizontal speed to -205

    That will pick that instance, and move it.

    Pick by closest is best used when you don't have a usable collision.

    Now if you want that to only happen when key x is down simply add a mouse&keyboard event:

    +Key "x" is down

    + ToyGirl: Angle Equal to 0

    + ToyGirl: ToyGirl overlaps Block

    -> Block: Set horizontal speed to 205

    And then if you only want that to happen when she's not on top of the block:

    + MouseKeyboard: Key X is down

    + ToyGirl: ToyGirl overlaps Block

    + ToyGirl: Angle Equal to 0

    + ToyGirl: Y Greater or equal Block.Y

    -> Block: Set horizontal speed to 205

  • Thanks, I cleaned up the pushing events with your suggestions, except instead of Y is greater or equal than Block Y, I did

    ToyGirl X is greater than or equal to Block.Left,

    in order to keep things smooth-looking (plus, if the player was on a platform a smidgen higher, it wouldn't push at all with Y).

    Honestly, the Walls and Blocks event I listed up above (the cause of my previous conundrum) has proved to be such a hassle that I scrapped it. I scrapped it and the Pusher objects too, because they were honestly causing too much trouble, trouble I didn't want to deal with.

    It's kinda funny that I put stuff like that in at the beginning because I didn't know how to go about programming what I wanted to do in the first place.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yup, I kinda hope that this topic serves as a guide for other people; they can learn from my mistakes and the solutions that cool dudes like newt provide.

    EDIT:

    Why does it seem like people's posts just disappear sometimes? Are people just embarrassed and deleting their stuff?

  • Sorry to bump an old topic, but I don't feel like making a new topic for such a simple question.

    I gave my (first batch of) enemies both custom movement and bullet behavior- mainly, I want them to float back and forth. There are two types right now: one that goes side to side and another that goes up and down. When they collide with the EnemyBouncer object (or rather, the Bouncer Attribute, they're supposed to change directions by 180 degrees.

    This is what I got

    <img src="http://i417.photobucket.com/albums/pp257/Emperor_Phoenix/Construct%20Problems/EnemyMovementProblem.jpg">

    http://i417.photobucket.com/albums/pp25 ... roblem.jpg

    Link because the forum isn't showing the whole image;

    (didn't update it to say "collision with Bouncer")

    However, when the enemy runs into the EnemyBouncer object, it just wiggles there. My guess is that it is constantly changing its angle. This is probably because I have the conditions for movement set to specific directions, as opposed to a different approach.

    I gave up on Bullet behavior because I couldn't find a way to set the direction of the enemies, so I'm trying this instead.

    As my post alludes to, I'm trying to do this:

    1) set up enemy movement in two ways: side to side and up and down

    2) change enemy direction (not angle) when colliding with the Bouncer attribute

    Many thanks to those who can help. I did look up topics about the bullet behavior earlier today, but they proved less than helpful.

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