zatyka's Recent Forum Activity

  • Tatsuya7

    It's impossible to troubleshoot with only the info you provided. Theoretically, you could post your capx and I, or someone else, may be able to fix the issue. However, that will only get you as far as your next issue.

    Implementing features with any level of complexity in your game requires you to become comfortable with both the engine's plugins, and the various methods of debugging. For example, walk through the recording/rewinding process step-by-step. Is that data being recorded to the array as expected? Is it recalled as expected? Find the specific events that are not behaving correctly, and investigate why.

  • Tatsuya7

    You'd need to treat every rewindable object in your world the same way as the player in my example. I'd probably associate an array with each object (perhaps via containers) to record it's data. It comes down to two things:

    • When the game is "playing", saving the relevant data about each object (e.g. width, height, angle, frame, acceleration, angle of motion, etc)
    • When the game is "rewinding", set each object's parameters based on its saved data

    Implementing a system like this must be carefully thought out and tested, especially if there's a lot of interaction between rewindable objects.

  • Create 2 instance variables on the object called something like PreviousX and PreviousY

    On start of layout

    --- Set Object.PreviousX to Object.X

    --- Set Object.PreviousY to Object.Y

    Every tick

    --- Angle of Motion = angle(Object.PreviousX, Object.PreviousY, Object.X, Object.Y)

    --- Set Object.PreviousX to Object.X

    --- Set Object.PreviousY to Object.Y

  • If anyone wants to create a game with any level of sophistication in C2, they're going to need to learn how to use the event system to manipulate game behavior (e.g. setting animations based on conditions). Assuming that's true, it seems unnecessary to develop features in the engine that a beginner can easily learn and create with a few events. Plus, there are multiple tutorials that go over directional animations.

  • Sort of. Fewer frames per second means fewer characters are shown per second. DT is simply the time it took to complete the previous tick. To keep the effect at a constant speed (or as close to constant as possible), you'll need to modify the effect to take dt into account.

    Take a look at this: [attachment=0:2im1s38x][/attachment:2im1s38x]

  • TiAm

    Thanks

    Unnatural20

    The algorithm uses the fill object's bounding box, which are always rectangular regardless of the objects rotation. To answer your question directly, yes, the algorithm would double the covered area:

    If you need precise coverage calculations for rectangles (or other polygon) that allows for rotation, you'd need to break the entire area into triangles based on each rectangle's vertices, and test if each triangle overlaps the fill object. It's exponentially more difficult, though not impossible.

    If you only need semi-accurate calculations, you could do as others have suggested and create a small sprite, or high-density tilemap, and loop through the entire area checking for overlaps. You'd probably end up balancing accuracy vs. efficiency.

  • in event 11, you set TestRectangleRight to (Xcoordinates.At(loopindex("X")))+(Xcoordinates.At(loopindex("X")+1)-Xcoordinates.At(loopindex("X")))

    Doesn't this always evaluate to the same as Xcoordinates.At(loopindex("X")+1)?

    You are correct. The overly complex expression was left over from a slightly different calculation method. I've updated the Capx. Thanks for pointing it out.

  • FYI - After I posted this tutorial, I received 12 identical notifications that I had posted the tutorial. I'm assuming that's not supposed to happen.

  • Unnatural20

    david7457

    Since I needed to take a break from my current project, and enjoy interesting challenges, I worked up a demo and posted a Capx example:

    Calculating Rectangular Coverage Area

    Hopefully it has everything you need.

  • Yann

    Gotcha. No worries, thanks for the update.

  • Try Construct 3

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

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

    This is quite a powerful plugin, thanks for creating it. I was wondering if you plan on updating the plugin to address this issue:

    thanks nice finding, I was doing

    delete array[0];[/code:3s15j0yz]
    but this doesn't change the size of the array so javascript set it to undefined (which is transformed to null on export)
    I have to do [code:3s15j0yz]array.splice(0,1);[/code:3s15j0yz]
    

    I have a workaround where I clear the entire array, and recreate it sans the deleted values, but it would be a lot cleaner to delete the value directly.

  • You can use the canvas or paster plugin to achieve this kind of effect.

zatyka's avatar

zatyka

Member since 11 Aug, 2012

Twitter
zatyka has 1 followers

Trophy Case

  • 12-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • x11
    Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual

Progress

15/44
How to earn trophies