InDWrekt's Recent Forum Activity

  • Thank you for posting your project. calminthenight is correct but here is a little more information. When you set variable1 to 0.06, the system is registering it as 0.060000000000000005.I know that seems strange but is a problem that computers have when storing really small numbers. These 2 values to us are functionally the same but the computer sees it differently. If you change your variables to integers as calminthenight suggests, you won't have this problem. I am unclear why you are using the decimal value in this project in the first place but I would suggest converting to the decimal only where you need it.

  • Try this, in the LAYOUT PROPERTIES window, look for "Unbound Scrolling" and put a check in it. Then run your project. If it does what you want, then your layout is too small vertically for what you are trying to do. For scrollto to scroll to the position you are trying to scroll to, the position needs to be <= the height of the layout - the height of the window. If that doesn't work still, we would need access to your project to find the problem. A screenshot of your events isn't enough information.

    Plus, you can reduce your events/actions for setting the position to a single event.

    + System: Every tick -> System: Set scroll Y to 100000 × Variable1 + 500

    Since you already have an "Every Tick" event, if you put the single scroll action into that event, these 8 events would become 2.

  • You should add all these sprites to a family and give the family the instance variable. Then, you just need to pick all instances of the family.

  • I knew there are some GCSE-level programming basics that I'm missing :D

    Some extra reading helped: bbc.co.uk/bitesize/guides/zs3qrwx/revision/1

    Thanks for the demo! I think I got it.

    Out of curiosity - how does the text attach itself to the targets? Both visually and logically - I see no pins or position definitions.

    You're right, there are no pins or position definitions. I am using a container.

    construct.net/en/make-games/manuals/construct-3/project-primitives/objects/containers

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • An array could work but it would be more clear/readable and thus easier to upkeep if you use instance variables. Here is a small example to get you started:

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

    It will probably take a bit of studying to understand everything going on but it should answer all the questions you've asked.

  • You're welcome. Good luck with your project.

  • So, there was something bothering me about the original example and I couldn't help but mess with it some more. Download the project again. I simplified it. The original example drew the circle in 2 events. 1 split the circle into 8 parts and the other filled the 8 parts again splitting them into 8 parts. I got rid of the second draw event and instead just divided the circle into 100 even parts in the first event. It basically looks the same but reduces some memory use and CPU processing. Plus it's easier to read and upkeep.

    drive.google.com/file/d/12DTzuTArnmAPlzMk6DOdKBqUIbC5Gl92/view

  • Here is a small sample of that chase mechanic built in Construct. The enemy has line of sight and move to behaviors. Tap to move the green character. The red character will chase if it has line of sight. If the red character is within attack range (stored in a range variable on the red character) it will stop moving and start shooting. If the player moves out of range, the red player will go back to chasing. If the red character loses line of sight, it has the ability to try to get it back by moving to the last known location of the player. If it reaches the last known position and still doesn't have line of sight, it stops and waits.

    drive.google.com/file/d/166bydrsqn_XCW5L1q7Z1b_drnzxfeSq0/view

  • You're welcome. Good luck with your project.

  • I also want to say, as with most questions, there are multiple ways to do what you are trying. For example, if you want more control over the color, use individual variables for each of the red, green and blue inputs. Then when you call the set font color, just plug these values into the inputs of the expression.

  • drive.google.com/file/d/1tve8LYP4A-8zaGQ_TZrij61jZj2jmbDz/view

    Ok, you are trying to store the rgb expression itself in a variable. What you need to do is store the resultant value. Check out this example. It sets the value of an instance variable called Color on the text object using the rgbEx expression. It then uses that variable to set the font color. Remember, it is not the rgb expression that is important. It is the value that the expression returns. That value CAN be stored in a variable.

  • Of course there is. It's just a couple sin and cos functions. To get the circle to start at the top we need to rotate it by 180 degrees so we add 180 to the value inside the functions. To get it to fill clockwise instead of counter clockwise, we just need to invert (multiply by -1) the value inside the function.

    sin(-1 * (value + 180))

    cos(-1 * (value + 180))

    Here is the modified example.

    drive.google.com/file/d/12DTzuTArnmAPlzMk6DOdKBqUIbC5Gl92/view

InDWrekt's avatar

InDWrekt

Member since 19 Sep, 2011

Twitter
InDWrekt has 7 followers

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies