RafaelMatos's Forum Posts

  • You do not have permission to view this post

  • This sounds interesting, are you basically thinking of an array as an instance variable? If I’m understanding correctly this could be a useful feature!

    Instead, you could look into using a dictionary instance per object and/or one or more arrays. Or a comma separated instance string variable and then use tokenat/count to loop through where necessary.

    Not an array, just a way of running a loop through instance variables.

    About your idea of dictionaries and arrays, this is exactly what I explained in the first post ^^

    If instance variables had an index would be great as we could put the heavy stuff in an appropriate data structure like an array or dictionary and then loop through all it's data and replicate it's final values into instance variables. In a situation where the array holds the initial value and several modifiers, we would hold the final value in the instance variable, making it much easier to access it and more readable

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is it something that could be added in a near future? It would be great because it'd allows us to keep more of the data assigned to the respective object and make families and (now)custom actions even more useful. It would also make code much more readable.

    The idea behind this is that, for something that requests a large amount of variables, I usually use arrays and, to get this to work properly without getting lost of which cell is what, I need variables to hold these coordinates and this is fine. However, simple operations involving these variables makes it too troublesome and polluted by too much calls. I always use functions to get rid of most of it and return the value I need but still, it's nothing compared to the simple way of calling an instance variable, it's short and readable.

  • > I haven’t used them but that was mainly because the debugger didn’t let you step through loops and sub events or per condition and per action.

    Ah, yes, clicking 100 times to step past a loop is super fun.. (not)

    > I use them as a last resort, but never really had much trouble getting them to trigger!

    One example is a breakpoint inside a function that returns a value. You can add it, but it never triggers.

    You don't need to XD Just create a blank event after the loop and put the breakpoint on this event. Events that returns values is indeed annoying too, along with all other events with the same limitation, like triggers, etc. Debug mode in construct is just too limited I think but it's still quite helpful sometimes.

  • Use a solid image instead of pieces? Looks like a pixel rounding issue.

    I'm not using pixel rounding and it's a jigsaw puzzle, that's why I have them separate.

  • The text is rendered by the browser and some browsers don't scale text smoothly. I think what happens depends on which browser you're using. IIRC I filed an issue with at least Safari for text scaling not being smooth, but nothing much has changed.

    That's ok. I'll try spritefont. But since you're here, could I ask you a quick insight on another thing? When I change the window size the drawing canvas gets slightly distorted, like 1 pixel smaller and create that tearing effect between images.

    Is it possible to avoid that? I tried all Display settings combinations but nothing helps.

  • Have you tried with a sprite font instead of text? It may work better. From what I recall, the text object is particularly inefficient, such as when updating large amounts of text every tick. I assume transformations are the same.

    If the text object is that bad then I have no other option =/ I didn't want to use spritefont because of the extra work to make the sprite itself but I'll do it. Should work since it is essentially just sprites put together.

    Thanks ^^

  • Hello! I have a weird text behavior that I've seen for a long time and never tried to ask someone before why this happens. I have a few text objects linked(hierachy) to a sprite. This sprite is a card and the text object is the information about this card. Whenever I hover my mouse above it the card and all its text increase its size a bit. The sprite goes super smoothly as expected, but the text is really inconsistent when this scaling happens. Anyone knows why and how I can fix it?

    I also noticed that when I have just a few more texts scaling at the same time It starts to greatly impact the frame rate, like 144 to 88.

    Thanks for any help.

  • This should work I think. It lerps between the start and end in a straight line. Then also moves in a parabola.

    https://www.dropbox.com/s/ilxsoyy7mmm04dc/jump_path.c3p?dl=1

    Works perfectly, exactly what I needed. Thank you very much, Rojo and oosyrag for your time.

  • You asked for an example equation. The equation is different depending on how you want to draw the arc at different distances.

    alright, I think fixed angle should work well

  • It's more physics than math. You still need to describe in more detail the desired behavior. If the input value is the destination coordinates (instead of origin angle and velocity), would you want the resulting arc of travel have a static angle, velocity, or vertical height?

    I'm not shooting anything so I don't need movement, I just need to draw a curved line(see the illustration in the first post). I'm using this arc to indicate to the player that the character can jump to the selected tile(tru mouse aiming). It's just a more fancy preview with some depth to show to the player what he's about to do, which is jump to this other tile.

  • Aiming arcs are generally described from the origin to destination, one step at a time, rather than from a center point.

    The functions for the x and y components are x = horizontal velocity * time, and y = vertical velocity * gravity * time.

    The initial velocities can be found per angle by using sin and cos on the angle multiplied by a power value.

    Edit: sorry looks like your going for an isometric arc based on your screenshot. In that case, your x and y are both constant and you'll need to add a z component, which is affected by gravity. In effect, the z value is added to the y value to display "height". When z is equal to or less than 0 is when your projectile hits the "ground".

    Could you write an example of the equation? I'm terrible at math =/

    btw, I'm trying to achieve an aim indicator, those sprites would be static but updating its position accordingly to the target(mouse x and y for instance)

  • Hello! Could someone help me with some math? I need to get an elipse shape that works for any angle. Right now I can only get a perfect circle.

    I'm trying to achieve an aim preview, like demonstrated above. Thanks for any help.

    Tagged:

  • There are so many different aspect ratios, and so many devices with said aspect ratios, it would be a bear impossible task to compile data on every device on the market, off the market, and future market, so it's better just to support the most common ratio and adjust to suit all (though it will look slightly different on each device that's not your set aspect ratio).

    This will only really be the amount of background that can be seen. UI elements can remain fixed in their respective positions.

    I get what your saying but there's no need to offer different resolutions as a setting within your game. Just stretch your background around 20% larger than your viewport and use scale inner/outer (depending on your game, UI etc) and you'll be set for multiple ratios.

    And as I said, you can always use Scale Layout if you want to give the appearance of being zoomed in or out within your game

    Every single game out there supports different resolutions in the settings and you're saying I don't need it? I'm sorry mate but it makes no sense.

    And of course, because of that I'll offer the option for scale outer as the only option to not get a terrible experience in which, in many cases, will be half of screen with black bars around. I'm using pixel art, so the ideal would to offer a letterbox integer scale full screen mode to the most commons resolutions so I could avoid the pixel distortion for most cases and then the scale outer mode would be a secondary alternative, not the only one.

    Again, I don't see why this is not an option in C3, ASHLEY. Specially for pixel art game.

    Btw, my project and my monitor are 16:9 and I still get black bars.

  • Viewport size is fixed unfortunately. You can however use Scale Layout to zoom in/out of your layout giving the effect your after

    How come a game engine have no support to different resolutions. That's really weird. I was trying to offer different resolutions in settings menu. I guess I'll have to just use full screen/full screen mode, which does not cover a lot of situations, specially if the game is in pixel art mode. It bugs me, I can't understand how a trivial thing is not supported.