lukezero's Recent Forum Activity

  • So the enemy stays still, enters a short ALERT phase when detecting the player, then start moving toward them; Once close enough, if the player is not attacking already, the enemy will attack, did I get everything right?

    Exactly that! :D

  • I see many issues in your events logic, can you describe me how your enemies are supposed to behave exactly? I'll make an example capx, that will be easier than writing an essay;

    If possible link me your capx file, that'll be faster to edit

    Sure, I can explain it to you, man. :)

    My enemy have many behavior states: idle, walk, alert and attack.

    He usually stands still (idle) and becomes alert when he sees the player from a certain distance (Line of Sight and then alert state). Then he follows the player and delivers a heavy attack on them (his only attack, slow and strong). He only attacks when he is a certain distance away from the player.

    These player boolean instance variables are to prevent the player from attacking when he is being attacked. :)

  • What are the events for the ATTACK state of an enemy? This is probably where the problem is

    Follow below:

  • Hello, you need to use the "For Each" condition at top of event 27 to be able to pick the enemies correctly and compare their distance separatly

    I tried here, but it still doesn't works. :(

  • Hi guys!

    In Construct 2, I'm trying to implement in the AI ​​of a wandering enemy the reaction of attacking the player only when it sees the player (Line of Sight), which activates a "state" instance variable (alert) and finally is at a distance X from the player.

    As shown in the image, I tried using "Compare two values", "Pick by comparision" and "Is overlapping at offset" and I couldn't.

    Thanks one more time!

  • You do not have permission to view this post

  • It’s probably not random.

    You sound like you have a specific behavior you’re after that you have footage of or have seen. You could start by examining the motion of one leaf and trying to break it down into a path that you could replicate somehow. Worst case you could maybe use a timeline to manually plot a path. With two or three varieties you may get enough variation.

    At the other end of complexity you could try some grid based fluid dynamics to model airflows. Then the leaves would move based on where they were within it since you would have velocity at any point. Then you could model the leaves as slightly curved apply the wind to them based on the angle the wind hits them.

    There are probably many options in between. I don’t have any specific examples in mind though.

    Ok, dude. I'm doing some tests here. Thanks one more time for you help. :)

  • R0J0houndSorry to bother you again, but what do you suggest I do to create a random behavior of leaves being blown away by the wind?

    I tried here using Sine and Rotate, but I still didn't get the randomness we see in nature. :(

    PS.: I tried with Particles, and it didn't worked well too.

  • You don’t want to use Sprite.width since it’s changing. Worst case just use a fixed number such as 64 or whatever width you want it to start at when not rotated.

    I guess it’s sprite.ImageWidth not originalWidth.

    It worked! :D

    Thank u one more time!

    You're awesome!

  • What I'm trying to implement here is an effect of leaves falling randomly from the top of the screen (tree canopy). The rotation around the Y axis itself is to simulate three-dimensionality in a 2D game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Probably just:

    Var rotY=0
    
    Every tick
    — add 50*dt to rotY
    — sprite: set width to self.originalWidth*cos(rotY)

    Also it’s probably not necessary to post the question twice in both the c2 and c3 sections. The forum is already slow and most just look at new posts so they’ll see the question no matter where you post it.

    Since i'm using C2, I try to use just your code (disabling everything else shown in the attached image above), but the leaves disappear as soon as they turn 180 degrees. :(

    C2 doesn't have the "originalWidth" function, so I replaced it with self.Width.

    PS.: Sorry for the duplicate post. ^^

  • Hello friend, do you have a animation of what you are trying to achieve?

    im confused by trying to understand what you mean by rotate around its own Y axis?

    is it a 3d game ? or effect?

    top down view?

    usually X axis left right Y axis forward backward Z top down.

    so u see why my confusion ...

    in C3 default camera is top down, or sideview... depends who u ask...

    so rotate works as intended rotates from origin or "center" point of sprite clockwise or counterclocwise as u experienced, what you want i think considering is a "leaf" animation correct me if im wrong>>>

    you want the leaf to fly straight then make a round trip then continue its journey? like a gust of wind? or what is the final achievement?

    I'm using C2 and it's a 2D platform game. :)

    I'm trying to implement a falling leaf effect.

lukezero's avatar

lukezero

Member since 4 Oct, 2014

None one is following lukezero yet!

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies