oosyrag's Forum Posts

  • Your player is probably not moving 1 pixel per frame, so if hes moving 9 pixels per frame at the point right before impact, he might be 49 pixels above the origin of worm (not overlapping), then the next frame he would be at 41 (overlapping).

    Otherwise, it might just have to do with the origin point of the worm not being all the way at the bottom of the sprite.

  • You can make a loader layout of sorts, I haven't tried it yet myself though.

    Sprites are kept in memory if they are in use on both the previous layout and next layout.

    You can take advantage of this by using the load from url action to preload assets gradually in an intermediate loader layout.

    This is mostly useful to prevent the "freezing" that occurs between layout when loading large amounts of sprites into memory. I'm not sure if this would help you regarding cpu use on start of layout if you're dynamically placing your terrain on start of layout.

    Are you generating the entire map in a single loop/frame? Maybe you can break it up into multiple frames by using a counter. Start by generating what can immediately be seen, and let the rest of the map generate over time.

  • This is actually a good idea, especially as you can stretch out the invisible helper sprite to prevent high speed projectiles from clipping through walls. You can also create interesting effects on your sprite without affecting the hitbox/colissions.

  • FYI - You might get quicker answers if you post to the "How Do I" section of the forums.

    When you use the platform set vector action, that is limited by the platform behavior's maximum speed and affected by deceleration. So however high you set the vector, it is capped and based on the deceleration he will end up stopping at around the same place. Try using a bullet behavior instead.

    As for the blocks... I have no idea at the moment. It works fine when I create a new project with just blocks and a player sprite. Your collision boxes look fine, and its not because of scaling (still happens even when the blocks are 100%).

  • lerp(a,b,x)

    a - Starting number

    b - Ending number

    x - The percentage amount between the start and end number you want to get (between 0 and 1, or 0% and 100%)

    So lerp(10,20,0.5) gives you 15, or halfway between 10 and 20.

    Allan gave a pretty good explanation of why it slows down above - basically when you use the current position as a start point, the lerp amount gets updated every tick to be smaller and smaller.

    Just going to give you a heads up though - lerp is generally used for more advanced gradual motion/inertia. If you're looking for simple straightforward movement, you would best be served by getting familiar with the Bullet behavior. The Bullet behavior is generally the go to solution for almost all linear movement needs.

    Alternatively, http://c2rexplugins.weebly.com/rex_moveto.html is a fantastic plugin that you might find useful.

  • All programming techniques come from math. Math lets you take numbers and transform them into whatever form you need, following rules that a computer can understand.

    But generally speaking, experience and practice will let you recognize what you can do in any given situation.

  • Export as images, import them as a Sprite strip.

  • Here is an updated one where you don't need a second array.

    It simply replaces all single values with a placeholder value "delete", and then afterwords loops back and gets rid of all indexes of "delete".

    https://www.dropbox.com/s/v4u712hdlvnns ... .capx?dl=0

  • It was trickier than I first thought.

    So it looks like deleting the index as you go doesn't work, because the loop index/current x doesn't match up anymore after you delete one.

    So I used a second array to "store" all the singles i found in the first index, then went back and deleted them after.

    https://www.dropbox.com/s/5r4ntrx41u6ia ... .capx?dl=0

    Unfortunately it doesn't work with 0 at either end of the array, because values that are outside of the array range are returned as 0s, so it thinks it is next to another 0.

    Edit: actually now that I think of it some more I feel like I've done this before another way. If IndexOf and LastIndexOf match, then there is only one of that value. I'll experiment a bit more...

  • Depends on what device your target platform is. Modern phones have 2-3 gigs of shared memory and PCs generally can also utilize system ram to supplement graphics memory (it can cause slowdown in terms of frame rate though).

    On the other hand, it is NEVER a good idea to use all available memory. You also have no way of knowing how much memory is allocated to other software on each target device.

    Personally I would aim to keep it under 512 to be safe for most modern devices.

    Or you can just buy C2, which will still be available (and can basically do everything C3 can do anyway).

    Seems to me like a matter of wanting all the nice things but not wanting to pay for it.

  • Surprise! This isn't a feature request!*

    https://www.dropbox.com/s/wyiz1r06s2p3o ... e.c3p?dl=0

    Two examples of different bitwise methods for autotiling, created in C3.

    Layout 1 uses edge based bit indexing for "whole" tiles, generally side view/platformers. Includes single event version on layout start, and also a more readable version that uses more events to draw tiles with the mouse. Both use the same method described at http://www.saltgames.com/article/awareTiles/.

    Layout 2 is more complicated and uses corner based bit indexing for "half" tiles, usually used for top down views. Starcraft is an example of a game that used this method. As with the first example, I included both single event and multiple event versions. This method is great when used with layered transparent tilemaps - one for each terrain, such has dirt, grass, forest, mountain ect. ref: https://www.codeproject.com/articles/10 ... n-a-tile-m

    Bonus - I also included a nifty lightweight way to make a "animated" tiling water illusion where it should basically be impossible to see the tiles (0 events, 2 tiled backgrounds, sine behaviors).

    * Just kidding, I lied. Here are a few tilemap feature requests: Tilemap.Tilesize expression, and also Tilemap For Each Tile condition (along with curx, cury, like arrays). Honestly probably not widely needed/used and obviously there are workarounds, but they would be nice to have.

    I'm going to use this opportunity for a shameless plug for an unrelated expression that WOULD be very useful, as many mobile games take advantage of this feature. I imagine it would be easy to implement as well - System expression for Unix Timestamp to keep track of "offline" time https://construct3.ideas.aha.io/ideas/C3-I-143

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It can be either.