R0J0hound's Forum Posts

  • You can also save the velocity and angular speed to variables before setting the size and setting the velocty from the variables after.

  • Here's another example exploring what can be done:

    https://www.dropbox.com/s/4o28kqq4b30pb ... .capx?dl=1

    /examples34/spring.capx

    I commented it a lot and in many ways it's cleaner than what I've done before. I'm figuring it out as I go and unfortunately it would be too lengthy of a tutorial for me to write. Math used is some simple physics such as:

    distance = speed* time

    speed = acceleration * time

    acceleration = force*mass

    spring_force = -spring_constant * displacement

    damping_force = -damping_constant * relative_velocity

    Also vectors are used. addition, subtraction and dot product.

    The dot product is used to get the speed in a certain direction.

    Some simple trig is used too.

    x = radius*cos(ang)

    y = radius*sin(angle)

    The collision detection uses the dot product to get the distance from a line. Otherwise everything is a mix of that.

    There are two unsolved things in this:

    1. The spring mesh can be made to fold in on itself.

    2. The balls can teleport through walls if either are going fast enough.

  • The object getting stuck inside the floor is an unsolved problem currently. The collision response in the capx's was only partially solved.

    The springs are not done in a way specific to C2. You should be able to google spring physics tutorials to get the math explained. This may be a good source:

    https://www.khanacademy.org/science/phy ... ooke-s-law

  • There's an old example here:

    It's basically just springs.

  • I didn't make those examples or plugins. Rexrainbow did.

  • It depends on how you specify when editing is done.

    If it's when nothing has been inputted for some timeframe then you can do that with a timer. You start or restart the timer when the "on text changed" trigger is run. A possible implementation could be:

    global number myTimer=-1
    
    on text changed
    --- set myTimer to 60
    
    every tick
    --- subtract 1 from my timer
    
    myTimer = 0
    --- do something[/code:ii7dlbgo]
    
    Another idea is to do stuff when the TextBox no longer has focus.  That could be when you click and the mouse is no longer over the TextBox or something.
    
    There are probably other ways. The simplest would be to just have a button to do something.
  • The pathfinding behavior can't do one way obstacles like that. A solution that comes to mind would've to do pathfinding with events using the "a star" algorithm. That would give more control so you could do one way obstacles.

  • Here's one way. Under the on changed event check all the inputted characters and only keep the digits, then only keep the first two.

    https://dl.dropboxusercontent.com/u/542 ... input.capx

  • digitalsoapbox

    That sounds right. Yeah, you'd just need to do it for one instance of a type since animations are shared with the other instances.

  • digitalsoapbox

    That's probably it exactly. At preview each image is seperate and after export the images are packed with one pixel outlines so they don't bleed into each other. You could try point sampling if it doesn't affect the look too much.

    You could undo the packing by loading the frames manually at runtime. Maybe also replace the packed images with a tiny image so it doesn't affect the VRAM usage.

  • Try Construct 3

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

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

    It's probably related to sampling. Maybe making the lower resolution a multiple of the higher one may help? Like if the higher res is 100x100 make the lower one 50x50 or something?

  • To make C2 run natively on Mac basically involves replacing the Windows only parts with Mac equivalents. In actuality it's not a simple replacement as the Mac stuff can be designed in an entirely different way, so a lot more code would need to be re-written.

    C3 is that rewrite.

  • Probably re-installing C2 will fix that file.

  • It's probably slower to pick and unpin objects that aren't moving instead of just leaving them pinned.

  • Here's one way:

    global number starty=0

    global number miny=0

    on jump

    --- set starty to player.y

    --- set miny to player.y

    on landed

    --- set text to starty-miny

    every tick

    --- set miny to min(miny, player.y)