R0J0hound's Recent Forum Activity

  • I was working with this some more and realized that no collision detection is needed whatsoever, just find how far down a given block needs to move.

    See example for details:

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • An array could be used in this case since the objects are laid out in a grid. So for each grid position set the value to 1 if an object is there and 0 if an object isn't. Then you can see if a grid position is free with a array look up instead of a collision test with all the other objects.

    ex:http://dl.dropbox.com/u/5426011/examples16/gemdrop2.capx

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

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

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound