R0J0hound's Recent Forum Activity

  • My guess is "every dt seconds" will in practice will have the possibility of running less than a "every tick" event.

    As I understand it the "every dt seconds" event could be done like this:

    global endTime=0
    
    endtime >= time
    --- Set endtime to time+dt
    --- do stuff
    [/code:1u5sb0c0]
    So if it ran on a slow frame it could not run on the next frame if it was a fast frame.  Although it could still be acceptable, unless absolute precision is needed.
  • The effect would be checking for an overlap in a certain rectangle area. You can do this with one collision check by first changing the size and position of the object to cover the area, checking for overlap and then restoring the object size and position to what it was before.

    What's your use case?

  • Did a quick test and yes, sprite sheets are made for all plugins using pf_animations. On a side note it appears that only non-square power of two images are sprite sheeted. I first tried three 32x32 frames but on export they each stayed on their own image, also the sprite object did the same. I then resized them to 16x32 and the export did pack the images into sprite sheets.

  • The only thought that comes to mind is to try using pf_animations in a plugin and export to see if a spritesheet is generated.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There is no NULL in C2. Where would you want to test for NULL?

    The only example I can think of is when using the find() expression. It will return -1 if the text can't be found.

  • Here's a link one what that method is called:

    http://www.saltgames.com/2010/a-bitwise ... -tilemaps/

    Here is one way to do it with sprites:

    viewtopic.php?f=147&t=72925&p=611090&hilit=bitwise#p611090

    And here is an example using the tilemap object

    span-class-posthilit-tilemap-span-auto-tile-help_p721581?#p721581

  • For using only 4 directions you need to round to the nearest 90 degrees like this.

    viewtopic.php?f=147&t=109106&p=798244&hilit=angle+round#p798244

    For stopping you need to check each grid spot in the direction of motion. Here I added 32 to the distance to move for each free spot and stop once I come to a spot that isn't free.

    The checking is accomplished with overlapping at offset in a loop. I used a little trig but you could just duplicate the loop 4 times depending on the direction and use (32,0) and such directly. One slight technical thing I used was scaling the object being swiped down before the check loop and and back up after. This is to overcome the fact that adjacent sprites will count as overlapping.

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

  • Here's a way to see how far a object has rotated

  • To test it out I made an example. I was trying to make the fluid stick to the walls and come down in globs.

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

    Disable event 4 to disable the sticky forces. You can also fiddle around with the spring forces to change the stickiness between the walls and other water. Unfortunately the wall stickiness only applies to one side the of wall sprites, so placing walls in the middle may not look right with the stickiness.

    In more complicated fashion here is another test. It does the fluid physics manually using a paper on sph particle fluids. I've wanted to try this for a bit, and while it's not really usable for most, I suppose this is as good a place as any to post it. If anything it's an amusing toy.

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

    It has a lot of variables you can tweak them to get differing fluid types, however the simulation can explode if you use more extreme values. The settings it currently uses were by trial and error. I haven't found any references on good presets for different fluids.

    And finally while I'm at it, here's another idea that I've tried before. The idea was to do fluids by just having spring forces pushing the particles apart. Not really successful, but for those who like to fiddle with capx's might find it amusing.

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

    It's a bit more stable if the G global is lowered.

    -cheers

  • The deceleration setting is likely changing the vector x back to 0 quickly. Which it is made to do. The solution would be to set the deceleration to 0 before setting vector x. Add a wait action then set the deceleration back up to let it move for a bit.

    ex.

    set deceleration to 0

    set vector x to 100

    wait 1.0 second

    set deceleration to 1000

    ^That will move the object 100 pixels over 1 second. You could make it only take half a second with:

    set deceleration to 0

    set vector x to 200

    wait 0.5 second

    set deceleration to 1000

    You can calculate the distance moved, vector x to use and time to use with this equation:

    distance = vectorX * time

    You just need to have two of the values and you can calculate the other by manipulating the equation.

  • The physics behavior would be the simplest way. Just use a bunch of circles. Do a search for liquid, fluid or water and you should find some examples, and even a way to make them look gelled together instead of being separate circles.

    To make it act like a thicker liquid like lava you could make an attraction force to nearby circles and walls.

  • It is still very accurate though. The error is at the 17th decimal place. The only inconvenience is making the number look cleaner when displaying it, which Aphrodite's equation will do.