Lou Bagel's Forum Posts

  • How do you disable user input?

    How would it look on an Event Sheet?

    I still need to figure out how to avoid collisions with another object. Such as a falling rock and I go to hit jump up, the rock needs to then be able to pass under the player while the player jumps.

    You could put the controls in a group and deactivate the group. I usually turn the "Default Controls" to No and event my own controls so I have more control over it. I thought there was an event to set the Default Controls to no but can't find it. But however you have the controls setup you disable it, could be with a variable also. (If left arrow down and ready = true then simulate left. If doing that way just change the boolean ready to no)

  • If you aren't already using a movement type I would use lerp()

    If you aren't familiar with lerp() it is actually pretty simple. lerp(position1, position2, progress) -> progress should be between 0 and 1 where 0 = position 1 and 1 = position 2.

    So I would have an instance variable of progress and speed. Then Left and Right I use below are the farthest left you want the player to go and the farthest right you want the player to go.

    Events would be:

    Every tick -> Add Speed to Progress; set position to lerp(Left, Right, progress)

    --Progress <= 0 then progress = 0

    --Progress >= 1 then progress = 1

    --Speed > min speed then reduce speed by ?

    Every button press

    --Speed < max speed then increase speed by ?

    Your speed is going to be very small because a speed of 1 would move from left to right side of screen in one tick. Even a speed of 0.1 is too high. Maybe have max speed be 0.02 and min speed be -0.02; increase on button press 0.001 and decrease every tick 0.0001. ...those are just educated guesses though from math in my head, so may be way off.

    If you are confused could throw together a capx but probably not anytime to soon... hope this helps

  • What about this:

    Disable user input (however you have it setup)

    Increase movement speed

    Play jump animation

    Simulate input in desired direction

    --

    Return movement speed to normal

    animation to default

    enable user input

  • Very nice thread - I enjoyed reading through this from start to last post Good luck in your development I like where this is going!

    Thank you! I hope to have some time soon to post some more and work on it further.

  • Thank you so much. This happens a lot. Do you know why?

    When you edit the image in certain ways the origin remains in the same spot, for example if you paste a small image and click the auto resize the origin will remain in the center of the originally sized canvas.

    Personally, I have found it is best practice to check where the origin is after editing an image every time.

  • You can figure it out but it will require a little math (surprise surprise, right?)

    In one wheel revolution the cart should travel the distance of the circumference of the wheel. So in the time the wheel rotates once the cart should move the circumference. So, cart speed/second = rotations/second * circumference.

    Therefore set your rotate speed to Cart Speed / circumference

    ...I believe this is correct but its kind of all off the top of my head, and maybe there is a Construct feature/expression that can make it simpler for you but I'm not aware

  • To set the speed of one object to another, as your title suggests, you can simply do set Object1 speed to Object2.speed.

    Not sure if that applies to your wheels though. But similar thing can be done but not sure how you have it setup. May be rotate speed or an animation but same principle works.

  • I like this thread, really nice and inspiring approach for the development process combined with educational tips for the ones who are interested. And I love the art! Keep it going.

    Thanks! I hadn't had much comments on the explanation of the events so wasn't sure anyone appreciated that. Now I will try to do another one soon!

    Funny thing is I think most of the events I changed before I am completely redoing due to the change in gameplay and input. But that's game development for ya!

  • Working on a new aiming system. Not finished yet but let me know what you think:

    Bigger area to hit the closer the enemy and the slower it gets the longer you aim

  • That's an amazing example. Thank you for sharing, badmoodtaylor.

    You are welcome! And press Tab to cycle through the different ones, if that note goes unnoticed.

  • Capx that I made a while back with 5 different versions:

    https://www.dropbox.com/s/bhpanbu7q6hws ... .capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yeah, what said. That is why they have a category under platform events called 'animation triggers', to make it easier to separate out.

    To reiterate, the way you have your events if the left or right arrow is down at anytime it will begin playing the walking animation. So your jump animation does start but is immediately changed back to the walking one.

  • I just found this thread:

    Wonder why I didn't find that through the search function...

    I'm sorry for repeating this question, I'll try your solution and try the solutions from the thread.

    [EDIT: I tried your solution @badmoodtyler, but it keeps turning in a counter-clockwise direction, so it always chooses the second option which actually can't be possible.. > > I'd love to send you a video but my internet won't allow it..]

    One of the angles is probably a negative value which will mess up that equation. I really don't get why it returns or even allows for negative angles— if the angle is -10 why doesn't it just return 350?

    So if you can compensate for that it should fix that, I think, but obviously I don't have a full grasp on this

  • Another simple idea to try, depending on the desired effect:

    Set Angle of Motion to: angle(missile.x, missile.y, target.x, target.y) > missile.angle ? missile.angle + x : missile.angle - x

    Replace X with any number or variable based on how much of a turning radius you want.

    Simply, this is comparing the angle of the missile's movement and angle between missile and target and closing the gap between them. Of course if they are exactly equal I guess it will zig-zag or waiver a bit.

  • You are welcome. the ?: looks confusing at first glance but it is very simple. Type a condition then put a question mark. Then type the result if true, put a colon : and then what the result is if false.

    So to test it out if you have a global variable called SCORE and a textbox, choose the action set text and type:

    Score < 200 ? "Good" : "Great"

    If score is less than 200 the textbox will say good. 200 or more and the texboxt will say great.

    Description from elsewhere:

    [quote:3klt24eh]

    ?: is a conditional operator, which allows you to test conditions in expressions. This is especially useful when used with the comparison operators and logical operators. It takes the form condition ? result_if_true : result_if_false

    e.g. health < 0 | score < 0 ? "Game over!" : "Keep going!".

    The condition counts as true if it is non-zero, and false if it is zero.