brushfe's Forum Posts

  • That did it! So simple, gah! Thank you very much!

  • Happy new year!

    I'm trying to create movement for a game with a perspective similar to a beat-em-up. Whether I use 8-direction or Custom Movement, there's a serious judder when the object moves diagonally.

    If anyone has any clues on how to smooth out the movement, I'd really appreciate it!

    The movement code is here, if it's helpful:

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

  • It looks fantastic! Great work and thanks for sharing it!

  • Hello! I feel like there was a plan to review the suggestions page every six months or so, to try and make the platform more applicable - is that still the case?

    (There are a lot of great ideas on there and I'd love to see how this new approach to user input works out.)

    Regardless - happy holidays to everyone! It's been an amazing year for construct, so a huge thank you to the Scirra team. And to all those who've been helping each other out with their projects!

  • You could also try giving each powrplant a boolean called IsActive. It starts false, but when the plant gets activated by three workers, you set it to true.

    Then, whenever you run a check to see if a powerplant should get activated, also check if IsActive is false. So you'll only ever activate plants that have false booleans.

  • I don't know if this solves your problem, but it looks like both those blocks of code are running on each mouse click.

    The first block (if WorkersAssigned ≥1) sets Minerals.WorkerAssigned to 0. Then the next block checks if Minerals.WorkerAssigned is ≥0, which it was just set to, so it runs as well.

    If that's causing you problems, you could try putting an else statement in that second condition, so it reads "else if WorkersAssigned ≥0". That way the mouse click only checks for ≥1 or ≥0.

    You might also need to pick a specific Minerals object. Right now, your actions are picking a random member of the Minerals family, which could also cause trouble (unless you only have on Minerals object).

    Hope something in there is helpful!

  • That code looks like it's going to restart the animation every tick -- so it's essentially stuck playing the first frame of the animation over and over again.

    You might try removing the condition

    • Every tick

    and replacing it with an inverted animation check

    • X is playing animation "Walking"

    which you can do by creating an "is animation playing" condition, right-clicking on it, and selecting "invert".

    In short, this new code would only play the animation if it wasn't already playing.

  • Right, that makes good sense. And certainly minimizes the amount of if/else comparisons. Thanks very much!

  • Sorry, what I'm asking is how people deal with calling functions with boolean parameters when the boolean value isn't known.

    Ideally boolean parameters wouldn't be a tick-box, but a value field, like string and number parameters are. That way you could use a variable value at runtime. Instead it's hard coded by the programmer.

    E.g. Say function PrepareMeal has three booleans: eatsMeat, eatsVeg, eatsFish. And say the customer object has the same three boolean variables, but each customer has a different combination of true/false. You'd ideally pass through the customer objects' boolean values into a single function call, like "PrepareMeal(cust.eatsMeat,cust.eatsVeg,cust.eatsFish)", but functions don't accept variables for booleans.

    So it seems like you either have two options:

    1. Use a bunch of if/else statements calling the function with different combinations of booleans.

    2. Use a Number parameter instead of a boolean, which can accept a variable.

    Option 2 seems best, it just felt weird to not use boolean parameters for boolean variables.

    So I thought I'd ask if there was a better approach to this before converting all these if/else groups to functions using numbers instead.

  • What's the best way to set a boolean in a Function call based on a variable value?

    I can only see the "tick box" in the Function call dialog, which is only set by the programmer.

    My current solution is a pair of if/else statements for each boolean:

    • If sprite.boolean, call Function with the boolean tick-box ticked.
    • Else call Function with the boolean tick-box unticked.

    Now I'm thinking all the Booleans parameters should just be Numbers-but doesn't that defeat the purpose of having Boolean parameters at all?

  • I've only played the first few levels, but this is really impressive! Especially for 50 events. I'll see how far I can get on my poor trackpad...keep up the great work!

  • If you haven't already, check out imagepoints in the manual. If you need to pin something, you might need to set the imagepoint higher on the enemy sprite, which you can do inside the animation editor.

  • Good to hear you've got it sorted! I think oosyrag is right about AdvancedRandom; it took me a while to get into it (the tutorials on this site are great), but it's amazing for generating interesting gameplay situations in an elegant way. Hopefully you can dive into it some time!

  • There are certainly more elegant ways to do this (mentioned by other users above), but this is one way to solve it. It introduces a new variable called "next position" for easier comparison.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1.)So you mean to say it is my responsibility to figure out in advance that servers are gonna be down. Cool

    2.) Service is down for more than 48 hours. Read again. 48 hours

    3.) If they would had been working on the issue then they would had issued a message.

    It's not difficult: if you don't want to accept unexpected outages, your development workflow should use build services that are under your control. Or, if you use 3rd-party build services, you should expect that your workflow will be occasionally interrupted by unexpected outages and external dependencies. It's one or the other. More control and less convenience, or vice versa. If you choose convenience, but also expect things to go your way/move at your speed/etc., you're likely going to be as unhappy as you are now.