R0J0hound's Forum Posts

  • Yeah, they removed them with the new forum update. I’ll see if I can find the post about it.

    Edit:

    construct.net/en/forum/scirra-website/website-issues-and-feedback-35/cant-access-private-messages-135322

  • The angle expression does that already.

    angle(0,0,x,y)

    Is the same as

    atan2(y,x)

  • It’s twice as fast because the timestep is set to 1/30 by default. Setting it to 1/60 will be closer to par. You can also set the stepping from fixed to frame rate independent but it seemed to make things more unstable.

    That’s no good it crashes. Guess that goes along with not setting position and velocity for best results, which includes angles.

    Sounds like something that would need to be fixed in the library itself.

  • Best I can tell you just need initializeAsync to finish before calling any other functions.

    So in the “then” you could call a c2function and enable a group of events there. In that group you’d update the progress and when it’s 100% call startGameAsync. Only caveat to consider is if your game finishes loading before you enable that group. Probably a trigger once condition in the group comparing loading progress to 100 should do it.

    I don’t know if it is it’s own progress bar or what. It doesn’t seem to be a requirement before calling startGameAsync, but its pretty painless to just set progress to 100 before calling that.

  • If you use the browser object you can load the js library with

    $.getScript(url, callback)

    Callback is called when the library is loaded.

    I like to have it call a construct function when it’s done. So you’d place this instead of callback:

    function(){c2_callFunction('c2functionname')}

    So then when that function was called you can run basically the js you have in the script tag. Instead of the vars just call a different c2 function.

    In that c2 function you now know that everything should be loaded and you can access the stuff the vars in your events did.

    Set text to browser.execjs("FBInstant.player.getName()"

  • It probably is more involved than it appears at first glance. Mostly tedious.

    Layouts in capx files are in a xml format and if you add more layouts you’ll need to modify the project.xml in the capx to add it to the layout list.

    Modifying layout xml files instead of just creating them are more involved. Probably would require parsing the entire layout, and then you’d have to decide what to remove or add. A easier bet is to save everything from in game and just recreate a new layout xml.

    So you can still save your game in json or whatever but it will ultimately need to be recreated in xml in the format the construct2 uses. Save your game as a folder or open your capx as a zip file to see how these xml files are formatted. As an exercise see if you can duplicate an instance. Basically that’s all you’ll be doing to generate a layout, or rather that’s what a program will be doing.

    Anyways the basic flow is:

    1 save to a file from your running game.

    2. Close the capx in construct

    3. Take that file, generate the layout xml and insert it in the capx.

    The closest I’ve done before is to take a tiled file and create a layout.xml with a sprite per tile. This pre-dated the tilemap plugin. It was more of a one shot thing though, so I did a lot of it manually.

    It’s an interesting idea though.

  • I thought that last example capx I made was fixing it. It was for me at least. It bypasses how the textbox is positioned the next frame by instead positioning it directly.

    If that doesn’t work or it isn’t a usable solution then filing a bug report in the official way would be a good path to a solution.

  • Like I said above, it lags because they are positioned a frame behind. The reason is because the position is updated after the frame is drawn.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can also set the strength of the motor. By default it will use up to an infinite force to make it turn. There’s an action to change the setting of a joint by tag. Use “” for the last created joint.

    I forget if there were other settings you could do for other joints. Guess you may need to refer to the chipmunk manual. This plugin is just a wrapper for the chipmunk library. There are things it can do that I’m not familiar with.

  • Instead of setting velocity have you tried adding a motor joint to yellow instead? Or maybe apply a torque if the angular velocity is too low.

    Physics engines don’t seem to like it when you set positions or velocities, but maybe Box2D can handle it better? My best guess why it’s different is the chipmunk library does things differently somehow.

    For best results the engine likes doing stuff with joints, forces and impulses.

  • Do you have your game working up to the point where you draw the lines and need to calculate the area? The solution is going to look different depending on the rest of your game.

    Here's my idea for such a game. There are other ways though.

    uce6ca908d56586ea0b927400cbf.dl.dropboxusercontent.com/cd/0/get/CiHl3kIR7fpp5H9U4E5Hhza0X5XU3qJF9we2CCKOl-qVKeR2JhGGjFhElFIGmpV_klJqi2UPqHPKaJi_phoU-Q31E9cMPaCQdUtma9EJaQQAvmyJqjyu7kw0jL7xYuJBHq0/file

    Basically after each turn I do flood fills to find enclosed or open areas. It doesn't come out looking too simple.

  • Here is a quick fix you can use in your project. Event 2 to be specific. Just put it after whatever scroll events you have.

    ucbaba32d9a2452d5564b1d2d0da.dl.dropboxusercontent.com/cd/0/get/Ch4uNvSGZ1SWVVzbNPGQreWxdIhJ8MDlQarrQqQYhu5Ym03euma1bQUOKpqfo6gnLDCGOPGX7q4IJ7bTmy91AP-bDCul6CIr-nqkVnalLSyv16T5bfwTlNuwopYr8b74Ytc/file

    I put red boxes under the textboxes as a visual test. With event 2 enabled you don't see the red boxes when scrolling. When disabled you see the issue you have.

    The only issue now is when the textboxes are half off the screen. That other capx should help with that but it's a problem for another day.

    cheers.

  • We can try to fix the bounce so it never ends up going horizontal. The original breakout only changed the angle the ball moved when it hit the paddle, otherwise the bounces were perfect.

    Here's a test of some ideas.

    uce3819dc9c11379b29220fa568e.dl.dropboxusercontent.com/cd/0/get/Ch7r9TDEo2QPnvqnQndTojhCmqbSeude_0C52LTK82cdP_1xlhUVRy4cFlfkAk2N9iWEPgcUgNkR8BhVEcrYOb7idM_m4sSSKJrnjwGJSH5sMEz0aj7FFmKFxiESAs4qklI/file

    It has three on collision events. Only one should be enabled at a time.

    The first is probably what you're already doing. It uses the bounce action and sometimes the ball starts going very horizontal if a corner is hit. The issue case.

    The second one tries to fix the bounce angle to be perfectly mirrored or flipped from before the collision. It works mostly but when a corner is hit the ball can start going in the opposite direction.

    The third takes it a step further. Instead of fixing the bounce it will calculate the bounce itself. To do that it first backs the ball up until it's no longer in the wall and then uses overlap at offset to check if it's next to a horizontal or vertical wall.

  • By inside do you mean the gravity is always away from the center of the planet?

    If that's the case you can just reverse the objects in your expression like this:

    angle(gravity.X,gravity.Y,Player.x,Player.Y)

  • Hello,

    Since I made the paster plugin here are the two ways to install it.

    1. Just drag the c2addon file onto the c2 editor. It should tell you it installed.

    2. Rename the c2addon to a zip file. You can then get from it those four files:

    Runtime.js

    Edittime.js

    Common.js

    Icon.ico

    There are other files in there as well to make it work as c2addon file, but they are not needed to make it work.

    Anyways just make a folder named “paster” in “c:\program files\construct 2\exporters\html5\plugins” and copy those four files over.

    Also as a side note if you install via dragging and dropping the c2addon file the files will be put in a folder elsewhere within the c:\users directory somewhere. Just in case you wanted to look at the source later.

    Anyways, that should get you running with it. If you have any issues or questions about it feel free to ask in the paster topic. It has it’s share of issues but is still useful imo.

    Cheers