winstreak's Forum Posts

  • I would have thought the the tree_sprite.UID would change as I select different sprites/trees.

    It does - but your Global variable Tree_UID is never used.

  • Your code works correctly - I only gave you the list of ways to verify where your issue is because the code you showed us is correct.

    Lionz hit the nail on the head, you are not picking a specific tree when you right the text out. Open your code in Debug mode and you should see each tree holding its own correct values.

  • I would guess you are changing your currently selected tree somehow.

    Open your game in Debug mode and pay close attention to where your code breaks down.

    • Can you successfully click a tree and store the Tree's UID in Tree_ID (bad naming convention going from UID to ID but I didn't notice any mess-ups from this in the code you showed).
    • Does the UID match the tree it should match?
    • Can you click on the upgrade button and keep that same UID saved?
    • When you click the upgrade button does a different tree gain leaves? Does Tot_leaves increase?

    These will all help you realize where your code is breaking down

  • If you are using platformer. Your platform Object (your character) will stop on objects that are labeled solid.

    You don't need solid on your platform Object (your character) and you don't need any extra ticks.

    I am not positive what you mean exactly by stopping before a solid, but you will probably want to look into overlapping at offset

  • Start with a single mission -

    Gather 20 carrots. Which would then set a global quest tracker to 0 and a global quest target to 20. On completed give 500g - Pick new quest.

    Of course you only have 1 quest so it picks that one again.

    Next you make a 2nd quest. then when ever you finish a quest you pick a quest with a int(random(2)). If it's 0 give quest 1 - if it's 1 give quest 2.

    Then you can make as many as you want and always randomly give the user 1 quest.

  • Took me a while to figure out double click to drop seeds - which meant I lost a lot of seeds. You shouldn't lose a seed until it is planted - when you click on the vegetable in the menu you should just highlight, and then remove the seed as planted.

    Quality of life suggestions: I definitely wanted hot keys to speed things up. Also, maybe I just didn't know how, but planting more than 1 seed at a time (Like how you can lay soil and water multiple).

    Game is missing a draw - why am I planting seeds to get points and money. You can add to this draw with a story that gets played out - or make it very skill based to get faster/closer to a perfect game - or lots of upgrades and insane amounts of money.

    Loved the graphics. Very good base product, you just have to take it further. ^^

  • Duh... I feel dumb. In my defense it was before lunch!

    Thank you so much Magistross

  • I have ventured into Advanced Random which seems great so far, but I can't use Advanced Random as a condition. I am struggling to figure out how to work with the random values I pull if I can't compare them. I created a simple Program that calls a weighted table 100,000 times and counts how many times the Success is hit with a 1% chance (99, "Fail" 1, "Success").

    I made it work by checking for the text to match 'success', but this is obviously not the intended route. Any tips would be appreciated :)

  • That would definitely help ^^

    It is up to you being the creator - Im just here to help with the mechanics malfunctioning :-p

  • After looking at the math you just find the longer distance between vertical and horizontal. Whatever the shorter distance is, gets used up with diagonal steps.

    Find difference of X of current and X of chest then compare if its greater or less than Y of current Y of chest. If greater int((x/32)+0.5) or round(x/32)

  • It works but it’s not very exciting.

    You get the max points with just 6 plants down with no reason to harvest them.

  • Floor and int work the same in construct - they both floor.

    I would guess you’d need 2 equations. 1 for how many’s diagonals you would have to take, then add how many straight squares.

    If you’re 8 up and 3 to the right you would solve for 3 diagonal steps then 5 straight.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The way you started your code, even if done correctly, would only work for abobora & Cenoura - Squash and carrots I think.

    You would then have to check if you have carrots and raddish and then Squash and Radish and then cabbage and squash, cabbage and raddish..... so it becomes a lot.

    You want a way to check is there at least one animation on squash, if yes add 1.

    Not sure if there is a build in function but you can set a global to 0 every tick, then add 1 if there is atleast one of each type.

    Like with mine, only instead of saying the number I have you set your animation based on it.

  • Never worked with touch, but I assume it works the same as click events.

    Which means: Since construct runs the code top down you are clicking to switch your animation from 0 to 1, then it will be playing animation 1 and switch it to 2 then it will instantly see it is playing 2 and switch to 3. This is most commonly fixed with else statements:

    If you want further information on the topic I created a video a while back that explains it in more detail:

    youtube.com/watch

  • One way is by setting the collision of the Square you want to check what squares are around it to be larger than the actual image. Then check what it's overlapping.

    I have a short video that works with this idea:

    youtu.be/BIoVQBCXtI4

    You would want to change your collisions to only hit top right bot left though like this: