R0J0hound's Forum Posts

  • Hello,

    Event number 8 defines the shape of the slope: random(480)+steepness*loopindex

    Making steepness and 480 lower would make the terrain flatter.

    I guess you could make a sub-event like the following to have the steepness change every five steps.

    system: compare loopindex%5=0

    --- set steepness to random(10,100)

    At least that's the idea.

    Controls at all don't make sense in this capx because it's non-interactive. I guess you'd put you control events above event 10 and in them change either ax,ay (acceleration) or vx,vy (velocity) instance variables of the skier.

  • Yes, I guess you could say that. If something is picked it stays picked for the rest of that event and following sub-events unless another event unpicks it. Do some tests that change the frame or opacity of the objects to get a visual to understand it better.

    In that capx event 99 is a trigger that is called when an object is created, and that object is picked and any parent events are tested first. So it's probably some logic error rather than some quirk of the event system.

  • look earlier in the topic. I can't fix a quoted link.

  • Use the a sub-event with "pick nth object" for each

  • link updated

  • The second one works because the created object is still picked in sub-events.

  • Sure, that's fine if it's related to this. I'll eventually see any post in a topic I made or posted in. I'll also get an alert if you quote me or tag me with

    If it's a different subject it's better to create a new topic and tag me if you want. That would give your question more visibility so other users more active than me can help.

  • link updated

  • the_Shit_hawk

    It took me a while to open that, and I don't see any pattern other than most of them have the same action.

    travdoty

    I do, but I'll post it to the other topic. It's probably not the best idea to hijack someone else's topic to get a hold of me.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.