R0J0hound's Forum Posts

  • oppenheimer

    With extend-box I was getting artifacts in the extended area with overlapping sprites.

  • Post a capx, it doesn't lag behind in my tests.

  • You could use the funtion object and make a function that sets the state variable. Then use that function to set the state. It would look something like this:

    +on function "setState"

    +pick sprite with UID function.param(0)

    --- set state to function.param(1)

    --- do other stuff

    +some condition

    +for each sprite

    --- call function "setState", sprite.uid, 1337

    Put your onchanded events in the setState function and it would only be triggered when state is changed.

  • You could use separate txt files or one text file with the patterns comma separated. There is also ini files or using this utility to load directly into an array:

    http://www.scirra.com/forum/utility-2d-array-editor_topic41701.html

    If you don't want external files then you could use python or a text object with all the text.

    Here I used a text object with the patterns comma separated. The only quirk I had to deal with is getting rid of the LineFeeds. In windows pressing enter adds 2 characters: a newline and a linefeed.

    http://dl.dropbox.com/u/5426011/examples16/pattern_match.cap

  • If you create another variable and call it old_state then you can get the same result with an event like this:

    Sprite.state != Sprite.old_state

       set sprite.old_state to sprite.state

       do other stuff

  • He's suggesting adding a color parameter type to shaders. Right now we only have "float" or "percent" parameters.

  • ouldn't be much more work (check variable, is carrying box? yes -> spawn box and set to player xy) but maybe someone else has a better idea :)

    You could also leave the boxes as global and destroy all the boxes not being carried at the end of the layout. This would work since all global means is the object won't be destroyed at the end of the layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ith objects overlapping I trust you only refer to the ones that are colliding?

    Yeah, but let me clarify, C2 treats both objects in contact and objects on top of each other as colliding. For the algorithm used I mean the latter, objects on top of each other.

    e are going to show the pool table at an angle, and in order to not have to further compensate balls colliding with an angled surface, I figured we'd use the Mode7 plugin you posted not too long ago.

    Here's a test I did: dl.dropbox.com/u/22615804/bbbb-mode7/index.html

    We're not gonna rotate it and such during gameplay. I'm only using the effect to get the table angled.

    With that you're going to need to figure out the perspective transform to map the balls to the correct positions on the table. I haven't done this myself yet but here is a link that has the math:

    http://www.coranac.com/tonc/text/mode7ex.htm

    ow many collisions did you consider many? I haven't noticed any slowdown. It stays at a nice 59-61~ FPS for me. Though I recently upgraded and am now running an i7 system, which could explain it. The primary target platform is Ouya though, so if it's too heavy, that could be an issue.

    If I double the object count it noticeably stalls when about five or more collisions occur, but it may very well be due to my 1.5ghz single core 10 year old computer. There is a lot that could be done to make it go faster, such as calculating the time of collision instead of iteratively finding it and using a spacial hash of some sort so collisions are checked against only the other nearby balls instead of all of them. In my capx the most blaring inefficiency is collisions are checked between every ball with all the others twice. It could be improved to once if the collision pair were saved to a list somehow.

    also noticed that there's constant motion. Even if a ball comes to a stop another one soon enough bumps into it and sends it off with renewed force. Though I'm sure it's not too hard to fix.

    Yes it's pretty simple to change the formulas to take into account acceleration for friction. The elasticity can probably be changed from 1 (perfectly elastic) to 0.9 so that it's more realistic.

  • Instead of "for" use "repeat 6 times" and instead of loopindex use:

    Array.Height-loopindex

  • You could something like this:

    global number max_value=0

    every tick:

    Set max_value to max(var1,var2,var3,var4,var5,var6)

    max_value=var1:

        do stuff

    max_value=var2:

        do stuff

    max_value=var3:

        do stuff

    max_value=var4:

        do stuff

    etc...

  • Those two conditions are triggers as defined in edittime.js:

    AddCondition(3, cf_trigger, "On went online", "Browser", "On went online", "Triggered when user is offline and a connection becomes available.", "OnOnline");
    AddCondition(4, cf_trigger, "On went offline", "Browser", "On went offline", "Triggered when user is online and the connection becomes unavailable.", "OnOffline");

    The following code from runtime.js is what causes "OnOnline" to be triggered:

    window.addEventListener("online", function() {     self.runtime.trigger(cr.plugins_.Browser.prototype.cnds.OnOnline, self);
    });
  • If that's the case then here is an updated version that is easier on the eyes among many other things:

    http://dl.dropbox.com/u/5426011/examples16/nodes3.capx

    FYI the nodes evaluate somewhat like a circuit so values can take time to move through the nodes.

    What's your project about?

  • If I can't get 1 to work the way I want it I usually skip 2 and 3 and go straight to 4, because at that point I have full control of what happens. The math isn't too bad since you can find tutorials that have the formulas ready for you. Collision response will probably be the most involved aspect.

    For an exercise I followed the tutorial here:

    http://chrishecker.com/Rigid_body_dynamics

    And made a capx:

    dropbox.com/scl/fi/opwp880r5yj0d73tmt6wu/2dphysics.capx

    I skipped the angular motion, and it will lock up if you design a layout with objects overlapping, but other than that it looks alright. The collisions are pretty crisp due to the method used in the tutorial, but it's pretty slow when many collisions occur at once.

    I tried reproducing it with the physics behavior and I can't get it to act the same. The break doesn't look as good and there is energy loss.

    uc7cec312b5eb10bf6c698016a8f.dl.dropboxusercontent.com/cd/0/get/Ch_iWdiLJy3ic7ZPiE8_J-WRSC9GsljNCJUzW_dNecTK_gE8__C9dhJUiXYKfDaNMB3_e1rMhI6Vd3hRlTtstg-y96JdM-RfAUmo87Jm9daNCJiyM3Vtx7JLQdbUnpOOijM/file

  • While it's true that transparent sprites are still rendered, if you make a sprite invisible it isn't rendered at all.