iKiwed's Forum Posts

  • Hi, I'd like to express in an event to mute all the music with any tags except one, how can I do this? I wouldn't want to name all of them, they're too many.

    Thank you very much!

    Tagged:

  • Hello! It's been a while.

    I promised that I would have noticy you for updates.

    Here's a short recap for whoever is reading:

    I'm making a top-down game in 4 directions.

    You're a robot vacuum cleaner, and your objective is to pick up the dust in levels.

    The robot will move automatically, while the player will just adjust the angle of direction, between up (270°), down (90°), right (0°), and left (180°).

    When the player hits a wall (either invisible or not), the robot "reflects" the direction.

    For example, if the player's direction is set to "right" and bounces on a wall, the new direction is set to "left".

    I had to make this premise because up to this moment, everything works as intended.

    I still want to thank R0J0hound for the suggestion.

    (Link: construct.net/en/forum/construct-3/how-do-i-8/bounce-8direction-fix-0speed-154535

    I still have their event. But there is a so-called bug I can't fix and is probably related to how the robot works.

    If the player spams against a wall in one direction, in a way or another, it will get stuck (if overlapping) or pass through it (if on collision). This happens only if the player makes a stress test, but I bet someone will do it just fine.

    Here you can see two videos:

    - dropbox.com/s/swrg9sarf9al9bl/10.06%20issue%20on%20collission.mp4 (collision)

    - dropbox.com/s/nu0az130nzbdjpm/10.06%20issue%20overlapping.mp4 (overlap)

    Is there any way to fix this? Thank you.

    UPDATE: Hello! Ok so, I say this for me and for the others as well:

    It's possible that I've fixed it by changing a parameter.

    If you look at R0J0hound's comment:

    "——— sprite: move 1 pixel at angle self.ang."

    I've changed from 1 pixel to 15, to leave enough space to not get stuck with the wall.

  • Hi everyone.

    I am making a pixel game (Aspect ratio 3:5).

    Usually I'd use "Letterbox Integer Scale" since it makes the artstyle consistent on any screens.

    But I've noticed that "Scale outer" is what I'm looking for, because What I want is that, if the window is bigger than the viewport, the player can see the rest of the game.

    The issue is that if I expand both width and height, the game zooms in.

    This doesn't happen if I only expand width or height.

    I just don't want that the screen zooms; I want that it expands what the player can see.

    Is it possible? Thank you for reading.

    (Let me know if you didn't get what I mean.)

  • Don’t use the behaviors. You can make the motion with events simple enough.

    Give the object you want to move two instance variables:

    Speed and ang. That’ll be your speed and angleOfMotion.

    Then the motion can be done with one event.

    Every tick

    — sprite: move self.speed*dt pixels at angle self.ang

    Then for the bounce it should be as simple as adding 180 to ang and moving out of the wall. Here’s what it should look like. The while and second overlap condition are in a sub event if that’s not clear.

    It moves out a pixel at a time but you can do a smaller step if needed.

    Sprite: overlaps wall

    — sprite: add 180 to ang

    ——while

    ——sprite: overlaps wall

    ——— sprite: move 1 pixel at angle self.ang.

    -cheers

    Hi there! Sorry for the long wait. I've implemented your idea, changed some variables, and ultimately polished and reorganized what I've done so far.

    Initially I thought that was a bad idea, instead it turned out that it's exactly what I wanted! Thank you so much for your help.

    As for now I'm doing great, eventually I'll let you know if I still have some issues.

  • Hi, I'm back because I have a question.

    In the end, my character can swipe thanks to the bullet behavior.

    But sometimes, when I hit the corner of an object, even if it's square shaped, the character bounce diagonally. My question is if it's possible to use the bullet system but they can bounce only on 4 precise angles (I guess 0, 90, 180, and 270). Thank you!

  • For lerp effect to work, it should update on every tick.

    See this demo:

    https://www.dropbox.com/s/tjowni4xr1fgkc9/Healthbar.c3p?dl=0

    Sorry for the late response. I've added the function on every tick and now it's working as you said, which is cool!

    But still, I think it's a awkward. By looking at the videos you can see the bar takes too long to reach the end, especially when it's near to 0. I wonder why.

    That said, thank you so much for your help, as always, you're very helpful and I hope this project of mine will finally show up in the future!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not at home so I can't accurately talk about the function, but I've already tried your suggestion and it didn't work.

    The bar goes too slow and when the value reaches 9, it's still not completely empty.

    The bar is about 362x14 (yes I tried changing 500 with 352), but like the author of the topic, I'd like that it's scalable like with the progression bar offered by Construct 3. This is why, in the (b) function, I've added Self.Width instead of the 362.

    If I can I'll show you on phone a recording of the two bars (the one I made and the one from Construct 3).

    EDIT1:

    Here's the first video

    drive.google.com/file/d/1isNUmKF81RhwjRmz199BFW6e6XQdBJ39/view

    This is with the function I showed you. The next is with the function you told me, except for the change of size (362 instead of 500)

    drive.google.com/file/d/1itaD0W9d8s1f-MaCHtaPd2P-zuVmyIUL/view

  • You mean gradually? Try lerp:

    Bar set width to lerp(self.width, 500*(Player.health/100), dt*2)

    I know it's Construct 2, but I'm doing something similar with the bar (in Construct 3). I used the progress bar but apparently I can't customize it, so I've used a tilemap like suggested in the website.

    Now I've found this and thankfully the lerp function is what I had in my mind, only logically speaking.

    But it's not working well in my case.

    The character drains energy graudally. There is a global variable called HealthBar with the value of 60. Each second, you lose 1 point, until it reaches 0.

    I tried to make the function for the bar.

    lerp(Self.Width, Self.Width(HealthBar/100), dt*2).

    And I tried experimenting, changing variables etc, but it doesn't work well.

    For example, when HealthBar reaches 0, the bar is still decreasing. You have to wait the HealthBar goes to -60 to see the bar empty.

  • Yes you simulate control and when on collision with something you reverse the direction. But that only makes sense if it moves on its own.

    Yeah it's 50/50, since you don't need to hold the button to move the character, but you definitely choose the direction. The reverse direction doesn't work always, while bounce off solids does with bullet behavior.

  • Ok... It worked. I... Thank you so much for your help.

    I've been in contemplation for hours, I knew something was wrong in that event, but I didn't know what and how... I'll pay more attention in the future.

    I'm still interested to know if there is a way to allow bouncing with 8Direction (for the future), but as for now I'll leave it in this way.

    Thank you.

  • I don't think they are visible, I don't see any events relating to movement of the character from those mouse clicks or keyboard presses.

    AH-ehm, ok.

    dropbox.com/s/twhpdn2qzp2wj4m/test2%281%29.c3p

    Again, if the bullet behavior isn't ok, I can just use 8Direction.

    Just... I don't know how to make the character reflect position after hitting the wall.

  • Not really sure what I'm looking at, only you know the game. It's a sprite bouncing left to right off solids, what's the issue? What is meant to happen that is not happening? Are all the relevant events visible in the video?

    Yes, all the relevant events are visible in the video.

    With the bullet behavior:

    If the character is created, bullet speed is set to 0.

    If I press arrow down, the bullet speed is set to 150 and the bullet angle motion is set to 270 degrees.

    The issue is:

    In game, at the very beginning, when the character has bullet speed set to 0, if the player presses arrow down, the character does not move down, but right.

    This, only when the character has 0 bullet speed.

    If I let the character stop (returning to 0 bullet speed) the issue returns.

    __________________________

    Anyway, if it's too hard to solve, I'm ok to use the 8Direction behavior, but I don't know how to make a bouncing effect similar to the bullet behavior.

  • Shoot.

    I posted this on Construct 2.

    My bad...! Is it possible to move the question on Construct 3?

  • "If the character has the speed set to 0, you can't change the direction to either up or down, but just left or right. This, only when the speed is set to 0. In the game, after you choose a direction, the speed goes automatically to 150." Is that true?

    Here's a video with the *bullet* behavior on.

    dropbox.com/s/0gf2grs7mogw8b3/2020-08-16%2001-02-41.mp4

    Watch both the direction of the mouse and the particles I've added to the character.

    This game is meant for mobile, so I'm doing swipes.

    If you're wondering, yes, I've tried changing the swipes with the keyboard commands, but nothing changes.

  • Hi, I didn't want to ask for help again, but here we are...

    Ok so, I'm making a 4 direction game, in which the character reflects the walls. Meaning if the characters goes to right, and hit the wall, automatically goes to the left, and so on.

    At first, I immediately thought to use the bullet behavior for the character.

    And in a sense, it works. But there is a problem.

    If the character has the speed set to 0, you can't change the direction to either up or down, but just left or right. This, only when the speed is set to 0. In the game, after you choose a direction, the speed goes automatically to 150.

    Since it looked a specific issue, I tried with my trials and errors, but I haven't found anything that could work.

    ______________________

    So now I've tried using another method, which is 8Direction (limited to 4).

    In this case, I literally had no issues with moving and choosing the directions.

    But.

    Now the character can't reflect the walls properly.

    With the bullet behavior, I can easily use the "Bounce of Solids" option.

    While with 8Direction I have to add a "Reverse 8Direction" action when the player collides with the wall.

    As a result: If the character starts and goes to right (angle of motion 0°), hits the wall and it successfully goes to the left (angle of motion -180°). But when the character hits the left wall, it goes down (angle of motion 90°).

    If the character starts and goes up (angle of motion -90), hits the wall and goes to the left (angle of motion -180°), and hitting the left wall, the character goes down again (90°).

    I'm probably considering the angles in the wrong way, but at the moment I have no clues on what to do.

    Do you think would be better for me to continue with 8Direction or Bullet behavior? And how can I fix one of the two?

    Thank you.