InDWrekt's Forum Posts

  • First, I have noticed a few posts where a person asks how to do something to which people respond, "it's not possible." The truth is, "it's not possible" is very rarely the correct answer and if you think it is, don't answer the question because you are probably wrong. In one case, one of the forum moderators told a user what they wanted was not possible, after which I posted a couple different examples showing how to do what the user wanted.

    Next, I learned that there are too many times users rush to the forums to ask a question, thinking they will save time instead of searching the manual, tutorials or even previous topics. This winds up making the user wait a day or more before they can continue their project when a search would have taken only 20 mins to a few hours. In trying to save time, they wind up wasting it instead. I have used the software for more than 3 years and have not once yet created my own question topic because every thing I needed was already documented. This isn't to say there aren't times people might need a little more explanation for which the forums can be very handy. Just that a little research can save time and frustration.

    I've learned that, while the information about C2 says you can make games without any programming, having a good understanding of programming techniques goes a long way toward making it easier. I am constantly using programming techniques to lessen the number of events I use and when answering questions in the forums I like to try to share some of these enhancements. The truth is, C2s event system is really an image based programming language. When we setup up our events, we are programming the game.

    I've learned that people think C2 should make their game for them when in fact it is a tool. Like all tools, it's only as good as the person using it.

    I think the most important thing though is, I have learned a lot about C2 simply by trying to answer questions other users have had. There are so many creative people in the community that just need a little information on their projects and taking the time to help them work through these has really pushed my own skills. If you really want be get a better understanding of C2, open the How To forum and try to answer questions there.

  • In the file menu, it is the export project option. It will then give you a choice of how you want to export it.

  • Try this:

    OnEnterPressed(){

    if (object1.active = true)

    object1.active = false

    object2.active = true

    else

    object1.active = true

    object2.active = false

    }

    The system else event is used to create these toggle type of events. Since object2 is only set active with object1 is inactive, the else statement should work fine.

  • Since you are using physics, you will want to apply forces. Instead of changing the gravity of the ball, you would apply an upward force on it to slow it. Think of it this way, when a skydiver deploys their parachute, their own gravity doesn't change. Instead, they slow down because the parachute is affected by a force called drag. So, when the umbrella you mentioned is open, there would be a "drag" force applied causing the ball to fall slower. To get the ball to change direction, simply change the direction of the force applied.

  • In the following, assume the variable valueToAdd is a string value representation of the number you want to add and total is a float value. Using a string, you can check for an existing decimal with the find() method. Given this information, you would use the following to set the total amount after the addtion.

    set total to total + (find(valueToAdd, ".") = -1 ? float(valueToAdd) / 100 : float(valueToAdd))

    What this does is, first checks if a decimal is present in the valueToAdd (find(valueToAdd, ".") = -1). If the result of the find is -1, no decimal is found so we divide by 100 (float(valueToAdd) / 100). If the result of the find is > -1 the string already contains a decimal so, no need to divide.

    To get more information about the statement, read the ?: section of the expressions tutorial here:

    https://www.scirra.com/tutorials/77/nat ... uct-2#h2a0

    I hope this gets you what you need and good luck with your project.

  • [quote:2ibb7vtz]I pretty much just want an enemy that kind of floats around the screen, ignoring everything except the player.

    According to this statement, I would assume you don't need the object to collide with anything. You just need to disable collisions. Of course to test collision with the player you would have to check overlapping rather than collision with it.

  • Use either the System "Pick by Comparison" or "Pick by Evaluate" event. Both events will pick all instances of an object (or family) that match the specific conditions you set in the event properties. You can then get the item/families PickedCount variable.

  • Take a look at this tutorial:

    https://www.scirra.com/tutorials/940/ho ... -a-project

    The information in the tutorial will give the browsers date/time value. You could also use the Javascript command Date.now(), which will give you the browsers current time stamp in milliseconds. This value can be easily tested to see if more than a day has passed by getting the difference between the stored time stamp and the current time stamp and converting the result to hours (int(result / (1000 * 60 * 60)))

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • eli0s

    I see your point. Thank you.

  • As for why your paddle is traveling up, yes the program thinks the Y position of the ball is higher than the paddle. If there is no ball to get a position from, the value is always 0. You could solve this by adding a condition to the motion of the paddle that checks to see if at ball is in the layout. If one isn't, don't move the paddle.

    To get the ball to spawn at the same Y position where it left the board, just add a global variable and store the Y position when the ball is destroyed. Then use this value as the Y position when the ball is spawned.

  • Just like pinning any sprite to another, you need to give the light source the "Pin" behavior.

  • Construct is already capable of casting shadows. Take a look at the manual:

    https://www.scirra.com/manual/178/shadow-light

  • Animations for off screen items should not significantly affect performance. You could disable the animation if you would like but, it probably won't have too great an effect. In fact, the very act of testing if the torch is on/off screen could completely negate any benefit you would have seen. Take a look at this tutorial about Render Cells for a better explanation:

    https://www.scirra.com/blog/ashley/14/h ... cells-work

  • 2 - No this will not increase performance. All this will do is force the system to test each object each tick to see if it is on screen which would in fact hurt your performance. If you have a really big game with a large number of static objects, you may want to look into enabling Render Cells.

    4 - The pin behavior can have the same result as the set position to object but also has the added benefit of getting rotation from the object pinned to. Also, it is optimized so would cut down on performance issues.

    5 - In almost all cases, using time is better than every tick. Every tick can cause issues because different systems will register a different number of ticks per second.

    7 - You can use more than one else. However, it is only valid immediately following a single easily defined event trigger. Else just means if the last event didn't fire, trigger this event. You can combine an else statement with another condition to create an "Else If" event and have any number of these in sequence followed by i final "Else." See the else section of the tutorial at the following link for more information:

    https://www.scirra.com/tutorials/292/gu ... t-features

  • This is a very common question that has been answered many times over. A little search in the tutorials section would lead you to:

    https://www.scirra.com/tutorials/74/pub ... uct-2-game

    As for the license, you need either a personal or business license if you intend to market your game. The business license is required after you (or your company) have earned $5000.00 or more. Following the link below to see a comparison of the licenses and, most importantly, read the license agreement for the version you use. You need to be familiar with it.

    https://www.scirra.com/store/construct-2