Why can't i make a enemy jump?

0 favourites
From the Asset Store
Be discreet and rescue your friends from behind enemy lines.
  • To make a enemy move left and rigfth you make a instance variable action and type rigth. You add a platform behavior and change default controls to no. Then you make the event action equals to "rigth", simulate control rigth, set not mirrored and do the same for left but set mirrored. Then you do a couple of events and actions whit the edgemarkers to make the enemys turn. I would imagine jump would be similiar. You make instance variable named action2 and type in jump. Then you make the event action2 equal to "jump" and simulate control jump. No mirroring or edgemarkering is needed since the enemy just jumps. Of course you change defualt controls to no. I have done exactly this for multiple enemies and they don't jump. I have answered this question multiple times before and the replies indicated that it should work the way i do it. But it doesn't do it for me. is it something wrong whit my Construct 2, a bug or something? Make a enemy jump seems so simple but it seems incredibly hard for me for some reason.

  • If you could share your events and/or capx it would be easier to answer..

    I don't think there is any bug or something wrong with (your) Construct2

    Right now, reading your question, I'd have to guess you have multiple events cancelling out eachother..

    Multiple events/conditions that are true at the same time and because construct2 reads events from top to bottom, probably only the last event is acted upon.

    But like I said, without seeing the way you've set up your events this is only a guess..

  • If you could share your events and/or capx it would be easier to answer..

    I don't think there is any bug or something wrong with (your) Construct2

    Right now, reading your question, I'd have to guess you have multiple events cancelling out eachother..

    Multiple events/conditions that are true at the same time and because construct2 reads events from top to bottom, probably only the last event is acted upon.

    But like I said, without seeing the way you've set up your events this is only a guess..

    Too bad i can't post links to images until i have 300 in reputation. I would send links to my event sheet in every question i asked if i now could. No of my events cancel jumping so i it would not matter how far up the event is.

    I try to show the event sheet i have here as good as possible.

    action4 = jump Simulate Platform pressing Jump

  • Could it be that when you check if action4 is jump, you are checking if action2 is something else and that condition is also true

    Why use action4=jump and not just action=jump?

  • Could it be that when you check if action4 is jump, you are checking if action2 is something else and that condition is also true

    Why use action4=jump and not just action=jump?

    The reason why i named it action4 was becuase i have anothger enemy whit a instance variable nmed action and i thaugth both couldn't share that name. I changed the name to action and it still was okay so now the name is just action. It still didn't make the enemy jump though. My other instance variable is the enemys health counter in case you were curious. The enemy do jum exactly when the game starts for some reason but not after that. I tried adding every tick and then jumping event but no success.

  • This is expected behavior..

    If you would use the default controls and keep the key for jumping pushed it would also jump only one time..

    It seems your event is working correctly..

    So now the question arises when do you want your enemy to jump and add events and conditions for that..

  • This is expected behavior..

    If you would use the default controls and keep the key for jumping pushed it would also jump only one time..

    It seems your event is working correctly..

    So now the question arises when do you want your enemy to jump and add events and conditions for that..

    great! atleast we are making progress! I made the event like this.

    Every 1,0 seconds

    action=

    "jump" Simulate control pressing Jump

    The enemy doesn't jump

    Then i skipped the action=

    "jump"

    Didn't work.

    Then i made

    Has Line of Sigth of Sprite

    action=

    "jump" simulate control pressing jump

    That didn't make the enemy jump but it did make the enemy glitchy enough move to the rigth until it hit a wall when the game started. It doesn't have any events that make it move left and rigth so that is special. So how should i set up the events if i want to choose when the enemy is going to jump?

  • Could it be the collision polygon of your sprite is overlapping a solid?

    If so the jumping won't work...

  • Could it be the collision polygon of your sprite is overlapping a solid?

    If so the jumping won't work...

    No it doesn't It stands on a solid object but the collison polygon is on the solid object. I guess making a enemy jump is impossible for me how hard i an try. How sad....

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It shouldn't be hard..

    Your code should work..

    Jump example

  • It shouldn't be hard..

    Your code should work..

    Jump example

    Can i use that code somehow? Construct 2 doesn't have coding possibilities so it shouldn't, but it may.

  • What do you mean by code?

    These are events on the event sheet?

    And what do you mean when you say construct2 doesn't have coding possibilities?

    all you have to do is add the events and the action to your own event-sheet..

  • What do you mean by code?

    These are events on the event sheet?

    And what do you mean when you say construct2 doesn't have coding possibilities?

    all you have to do is add the events and the action to your own event-sheet..

    The jump example is a bunch of random letters and numbers. How am i supposed to be able to get help from it unless o could get in the text as a event which i don't know how to.

  • bunch of random letters and numbers?

    I'm not sure what you mean?

    I'm not using text or numbers and definately nothing random..

    It's just 1 event..

    system every 1.5 seconds

    sprite compare variable = "jump"

    sprite platform simulate pressing jump

  • bunch of random letters and numbers?

    I'm not sure what you mean?

    I'm not using text or numbers and definately nothing random..

    It's just 1 event..

    system every 1.5 seconds

    sprite compare variable = "jump"

    > sprite platform simulate pressing jump

    I did exactly that and the enemy doesn't jump. That's it, Construct 2 doesn't work for me. The stretching arm thing doesn't work, the enemy jumping doesn't work. Construct 2 doesn't work. I leave it and switch to another game making program that hopefully works better.

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