InDWrekt's Forum Posts

  • You can do this easily with an array using the push and pop commands. Create an array that has a size of 0, 1, 1. When you pick up a power up, add it to the array using push back. When the power up ends, remove it from the array using pop front. The active power up will be at array position 0 and each consecutive power up will be listed in order.

    drive.google.com/file/d/1j1qrviGaw4TJ6Bqs8y8-1mrrZ13_ucEN/view

    Edit: I had the front and back swapped around so I fixed it above. to be clear, you PUSH BACK and POP FRONT.

  • It looks like you are using the free edition of Construct. If you take a look at this page:

    construct.net/en/make-games/buy-construct-3/personal-plans

    You'll see the free edition doesn't have the capability to export to anything other than the web.

  • eleanorjmorel I don't know your background in game developement but, I have over 10 years of experience working with Construct as well as Unity, Garage Games, Godot, XNA and programming games in Java, C++ and C#.

    Your examples are not relevant in this situation. For Honor is a full 3D game as well as Unities pill shaped colliders. If this sprite was a composite object made up of multiple sprites, then this could be a little more approriate to the situation.

    Your Celeste example actually shows a reason the separate collision object is a bad idea. If you define a hazard but your collsion bounds allow you to touch that hazard without being affected, that is a bad thing. I am not the developer of Celeste so I don't know what all decisison they made leading up to that situation so I can't really judge it.

    What I can say is, using a separate sprite for collisions instead of Constructs built in collsion bounds SHOULD NOT be passed around as the "best practice" for every situation. It adds another object that takes up memory. It creates a generic collision size/shape for objects when the developer may want something more specific (if you want the generic collision size/shape, you can use the bounding box as the collision bounds to get the same affect without these other problems). It adds complexity which is harder to upkeep (especially if the project winds up being handed off to another developer).

    Finally, I am not saying it is wrong to do. Just that pushing it as the end all be all for every situation is wrong. In this particular situation, I would not use a separate collision object. Your example of using the single object for multiple object types that have the same behaviors is one of the "specific situations" I referenced (however, this can be done using families without causing these other problems). Composite objects are another situation where a collision sprite would be a good option. This will be my last responce in this post about this subject. boomerfreak1, hopefully you have enough information about this to make your own decision about which method is the best one for your project.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • eleanorjmorel, please stop spreading this flawed logic. It has been passed around this forum for years but is only really useful in specific situations. The sprite has collision bounds for a reason. It is so you can define your collisions based on the sprite shape easily. A separate sprite which defines collision bounds is FAR more difficult to fit to the sprite object you are working with.

  • I see this all the time with newer users. The animation is switching between the run and fall animations. Take a look at this screenshot:

    The arrow shows the distance between the floor and the collision bounds of the image while running. Since the collision bounds are not on the ground, the platform behavior thinks it is falling and swaps to the fall animation. I know intuitively, you think the collision bounds should stay wrapped exactly around the player but that isn't really the case in a game. Keep the collision bounds on the ground to avoid this problem.

  • Try this out but replace NextBirthDay

    int(Date.ToTotalHours(abs(Date.Difference(Date.Parse(Date.ToDateString(Date.Now)), Date.Parse(Date.ToString(NewDate))))) / 24)

    A quick forum search could have lead you to a post where I answered almost this exact question. Here is the project I built to answer it. This project shows a countdown to a persons next birthday.

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

  • Your image origins are off. Go into the animation editor and, on the left side find the button to edit image points. Then, you just need to set the location of the origin to the correct point of the image.

  • regexr.com

    That site has refernce sheets to the different building blocks of a regex expression. It also allows you to build a regex expression and test it agains a line of text to see if you are getting the results you want.

    You can also just search regex on google and find lots of sites that teach about it. Not sure what tutorials you are finding or where you are looking. Don't search for regex tutorials related ton Construct. Regex is a broad subject used in programming in general. Most Construct tutorials will be too specific like the expression I posted that just removes leading 0s.

  • No problem. Make sure to take some time to read about regex. It is a common programming tool that will serve you well. And, good luck with your project.

  • Just copy that first line of my post and paste it right into your set text action and watch the magic happen.

  • That's correct.

  • RegexReplace(Self.Text, "^0+", "", "")

    You should look into the RegexReplace function. The code written above is what you set the text to in the set text action.

    There is no need for a loop. No reason to check the string 1 character at a time. Regex simply looks for a sequence of characters that match the search criteria entered in the second parameter and replaces it with the value in the forth parameter. Of course you should also learn about regex but basically this is what it is looking for:

    ^ - This signifies that is starts at the beginning of the string. If there is a match further in the string, it won't be replaced because the match must be the first thing in the text.

    0 - This is the character the regex is looking to match.

    + - The plus sign following a number or letter says to match 1 or more instances of that character. So, in the case of leading 0s, it doesn't matter if there is 1 or 100, they match and will be replaced.

    Regex is an extremely powerful way to work with and manipulate text objects and can save both coding and processing time.

  • I do want to caution you about using really high numbers though. This program works great until you get to the 79th number in the sequence. Then the number becomes too high and, do to the nature of computers and numbers, you start to run into rounding issues. If you really do need to include the 100th number in the sequence as mentioned in your post, you are going to have to break the number into different parts (millions, thousands, hundreds, etc...).

  • Try this out:

    In the image, the "set text to Variable1" action is where you would set the variable you will be using in your game.

  • You'll get better/faster responses if you post your project here so we can take a look at what is going on.

    That being said, I have had a similar issure only on the edges of the tilemap where the tiles aren't full tiles. For example, if the tiles are 30 pixels wide and the total width of the tilemap is, 290 the far right tile will never be able to be drawn. If your problem is specifically at the edge, check to make sure your tilemap width/height is a multiple of the individual tiles width/height.