R0J0hound's Recent Forum Activity

  • Easy.

    random(315, 360+45)

    Anything that takes an angle will be fine with that. Or if you want to keep it in range you can do:

    random(315,360+45)%360

  • You can do it with some minimal math. Basically you take 3d points x,y,z and project it to the screen with:

    screenx=x/z

    screeny=y/z

    size=1/z

    If the perspective is too severe you can scale it with:

    screenx=scale*x/z

    screeny=scale*y/z

    size=scale/z

    The camera is at 0,0,0 but if you want to move it around you can also do this:

    screenx=scale*(x-camerax)/(z-cameraz)

    screeny=scale*(y-cameray)/(z-cameraz)

    size=scale/(z-cameraz)

    you can also hide anything behind the camera by seeing if scale/(z-cameraz)<0 for each object.

    lines are done by taking two points and using lerp to find the in between positions.

    https://www.dropbox.com/s/5fser7xtmov44 ... .capx?dl=1

  • Not really. I think the plugin would need to simulate scrolling and everything like the normal display to work right. Currently it takes many shortcuts to cut down on complexity and overhead which would make it slower. I'd even go as far as to say much of what the plugin does internally is hacky. A proper fix is not really in my interest to pursue at this time.

    One option is to do parallax manually by moving objects around.

  • It's working as intended. When you set the size you need to at least use 1 for each of the dimensions. If it helps the number of values in the array can be calculated with width*height*depth, so if any are 0 then no values can be stored.

  • The push out actions don't work that great. To handle multiple walls you need to loop over them and push out one at a time.

    It's the same if you use the customMovement or roll your own:

    https://www.dropbox.com/s/91duuneht38q0 ... .capx?dl=1

    An extra thing to handle is to stop the object's velocity in the direction of the colliding surface, but the behavior needs to allow you to set xy velocity individually.

  • The push out action isn't very robust as you have seen, and beyond that the customMovement behavior isn't very useful at all in my opinion. So personally I'd not use any of the behaviors and just use events. This opens up all sorts of options of how your movement will work.

    As an example here is maybe a starting point:

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

    The collisions are handled by moving or rotating and undoing that if it overlaps a wall.

    A second iteration could make it use "dt" of smaller steps than 1 for smoother motion acceleration. Also instead of just moving to the last non-overlapping position you could instead just move the car till it's just not overlapping. In other words a function to push out of an object in a direction.

    A third would implement wall sliding or basically a better push out closest function. With two boxes you could try pushing out the four sides of each, something like this:

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

    Probably not just like that as the new object picking may bite you in the foot. You can also exchange the loops of overlap checks with math to calculate the end position if you wish to delve into that. The SAT algorithm is helpful there.

    Multiple wall boxes would just take a loop to do one box pair at a time. That is where the new object picking will become a nuance if you use the above method as is.

    Maybe that may give some ideas. Not sure if it's super helpful as it's fully fleshed out.

  • [quote:1w9nedc4]...and i will find if paster is available for construct 3.

    It isn't, I'll probably not be getting around to doing it myself. Also the c3 sdk doesn't support plugins that draw last I checked.

  • Try Construct 3

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

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

    I'm not really making examples as of late, but two ways come to mind:

    1.

    you could make a second paster and set that to the size you want, then position that over the part of the tilemap you want, paste the tilemap, then paste that paster to the other one.

    2.

    another idea is to utilize the draw quad actions. You define the four corners, and the uv's of them of the texture of some object. More math to figure out beforehand is needed for this, and it would only work if you can grab the tilemap's texture, I don't think you can though.

    Hopefully that can give some idea's. I haven't verified any of it so I may be off here and there.

  • It's just a flaw that non integer positions cause it to freeze. I really shouldn't make plugins since I have no intention to edit the plugin to fix it.

    The pixels at the edges that aren't filling are actually slightly different colors due to antialiasing and filtering. A threshold flood fill that is able to fill similar colors would work better. It's not terribly useful for me to mention it as the plugin doesn't have that feature and I won't be implimenting it.

  • Oh, right. I looked at your example and you need to make the x,y values of the flood fill integers:

    int(Mouse.X-Canvas.X)

  • The flood fill action doesn't work with transparent pixels. Rect fill it to a color first before drawing. I think that should work.

  • You can use one of the angle compare conditions of the system or sprite object. They handle how angles can wrap around. You could also use the anglediff() expression or if you want the signed angle difference between angles you'd just subtract the angles and normalize the result between -180 to 180.

    like this:

    diff = a-b

    while ( diff<-180) diff +=360

    while (diff>180) diff-=360

    or this:

    angle(0,0,cos(a-b),sin(a-b))

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound