sgn15's Recent Forum Activity

  • do they overlap?

    spikebase overlapping with base

    for each base

    for each spikebase

    spikebase (is pinned)

    ->pin spikebase to base (or the other way around, did not really understood your game explanation)

    to pick a corresponding partner

    pick base

    base.UID

    =

    spikebase.pin.pinnedUID

    or

    pick spikebase

    base.UID

    =

    spikebase.pin.pinnedUID

  • you might want to show a diagram or the screenshot of your layout because I don't know the theme/logic of your game

  • Ok. I would suggest making sensors (invisible objects). Better yet, make different sensors for different movement directions.

    If enemy overlaps sensor_right, move right.

    If enemy overlaps sensor_left, move left.

    and so on.

    then you can also check line of sight or distance from player.

  • If player and enemies are running horizontally, then you pass through the vertical sensors. I mean "vertical" as a thin long vertical line (shape of sensor).

    Not sure if we are misunderstanding each other.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • adding "i" to the third parameter in RegexMatchAt should ignore letter-casing (for future reference)

    like this?

    int(RegexMatchAt(Player.AnimationName,"animation(\d+)", "i",1))

    where you read that (adding "i") btw? I did not see it from system expressions in manual just now?

  • Oh, finally got it to work!

    Thanks for taking note of the lowercase issue.

    My animations are Animation1, Animation2, and so on.

    It works now. My bad. Noob mistake. Thanks again.

  • Also tried saving the anmation name into a text variable first, then referencing the text variable inside regex.

    Still not working.

  • IndieKiwi

    for some reason, it doesn't work when I use the Player.AnimationName directly

    any tips to solve this?

  • IndieKiwi

    It's not working.

    What did I do wrong here?

    int(RegexMatchAt(Player.AnimationName, "/animation(\d+)/", "", 0))

  • I have an object with animations named like animation1, animation2, animation3, animation4, etc.

    I want to save that to a number variable but removing the word "animation", meaning

    animation1 will set a variable to 1

    animation2 will set a variable to 2

    animation3 will set a variable to 3

    and so on

    Is this possible to make using only 1 event? I'm not too good with text-related expressions.

    Help please.

  • Still not sure about the overall theme of your game, is that thin line a platform (jump thru or solid) ?

    If it's a horizontal layout and you keep on running and enemies chase you, place thin vertical line sensors on each area where enemy needs to jump

    Use Vector X to make any object with platform behavior to move horizontally, Vector Y to make it move vertically. You can use vector X while jumping

  • If this is platformer/side scroller game, this might fit your preference

    https://www.scirra.com/tutorials/1320/p ... enemies-ai

sgn15's avatar

sgn15

Member since 20 Sep, 2013

None one is following sgn15 yet!

Trophy Case

  • 11-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

14/44
How to earn trophies