iKiwed's Recent Forum Activity

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

  • Try Construct 3

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

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

  • > "Compare touch speed" and "compare touch orientation".

    This is possible with expressions - Touch.SpeedAt(0) and Touch.AngleAt(0)

    This should be enough for simple swipe gesture recognition, but you might also want to compare touch start and end time - to check that it was a short gesture.

    https://www.dropbox.com/s/gk6xktdvn0p9cn0/SwipeControls.c3p?dl=0

    You are a life saver as usual!

    Yes, I've also made sure that triggers only once, else for the game it's like if I'm swiping forever ahah.

    Thank you a lot.

  • Hi friends. It's been a while, but I'm here again.

    I'm making a new project. This time for mobile. And I'd like to end this project, possibly.

    Since it's meant for mobile, I'm trying to include the touch controls.

    While I'm ok with the choices selected by Construct, and I love making buttons to be pressed, I noticed I haven't found much about swiping.

    In my game, the character can change in 4 direction: Left, Right, Up and Down.

    So, if the player wants to go up, they should swipe vertically from botton to the top. Or, if the player wants to go to the left, they swipes horizontally from right to the left.

    I'm not the best in coding and all, but logically, I imagine it has to do with the orientation of the swipe. Something like "Compare touch speed" and "compare touch orientation".

    All the tutorials I've found are old or extremely long, like if such feature is not that possible.

    If it's not too much to ask, do you know how I can solve this task?

    Thank you for reading and your help, have a good day!

    Tagged:

  • In my demo I only change player's position, this should not affect z-ordering in any way.

    Are you spawning a new player on start of each layout? Check that your player sprite is not set as Global. If this doesn't help, there must be some other mistake in your code, please share your project file.

    Awkward, about 1 hour after I sent my message I updated it just by saying that I did indeed solved it again in the same way I solved the other issue - and yes, it's just as you said, the player was set to global. Not sure if you can see the edited message.

    Again, thank you very much for your help! I guess I cleaned up a bit some events and I believe it's going perfectly now.

iKiwed's avatar

iKiwed

Member since 17 Jun, 2019

None one is following iKiwed yet!

Trophy Case

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

Progress

8/44
How to earn trophies