R0J0hound's Recent Forum Activity

  • I found a program a while ago that can print the contents of a scrolling window. It works well for events.

    http://www.scirra.com/forum/printing-out-events-on-paper_topic83258_post485840.html#485840

  • Beaverlicious

    I tinkered a bit with the example and got the perspective correct so the base matches the sprites. So if you're currently making the game just leave sprites for the bases of the buildings and the 3d can be added later once it's working. Once working the 3d will be on a seperate layer above the game layer and below the HUD layer. It will take a bit more tweaking to get to that point and I'll upload it when it's done. Be advised though that the polygon sorting isn't correct at times esp when boxes are near each other which is kind of distracting. I'm pretty sure it can be fixed if I sort the polys with a topographical sort which is in my todo to add to the capx.

    No eta, but my weekend starts soon so I should have some time to work on it.

    Cheers

  • Wouldn't doing a system compare of the LayoutName expression work?

  • No, the functions aren't exposed. The workaround is to call a function in the event sheet and set the parameters there.

  • Everyname

    Thanks for the fix.

    Beaverlicious

    Those recommending Paster for 3d probably were referring to this capx:

    http://www.scirra.com/forum/suggestion-simple-3d-objects_topic82718_post483742.html#483742

    Paster provides little to provide 3d other than an action to draw a distorted texture. The rest is math and logic.

    The capx isn't simple but it could be tweaked and extended to make the game you have in mind, but as it is now it's incomplete.

  • I use a free account of dropbox for all my capx uploads and have no problems with it.

  • The problem can be thought of how to find out if a point is inside a polygon.

    Here is capx with one solution:

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

    Edit:

    You can eliminate the need for variables if you add a imagepoint to the right-center of the line object and do this:

    For each Sprite
    For each line
        | compare: line.y>sprite.y != line.ImagePointY(1)>sprite.y
        | sprite: x < (line.ImagePointX(1)-line.x) * (sprite.y-line.y) / (line.ImagePointY(1)-line.y) + line.x
        -----
            + Sprite: set animation frame to 1-Sprite.AnimationFrame[/code:wl2fbtnb]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • After fiddling with it a bit I don't find the custom behavior's push actions useful at all so I tried a few other methods. One that came to mind is to use the 8direction behavior instead and use events to set the horizontal and vertical velocities. It didn't work ideally since the 8direction often stops short of the walls if going too fast.

    If you're fine using boxes with no rotation for the walls for now here is a capx. It uses a simplified case of the Separating Axis Theorem to do the push out and wall sliding. I was using it in another capx and found it to be a very clean way to do the wall sliding. I'll try to extend it into a plugin one of these days if I get time.

    https://dl.dropboxusercontent.com/u/5426011/examples21/sat_push_aabb.capx

  • If sin(a-b)>0 then a is clockwise from b.

  • spongehammer

    Pasting a paster object to itself is no longer permitted by the runtime.

  • You can use a regex expression.

    Using the "test regex" system condition with

    "77,1,6,7,3,17" as String

    "\b7\b" as Regex and

    "" as Flags

    It will only be true if a 7 by itself is in the string, no false positives.

    Here is a reference for regex expressions:

    http://www.w3schools.com/jsref/jsref_obj_regexp.asp

  • The simplest way would be to use the Browser.ExecJS() expression. Although the "^" is different in js, so that will have to be worked around. It is appealing to make your own parser so only certain syntax is allowed as ExecJS allows all of Javascript to be used. The problem is it can be tedious to implement.

    Here's the approach I would take:

    1. Get the text for the formula.

    2. Break it up into a list of tokens (numbers, symbols). Regular expressions can be used here or scanning over the text a character at a time, tokenat isn't suitable. Error checking is done here as well to look for invalid syntax.

    3. Convert the token list from infix notation (1 + 1) to reverse polish notation (1 1 +) as in that form it's simple to evaluate.

    4. evaluate.

    http://en.wikipedia.org/wiki/Reverse_Polish_notation

    There are other ways out there as the topic is pretty vast. You'll end up writing a lot of events (or code) to get something working well.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound