TwinSix's Forum Posts

  • 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:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • No, both the player sprite and seed_bullet are on Layer 0.

  • Yes, I am using the free version, and I had to place my HUD (hitpoints and ammo counter) on a parallax layer, which left me no choice but to place everything else on the same layer. I appreciate your offer to help.

    As I previously mentioned, when I collect the seed on the left side of the screen, the bullets fire normally, however, as I progress to the right side of the stage, the origin point of the bullet lengthens further and further along the (X axis) away from the player sprite. When you collect the first seed, fire it, and you will see it firing from the origin point. walk to the right (to the edge of the cliff) and fire some more, and you will notice the origin of the bullet has moved. I only have a single "Scroll-to" behavior set on the player sprite for the camera - no additional conditions.

    I have attached a link to the C3 file, and disabled the limited ammo count on the event sheet, that way you can simply collect the "seed" and fire it to see my problem.

    WASD - moves/jump

    SPACE - fire seed (after collecting one at beginning)

    https://we.tl/t-PYVug00lhI

  • Apologies for the long title. I saw one other thread on this problem, but cannot find the solution. I have a 2D platformer, and I want the bullet (seed_bullet) to:

    fire from my player sprite (image point 1) when I collect the item, and press [spacebar] to "fire the bullet" (spawn object on player).

    When I am on the left side of the screen (my stage layout) the bullet spawns, and travels accordingly, however, as soon as I travel to the right, the bullet spawns and fires, but it spawns further away from my player. When I reach the far right side of stage, the seed is not even spawning in my layout. I have attached pictures of my event sheet for the bullet, as well as my layout, in case I am overlooking something, but I am stuck.

    The context:

    Player picks up seed, and gets his ammunition, then he can fire the bullet. I want the bullet to spawn from his Image Point 1 (which I have set to the player sprite). I am not concerned with directional facing yet... I cannot get the bullet to spawn even correctly.

  • I DID IT!!!! I'm not sure if I did it correctly (or the exact way you instructed me), but I found a way, it's less messy than before, and ultimately, IT WORKS - the toad moves incrementally and changes directions based on contact with a sprite.

    You mentioned adding another condition, and I looked up adding additional conditions - so I added a collision event, and "set mirror", then I just added the value check "is mirrored" to the enemy animation. I am sure I have no clue what I just typed, but I included a picture.

    Thank you for all your help!

  • However... I have another issue if you would like to continue this thread.

    I got the toad to move in the direction I wanted, and he "hops" - it is all perfect. However, I cannot get him to "mirror" his direction and proceed with his movements in the opposite direction.

    My context:

    set a Boolean (direction_left) with an initial value of true. Then I created a sprite to use as an invisible collision wall (collision_enemy_left).

    When the toad touches ("on collision with") the invisible wall, I "toggle" the Boolean to false

    Then, I repeat the same events as previous, only with the condition that "direction_left" is false (I inverted the event). Since the condition is false, I just reversed the enemy's movement (toad.X+.05).

    The enemy's animation cycle works, all the way up to him touching the wall. When he collides with the wall, the idle animation begins, but he just sits there, cycling the idle animation, and the sub events are not initializing.

    Would you have any idea what I am doing wrong?

  • OMG it worked! THANK YOU! I looked up the "on animation" conditions you mentioned and set them up in the pic below.

    I turned off "looping" for the animations

    set the "idle" animation to play "on created", then when that finishes, I set the "move" animation to play, and looped it. The tricky part was setting up the movement, but I found the proper syntax, and now my toad hops! THANK YOU for your help and patience!

    Uploaded pic for future reference

  • Thank you for replying!

    The context (I believe):

    When the screen starts, I want the toad's idle animation to play once, then he "moves left" (hop animation) for 16 pixels (or some very short distance), and then the hop animation stops, and the idle animation begins again, for one cycle, and I want this to continue until the toad bumps into my collision wall and turns around (mirror) and repeats the action in the opposite direction.

    I set up the enemy with the platform behavior, and when I do the tutorial's "Every Tick" function, the toad just glides across the platform, and I would like to make him hop, then pause, do his idle animation, then hop again.

  • Sorry for the long title, I'm confused how to phrase my problem briefly. I drew an enemy (a toad), and he has an idle animation, and a hop. I want him to cycle the idle animation ONCE, then hop to the left ONCE, and repeat ad infinitum until he hits my collision wall to reverse (mirror) his animation, or the player stomps him. I cannot figure out how to set up the event sheet for this.

    I'm new to this, so please keep that in mind when typing answers - I may not know lingo or acronyms.

    Thank you

  • N00b rely, but I can see several ways to do this. I guess it depends on what kind of game you are looking to do? Old school like Shadowgate with no movement within the room, or perhaps like D where there is rotation in the room? I assume from your post that you want a more simplistic approach (like Shadowgate)?

    You could do like the previous reply and use global variables to track certain interactions and “quest” items. For the screens, you could use square sprites as interactive zones (keep invisible) and then when the player clicks the various squares, it teleports them to the next area (picture). I have wanted to make one of these types of games for years, myself, so keep us(me) updated!