R0J0hound's Recent Forum Activity

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Objects and instances are the same in Construct as in a programming language.When you add a sprite to a project you are adding a object type and one instance of the sprite to the layout. You can have as many sprite object types as you want but generally I find it easier to make the events for a lower amount of object types.

  • Tokinsom

    The apparent memory leak and performance hit when using the canvas plugin with webgl on is one and the same issue. Unfortunately I can't think of anything that would help it on your end. In theory rewriting in proper webgl support would fix the problem of performance and memory inefficiency. However in the mean time the memory usage can be ignored as the the extra memory will be GC'd as needed.

    As I wrote that I realized some ways you could possibly reduce the memory usage of the canvas object.

    1. Make the canvas invisible. You said it's only used to draw to and then it's image is copied over to a sprite. If the canvas is never drawn then its image never needs to be copied to the gpu so less memory is used.

    2. Use one global canvas and re-use it as needed. Each canvas object uses it's own html5 canvas so it may possibly use less memory if you use only one.

  • Here is a topic with a way to do weighted random:

    http://www.scirra.com/forum/weighted-probabilities_topic48421.html

    With that instead of doing this:

    a7 b2 c1 d0 e0

    You could do this and end up with about the same probabilities but give d and e a slight chance of happening.

    a700 b200 c100 d10 e1 total=1011

    For leveling up just add to the weights.

    You could do it linearly.

    Like add 1 to a, 2 to b, 3 to c...

    After 100 level ups the weights would be:

    a800 b400 c400 d410 e501

    You could also do it quadratically (x^2)

    Add 1 to a, 4 to b, 9 to c, 16 to d...

    After 100 level ups the weights would be:

    a800 b600 c1000 d1610 e2501

  • You can do this with my canvas plugin, here's an example:

    https://dl.dropboxusercontent.com/u/5426011/examples17/perpixel_pointcollision.capx

    More advanced per pixel collision detection can be done with it as well. There are a few capx i made that are scattered around the forum.

  • It will be faster to loop through values in an array. And to be even faster don't invert the whole database. Just invert the values as you retrieve them.

  • Try the canvas plugin, you can do what you want with it's paste object action.

  • The missing conditions are triggers and there can only be one trigger per event. So you'll only see them in events that aren't sub-events of a trigger and don't have a trigger in them already.

  • Try reversing the order of your events.

    Edit... I'm too slow.

  • Quazi's method would work just as fast in C2 except there is no way in C2 to save the result of an effect to use on the next frame.

    Other than that the logic to move the pixels is simple.

    * if the area is free below a pixel is free move it down.

    * if the area is not free try to move down left or down right if those areas are free.

    Here is a demonstration using my canvas plugin. As you can see it is very slow. For this sort of thing you'll want a method a lot faster, but for that you'll have to delve into some javascript.

    https://dl.dropboxusercontent.com/u/5426011/examples17/sand.capx

  • As far as I can tell 8DirMovement just sets the angle to the direction of motion. If you want to control the speed of rotation set the "set angle" property to "no" and make an event like this:

    every tick
    --- sprite: rotate 100*dt degrees toward self.8Direction.MovingAngle

    Just change 100 to whatever speed you want. It's in degrees per second.

  • In relation to the original question there a few examples of softbody physics in this topic:

    http://www.scirra.com/forum/bouncy-jelly-effect_topic47940.html

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound