R0J0hound's Recent Forum Activity

  • The upvote and downvote buttons on posts gives a nan error on the iPhone safari. It works on desktop though.

  • Multiple instances should be as simple as giving an array to each instance. With one object type you do that by putting the sprite and the array in a container, then the events would be the same.

    Now, you can't make a family in a container, so we'll have to do it ourselves with events instead.

    Add a family instance variable and call it "uidOfArray" or something. We want to create an array for each family instance and save the array.uid in that variable so we can pick the right one later.

    family: on create
    -- system: create array at (0,0)
    -- family: set uidOfArray to array.uid
    
    keyboard: space is down
    for each family
    array: pick by uid family.uidOfArray
    -- family: load from json family.back
    -- array: pop back
    
    [inverted] keyboard: space is down
    for each family
    array: pick by uid family.uidOfArray
    -- array: push back family.asJson
  • You could utilize sin(), it goes from -1 to 1 as well as smoothly inbetween.

    So you’d start with

    Sin(x)

    Shift it over so when x=0 it will be 1

    Sin(x+90)

    Next change it so it goes from -1 to 1 every 90 instead of 180.

    Sin(2*x+90)

    You could also use cos() instead. It’s just 90 off from sin()

    Cos(2*x)

    If you don’t want the smooth transitions inbetween you could utilize some rounding.

    Cos(2*round(x/90)*90)

    Hope that helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Has it ever happened in tests?

    It’s probably the type of thing that’s not worth handling unless it actually happens.

    I don’t mess with networking, much less server side stuff. An Ajax request shouldn’t mix stuff like that. I mean you could probably make server code that would do that purposely if you wanted.

    Best I understand it, for the Ajax request to work the server will receive the request with where it came from so it can send a result back. It’s not possible to mix it up accidentally.

  • Basically all that’s available is adding more points to the collision polygons. Or maybe make a number of sprites for various curves and such using as many collision polygon points as needed to make it smooth enough. Then build your terrain with a bunch of those.

    Another idea is to design your terrain with something else, and then use sprites as lines to define the outline.

    I’ve used a vector drawing program before and saved to its simplest file format and parsed that to get line segements making up the shapes.

    Another idea is to make your own in game editor that you could disable later. You could use qarp() and cubic() to do Bézier curves that you then split that up into lines. At least it beats manually placing individual points.

  • I haven't gone through the trouble to do it. I haven't really used C3, but it's capabilities are roughly the same as C2.

    There are three parts to this:

    1. Have a list of points to define a polygon. Then we can do the logic in the previous post to do the splitting. We wouldn't be working with actual Construct objects. So probably use arrays to store this stuff. This is math and algorithm stuff, which is doable depending on your skill.

    2. We need a way to draw these polygons. Construct doesn't have a way to do this. There's the paster object I made for C2 that has a "draw quad" action. That could be used to draw any polygon with some creativity. You'd have to deal with texture coordinates if the split objects have textures. The paster plugin was ported to C3 by someone, but it won't work with the new runtime at all if that's a concern.

    Alternatively you could just use sprites stretched into lines to do the outline of the polygon without third party stuff. The con is the polygon wouldn't be filled.

    3. Physics. The built in physics behavior is unusable for this. I don't think any of the third party ones are either. You'd either have to deal with another physics library directly in javascript or implement the physics in events. It's going to be a lot of effort either way.

    So more or less everything from scratch, plus most of it wouldn't be able to interact with other construct features. So construct doesn't really have anything to assist with making such a game. This safely throws this into the very advanced difficulty range.

  • Simulate control is working, it's just happening for a moment with those events. So any changes are not really noticeable.

    Maybe add a variable to bat to tell it what to do. Call it "state" or something. Then just add a event to to simulate the control continuously depending on the state.

    Bat: state = "wave one"

    -- bat: simulate control turn left

  • Here's an example of the idea you got from discord.

    dropbox.com/s/flpq3bf9hv4vsul/2.5Dtest1.capx

    There's a lot of ways it can be improved, but it's better than nothing. Hopefully it's useful.

    The crux of the idea is you have a hidden object with the platform movement, and you define the ground shape on the front edge of the ground. The rest of the ground is just looks.

    Then you move up and down by adding/subtracting from a variable. I called it z, but it can be anything you think appropriate. Then you have a separate sprite to be what you see and just position it above the invisible one. I also used clamp to limit how high and low you can go.

  • Naw. It would be like going backwards.

    Constructs event sheet is the defining advantage it has over clickteam products.

    Ashley, construct’s main developer, made plugins for for old clicktem products before making construct. So he’s well aware of that old grid checkbox stuff, and he made something better. So much better that clicktem finally is making its event editor look more like construct’s.

    To me that checkbox stuff is a lot less readable, and yes I have used it before.

  • Admittedly I didn't test it. Regex should work everywhere. I know there are other solutions too. Personally I've done it with a loop by either using some math to extract 3 digits at a time, or use one of the text expressions to get three characters at a time.

    It's hard to search though. I find I do everything from scratch anyways when using Construct. You have something that suits your purpose. Carry on.

  • This question comes up a lot. There are many solutions, but the forum search doesn't work well enough to find them easily.

    The most recent has a nice regex formula by dop2000

    construct.net/forum/construct-2/how-do-i-18/number-with-space-136985

  • I don’t recall exactly. You’d have to look at the source or test it. But if you created a color with for example:

    Set color to rgb(12, 33, 177)

    “Color” would be a single number with the three colors packed in.

    Then you could get individual color components from that number with

    Red = color%256

    Green =int( color/256)%256

    Blue = int(color/256/256)%256

    There may also be expressions to help with that but I haven’t checked.