InDWrekt's Recent Forum Activity

  • You should look into timelines to script movement. As for spawning, you just spawn the way you would normally. After spawning the object, assign the timeline to it and it will follow the path you scripted. When the timeline ends, you then move the sprite to its place in line.

  • Just use the System Create Object by Name action passing in the name of the object you want to create.

    Redownload the project and take a look.

  • This might be a little simplistic for what you are looking for but, you could just record the Uid of the field you are trying to plant when you click on it. Then you don't need to pass the x, y values. You can just use the pick by uid event. Check out this example. Hopefully it will give you a starting place.

    drive.google.com/file/d/1x-pSSSw9a3n-0XJOdTIMZDaZzoeXRPmk/view

  • Just use the % (modulo) operator. It returns the remainder of a division. For example:

    28 % 24 = 4

    In the case of the example I gave you, The last line sets the DaysTillBDay equal to:

    Date.ToTotalHours(abs(Date.Difference(Date.Parse(Date.ToDateString(Date.Now)), Date.Parse(right(NextBirthDay.Text, 11))))) / 24

    For the remaining hours, you would just set it equal to:

    Date.ToTotalHours(abs(Date.Difference(Date.Parse(Date.ToDateString(Date.Now)), Date.Parse(right(NextBirthDay.Text, 11))))) % 24

    Even if you didn't know about the % operator though, you could just do this:

    totalHours - (DaysTillBDay * 24)

  • have a system compare 2 values events checking to see if Enemy.Count = 0. If it does, trigger the go to layout event.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are lots of solutions to this problem. Here are a couple:

    1. Add an animation with the hit color and swap between it and the default animation.
    2. Change the sprites color parameter for a few ticks and the set it back to default
    3. Overlay the sprite with an invisible sprite with the desired color and a blend mode of add. Set it visible for a few ticks and then invisible again when it is hit.
  • Construct comes with built in examples. Check out the intermediate example called level select.

  • Also, I just want to say, if you are allowing user input, it is better to force the user to only input valid information instead of fixing their input after. In this case, where the user types in a value, if you only want numbers, use a number input field instead of a text input field. Then, you have less to be concerned about. In Construct, there is a type property in the text input object.

  • At this point, it's on you to learn the tool. The warning you are getting says, the pattern can match on an empty string. That means everything you can enter into it will theoretically match. It's poor design on my part but, it's not my project. I was just trying to get you something you can use quickly. Learn the tool. try to fix the warning. It will be better for you if you take the time to solve it. You will have a better understanding in the end.

    Good luck with your project.

  • I'm going to revise my previous post and say, you will want the global flag. When I wrote that, I was just thinking about leading 0s which will always come out as a single result. With the possibilty of non numeric characters throughout the string, You'll want the global flag to ensure you get all results. Also, I built you a more appropriate pattern.

    ((^[0\D]+)|(\D))

    The previous one would miss some leading 0s if a non-numberic character was in them (i.e. - 00g00100 would turn into 00100). Good luck with your project.

    Edit: changed the pattern to include an or.

  • (\D)*(^0+)*

    Try this pattern. The parens separate the 2 parts of the pattern and the * says search for 0 or more.

    You really shouldn't need any flags for this search.

    Remember, you can go to regexr.com to build and test regex patterns.

  • Thumbs up and well done. Looks and works great. I would give it 25 thumbs up but the forum only let's me give 1.

InDWrekt's avatar

InDWrekt

Member since 19 Sep, 2011

Twitter
InDWrekt has 7 followers

Trophy Case

  • 13-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

18/44
How to earn trophies