Sup with that?'s Forum Posts

  • Haven't used LocalStorage in a bit so maybe I'm not remembering correctly, but, I think you need LocalStorage to run a "check if item exists" (you can stick that into the On Start of Layout event) before it'll respond to "is item missing".

  • Not sure there's a command to disable just one object from an entire event group. You may instead need to make the events in said group check for another condition which you can use to moderate objects. Something like a boolean or number variable.

    So e.g.

    If sprite does X + sprite's boolean is true --> do action

    This way you can set the sprite's boolean to false and it will be excluded from the action.

  • Depending on what you have to click in the game, you can perhaps make a sort of "captcha" style button which gets moved randomly after each click. That way, if an autoclicker keeps missing the button you can make the game stop registering clicks for a while or something.

  • Well the multiplication symbol in C2 is * so you just need to put that into the expression, e.g.

    2 * Variable1

    This will give you the result of Variable1 (which can be your user input) being multiplied by 2.

  • On second thought it might not have been the fault of the conditions but the input. The angle I was testing was between two objects, i.e. angle(x1, y1, x2, y2), so perhaps it was testing the angle from the target object to the sprite, thus giving me inverse results. That'd make sense, heh.

    Anyway, thanks for the replies y'all.

  • So this isn't really a problem per se, just wondering if I'm understanding this condition correctly. The way I took it, if angle X is closer to angle Y measuring clockwise, then it's true. Consequently, the inverse of this condition tests if angle X is closer counterclockwise. Manual seemingly confirms this.

    Anyway, I was using these conditions to make a sprite play different animations when it's clockwise/counterclockwise from another object, and it basically did what I wanted it to except that the conditions registered as exact opposites to what I expected. In other words, when the Sprite was facing upward and had the Object at around its 3 o'clock, it registered it as counterclockwise. When it had it around 9 o'clock, it registered it as clockwise.

    Of course the solution was to simply switch the conditions, but now I'm wondering if I'm understanding these conditions correctly.

  • You could maybe give the monkey Bullet behavior to start off with, have gravity enabled, set its initial direction at 45 degrees and set initial speed dependent on the power meter. Then once monkey lands, disable Bullet behavior and enable player control.

  • If you're trying to get the angle between to points, I'm pretty sure there's already a built in function. IIRC it's "angle(x1, y1, x2, y2)" where the X and Y correspond to the position of points 1 and 2 respectively.

  • Just add another variable and use it as a condition for resource generation, like e.g.

    Variable Money>0 + Variable Level>5 --> subtract 1 from Money

    This is will prevent Money cooldown from reducing unless Level is greater than 5. You can then modify Level each time you upgrade a building.

  • Well, a quick and dirty way you can do it is by using sprite animations.

    e.g. For every free spot on the hill where you can build, place a sprite which is either set to invisible or has a clear animation so you can't see it. Each sprite also has other animations of different buildings which aren't shown at start. Now set conditions like,

    If player selects sprite

    + player clicks pink button

    + sprite is clear

    + Gold > 100

    • -> set sprite animation to "Barracks" + Subtract 100 from gold

    (So if we select a clear sprite and click the "build barracks" button, and have enough gold, we build a barracks)

    If player selects sprite

    + player clicks blue button

    + sprite animation is "Barracks"

    + Gold > 200

    + Lumber > 100

    --> set sprite animation to "BarracksUpgrade1" + subtract 200 from gold + subtract 100 from lumber

    (So if we select a "barracks" sprite and click the upgrade button, and we have enough resources, we upgrade the barracks)

    For resource generation, you can use variables like e.g. give Barracks a variable Money and do something like this:

    Variable Money>0 --> subtract 1 from Money (you can also use delta time)

    Variable Money=0 --> set Money to 100 + Add 5 to gold

    (This means each barracks will generate 5 gold every short interval)

    Anyway, that's one way to do it. Probably could use some finesse and tuning to suit your needs as they come up.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • lol I was hoping someone would offer a solution since I wanted to see one too.

    Anyway, maybe have a look at the example provided by Yann at the bottom of this thread, it looks like something close to what you're doing, I just haven't fiddled around with it any.

  • Soooo.... What's the question exactly?

    Sorry, I'm not sure I understand what you need help with.

  • You most likely need to make it a sub-event so it doesn't interfere with the Demon's movement AI sorta like this:

  • Yep just add a similar condition for where the Tri Demon is moving towards the player

  • Is it the player character that's having the problem? You can do the same thing for him here: