TwinSix's Recent Forum Activity

  • How about this:

    1. The bird does it's thing and flies off screen

    2. Instead of destroying it, just suspend it (disable it's behavior, there are various ways to do this: e.g. disable a group, set a boolean to false or a state machine) use the timer behavior to start a two second timer on the bird

    3. On timer, reset & enable the behavior of the bird again (as in give it back the rock) and set its position to Y = whatever height you want it to patrol and X = player.X + screen width/2 + some offset so it starts off-screen

    4. This would also be the place were you can test if the bird spawns outside of its patrol area (if player.X + screen width/2 + some offset > rightWall.X) If that's the case, you can instead just start the timer again, which would mean every 2 seconds the bird will check if the player is in the right position for the bird to spawn inside the patrol area.

    Ok, I tried to follow what you said, and I'm sure it is nothing like you intended, but I got the bird's functionality to work.

    HOWEVER, when the bird repositions (restarts its patrol behavior), the bird drops low, to the player's Y level (even though I do not have that specified), and tehn sometimes even lower. Why is this?

    Here are screenshots of my events, and a new link to the capx, if you want to take a look.

    My initial "patrol" group - this works

    My other functions and behaviors (it's sloppy, I know)

    link to the project file

    https://drive.google.com/file/d/1ipmMMb-Pu6uckvWgsj9nb6XORwq7TwuF/view?usp=drive_link

  • Hello, thanks in advance. Not sure (again) how to properly phrase this question for later reference, but I would like a similar functionality with the birds in Castlevania NES, Stage 11.

    Youtube link for reference -

    https://youtu.be/mOTUVXrAOE8?si=pRDrHPKVWSGydxJB&t=814

    I have a bird enemy that patrols the air:

    - fly from right to left, hit wall, fly to right.

    And when he has line of sight to the player:

    - drops a rock, and then flies away and up (out of layout, whereupon it is destroyed).

    When the bird leaves the layout, and is destroyed, I would like another bird to spawn in after approx. 2 seconds, from the right side of the screen, and perform the same actions:

    - fly from right to left, if LoS with player, drop rock, fly off screen (and repeat until the player gets beyond a certain point (I have a tall invisible collision wall boundary set).

    I have the functionality of the first bird working, and everything is fine, but I cannot figure out how to get another bird to spawn in at a further point to the right of the layout.

    As in the reference video above, notice how the birds spawn in, drop the "flea man" enemy, and then leave the screen, and a moment later, another enemy comes in and repeats.

    Here are some screen shots:

    Basic look of screen

    Layout - I set two invisible collision walls to act as a patrol barrier for the bird

    My event sheet for the bird

    Here is the Capx file:

    https://drive.google.com/file/d/1ipmMMb-Pu6uckvWgsj9nb6XORwq7TwuF/view?usp=sharing

    Thank you for your help!

  • Oh wow, this is perfect! I have not tried (even thought of) states, much less did I expect you to do anything.

    THANK YOU!

    I admit, I would never have thought of this, either, so thank you for letting me see this code. This alone helps me with nearly every other enemy idea I have for the game.

    Thank you again!

  • Any suggestions on how or what I might do to achieve that? I tried pathfinding (to much frustration), but that does not solve my problem of telling the bee "when you see the player: attack; when you do not see the player, or if the player leaves your line of sight, return to doing what you were doing, in the spot you were doing it".

  • I set the direction events as subevents (Pic #1), but I will go ahead and apologize - this wording is confusing me.

    However, it produces some interesting results - close to what I am looking for, but not quite. Under the event sheet picture, I will show some example pictures of what I mean.

    Pic #1 - Sub Events

    For instance, when I stay away, the enemy behavior is fine. When I approach, the enemy comes at me, but he starts to "fly" upward, for some reason.

    Pic:

    Or maybe it is how I set up his behavior, but when I leave his LoS, his normal patrol pattern is broken. Is there a better way to set up his patrol behavior?

  • 2d platformer, and I have a patrolling enemy (bee). I have has his patrol event set properly, and it works:

    (Bee Patrol Group, Line 9 - see pic below))

    bee travels to the left, collides with with invisible wall, mirrors, travels to the right, collides with wall, repeat.

    I want the bee to see the player, change animation and then move toward the player slightly faster (this is where I set the Move To event). I want the enemy facing to be toward the player, according to player.X position (lines 16 and 17 in pic below), however, I want the original behavior to be followed until the enemy sees the player, OR, when the player moves out of range, I want the enemy behavior to return to its default patrol.

    The first patrol group (Bee Patrol) works as intended - the enemy changes directions, and all is fine. However, when I activate the Bee_los group, the enemy does not change facing when hitting my invisible wall (which should trigger him to mirror and begin traveling to the right). The animation changes work fine.

    Attached is a screenshot of my event sheet, and a link to the game file. The faulty group (Bee_los) is deactivated, so you can see the game work normally before you get into the troubles.

    The player is set just to the left of the bee enemy, so upon initializing, you can sit in place and watch the bee hit the wall, and then mirror and patrol to the right. In the Enemy Behavior event sheet, activate the "Bee_los" group, initialize, and you will see the bee does not change direction.

    https://drive.google.com/file/d/1enUBFVRMzzz8FKQczdr2-k8mgjyzEaZQ/view?usp=sharing

  • SOLVED

    I am solving my own post, but if the mods would allow it, I would be interested in reading how other, smarter people solve my problem.

    SOLUTION:

    Use "Move forward" and set the number of pixels (in my case, I set it to 8, then 16 on the direction change)

    This solves the movement issues, and since the poor toad is just a simple enemy, there is no need for intricate pathfinding or anything.

    Pic of my event sheet for anyone's future reference:

  • FOR REFERENCE - this is related to my previous (solved) post about incremental enemy movement

    https://www.construct.net/en/forum/construct-3/how-do-i-8/enemy-move-once-go-idle-move-180665#forumPost1102917

    I have the movement set for my first enemy (toad), and he moves exactly the way I want him to move, according to his animations; his animation state determines when, where, and how he will move (in this case, a slow hop to the left, collision event with an invisible wall, then he is mirrored, and hops slowly to the right).

    My problem is that I CTRL+clicked "toad" (to copy it) and pasted another instance of the same enemy (toad) on the next platform in my level, and the movement animation timing is the same, however the cloned enemy moves much further, and in a quick way. My movement parameter is: set platform vector x to Self.X*-0.8, and I only want the toad to move along the X axis, and as you can see, I don't want it to hop very far each time.

    The cloned toad is hopping MUCH farther when his movement triggers, and I cannot figure out how or why this occurs.

    Below are screenshots of my event sheet and layout, and I have included a weTransfer link of the game file, in case anyone would like to help. Thank you!

    WeTransfer download link

    https://we.tl/t-8ZhM656WKT

  • Thank you!

    I was able to create a small workaround, however I guess I need to upgrade my license.

    Thank you again for your time and help!

  • > ...

    >

    > https://we.tl/t-PYVug00lhI

    You gave a false link, I didn't find the file there.

    odd, it works for me. Apologies. Let me see if I can do something else.

  • The player sprite is on layer "Layer 0" with 100% parallax. The bullets are spawned on layer "bg" with 0% parallax.

    Oh, wait, you meant that the bullets should be on a parallax layer?

    I placed the bullets on my HUD layer (bg), and set the parallax to 100% x 0% and that fixed the problem.

    So, firstly, THANK YOU!

    Secondly, why did this happen? Every tutorial (both on YT and even the Construct 3 tutorials) use the same procedure:

    "add sprite, set condition to spawn sprite from player, add bullet behavior", and the bullets work; so with my immediate problem solved, I am curious why the bullets behave this way? The tutorials did not require me to set a new layer for the bullets, and now I don't have a HUD layer for my player.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, both the player sprite and seed_bullet are on Layer 0.

TwinSix's avatar

TwinSix

Member since 11 Jan, 2024

None one is following TwinSix yet!

Trophy Case

  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

3/44
How to earn trophies