R0J0hound's Forum Posts

  • I think any solution will have a certain level of pain. JavaScript stores numbers as 64bit and in some of it's calculations with integers will use 32bit.

    If you use JavaScript you could use a typed array of multiple 64bit numbers and then use the memory address of that with some asm.js or web assembly that can call a cpu instruction that works on 256bit numbers. However that probably isn't very cross platform.

    Another option is to use a js library like this:

    https://github.com/MikeMcl/bignumber.js/

    But you still have to deal with numbers in a certain way.

    Besides that you probably just need to use multiple numbers or text to store the number.

  • Here's an example of it in action:

    https://dl.dropboxusercontent.com/u/542 ... lists.capx

    Basically look at every pair of lists with two loops like I mentioned above. Families can be used to pick both at once or you can just pick each individually like in the capx. In the capx I copy the list over to an array, and then sort the array. Next if the number of items is the same we can compare each item and see if they're equal, and if they are you can mark those lists as no unique.

  • How do you store and use your lists currently?

  • Put all the arrays you want to compare into two families: listA,listB

    The first step is to compare every two pair of arrays, and check if their sizes are the same. Here's a way to do that:

    for "a" from 0 to listA.count-2

    system: pick instance # loopindex("a") of listA

    for "b" from loopindex("a")+1 to listB.count-1

    system: pick instance # loopindex("b") of listB

    system: compare listA.width = listB.width

    --- sub event

    The sub event is how you compare the values in the two lists. If you sort the lists then it's simple and you can compare each index of each pair of lists. If you don't want the lists' values to be sorted then then you can copy the lists using asJson to two different arrays and sort them first.

  • Solutions include using:

    * The chipmunk physics behavior. This has expressions to get the collision vector (or normal).

    * The raycasting plugin. It doesn't give the collision vector between two shapes but you can use some rays to calculate it.

    * Here are a few other ideas I've used to calculate the collision vector:

  • mrtumbles

    I'm curious, how did you make your assets, and did you go for a low resolution look?

    Also "paster" is a plugin that allows you to draw to it's texture.

  • It doesn't look too bad. Generating the graphics would be the hardest to do. Drawing layer by layer or using a voxel editor are a couple options. Personally I think It would be cool to just slice up textured 3D objects, but I haven't seen a workflow to do that yet.

    The graphics would probably need to be lower resolution to keep the video ram usage low.

    Rendering using multiple instances for every frame isn't so bad. Probably just a matter of zordering everything by frame. The rotation may take a bit of math, but it's not bad either. Animation is just more images and isn't bad, maybe a couple more events.

    Now the paster plugin could be used to cut down on the number of instances needed and the amount of things to be drawn. The static scenery could all be drawn to a paster per layer that way you only have draw those and the moving objects per frame.

    Another plus of using the paster object is all the rotation math isn't needed.

    Besides that the vertical squish can't be done with vanilla C2.

    Collisions would be done in the same way as isometric. Everything is done from a top view.

    I'm not very proficient with shaders but I don't think they would be helpful here because for one you can't access more than one source image in C2.

    A plugin may work, but internally it would be much more complicated to make than with events imo. Not to mention it would be less flexible.

    Reenabling the "front to back" may give some rendering improvement but at the same time the paster plugin wouldn't work with it, but that may be a small loss.

  • Use the wallClockTime expression.

  • kirksl

    I do see your point, but I guess there are always use cases that just don't work with many things.

    Anyways it wouldn't hurt to file a bug report I guess. That way you could get an official response. I do think that the issue was filed before, so maybe a search could find it.

  • You're comparing every pair of numbers and only add to new numbers that don't match.

    So for example if your lists are

    My=1,3,4

    Del=2,4

    Then all you comparisons would be:

    1=2

    1=4

    3=2

    3=4

    4=2

    4=4

    So your readily is:

    New =1,1,3,3,4

    What you want is to to know is if the current number from my list is in the delete list before adding it to new. Here is one way. Hopefully the event nesting is evident.

    For each my_list

    --var save=1

    --for each del_list

    ----if cur_my = cur_del

    ------set save to 0

    --if save=1

    ---- add cur_my to new

    Another way would be to use find() by converting the delete list from:

    1,3,5

    To

    ,1,3,5,

    Then you could do this:

    For each my_list

    --if find(del_list, ","&cur_my&",") = -1

    ---- add cur_my to new

  • Prominent

    I can't open your capx right now but when the animation frame is changed the collision shape is recreated. The only way for it to know if the collision polygons of two different frames are the same is to compare all the points, which may be slower than just recreating it. Also note changing size also causes the collision shape to recreated as well.

    So to the physics engine it's a new shape, so it causes a new collision. I guess a workaround in the plugin would be to modify the collision shape instead of recreating it, but there are many caveats with that, and that's something that's absent from the chipmunk documentation so it's not really something it was designed to do.

    Anyways the solution is to not change the frame on physics objects. If you want to change appearance, use a seperate object.

  • Look at the blend modes template that comes with C2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If the object is going 2000 pixels per second it then moves 2000/60 or 33 pixels in one frame. If the framerate ever goes lower than 60 then the distance moved in a frame will increase.

    Solutions include checking in between positions for collisions, or stretching another Sprite as a line from the old position to the new and check collisions with that. Alternately you could also lower the speed or make the obsticles thicker. If you use the the physics behavior you can check "bullet" collisions for objects to solve the issue internally.

    There have been other topics on this with examples of solutions.

  • zebios

    This was an add-on for the original version of Construct and not Construct 2. As mentioned above it's not possible to make a plugin exactly like this using C2's SDK. For it to be official Scirra would have to make their own version.