dop2000's Forum Posts

  • I've been getting inconsistent results using the second method. Sometimes the colour looks completely different like in the screenshot below, where red displays as blue. Could you explain why this happens?

    You can't use online tools. C3 uses some custom formula for colors, so you need to convert r+g+b values with rgb() expression. Make a little project with 3 text inputs and a button.

  • Color data consists of 3 values. So if you want to store them in one cell, you will have to store them as a string of text. For example "255,0,255" (but without the quotation marks). And then separate them into 3 numbers for rbg() expression:

    Set colorVar to Array.at(0,2)

    Sprite set color to rgb(int(tokenat(colorVar,0,",")), int(tokenat(colorVar,1,",")), int(tokenat(colorVar,2,",")))

    .

    Another option is to pre-calculate all color values. For example, rgb(255,0,255) returns number 16711935. So you can store it in the array and use directly in "Set color" action, without the rgb expression.

  • 2048 text objects all displaying 2 characters each

    Text objects are rendered on the canvas, and updating so many of them on every tick is not a great idea. Can you compose a single string and display them all as one large Text or SpriteFont object? Using a monospaced font of course. It should work a lot faster than 2048 separate texts.

    I would probably use a combination of Javascript and events - a script to generate that string and events to display it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't have rex's demo, but here is mine

    dropbox.com/scl/fi/b7znsclmmgnkzpi8cracv/spline_demo.c3p

  • What exactly is your question?

  • how do you open the project in an older version

    Unpack c3p file into a folder. Open project.c3proj file in any text editor and update this string:

    "savedWithRelease": 39700

  • You mean you use "Add animation frame" action, and then load an image into it?

    Yeah, there really should be an action to set origin point for the added frame. Please vote for this suggestion:

    github.com/Scirra/Construct-feature-requests/issues/246

  • You can add several empty frames in the editor, with different origin point positions. Then in runtime select a frame with the desired origin point position and load your image.

  • Rex's Spline addon is pretty straightforward:

  • I posted a suggestion a few years ago for "Is project file exists" condition, but it was declined.

  • Instances on an inactive layout are not pre-created and can't be destroyed.

    When in runtime you need to create an instance of an object, C3 engine will search all layouts for this object. And, once found, will use it as a template. If the object exists on multiple layouts, the first found will be used.

    So my guess is that there is zero performance impact.

    There is another thing to consider though. When you create an object from an inactive layout, there may be a small lag while its images are loaded. (especially if it's a large sprite with lots of animations). Placing an object on the current layout and immediately destroying it allows to pre-load the textures into memory. So the next time you create an instance of it, it's created without a lag. However, you can use "System Preload images" actions to achieve the same result.

  • Why do you need all 8 directions? You can only detect left/right/up/down and the behavior will do the rest.

    Lefx X axis<deadzone : 8direction simulate pressing Left
    Lefx X axis>deadzone : 8direction simulate pressing Right
    Lefx Y axis<deadzone : 8direction simulate pressing Up
    Lefx Y axis>deadzone : 8direction simulate pressing Down
    

    Another option is to calculate the angle:

    Set a to angle(0,0, Gamepad.Axis(0,0), Gamepad.Axis(0,1))

    Then round it to the nearest 45 degrees:

    Set a round(((a+360)%360)/45)*45

    a will contain a number between 0 to 360 in 45 degree increments. For example a=135 means Down+Left.

  • Correct.

  • You will have to do this with events. When such slope is detected in front, change Player position directly, or apply VectorY+VectorX, or temporarily disable Platform behavior and move the character up the slope with MoveTo.

    Look for the examples of ladder implementation in platformer games, it should be pretty similar.

    Here is a simple example, but you can try other methods depending on your game.