R0J0hound's Forum Posts

  • +----------------------------------+
    | repeat array.width times         | array: set at loopindex to (loopindex+1)%array.width
    +----------------------------------+
    
    global number index2=0
    global number tmp=0
    
    +----------------------------------+
    | repeat 10 times                  | set index2 to int(random(array.width))
    | repeat array.width times         |
    +----------------------------------+
        +------------------------------+
        |index2 <> array.at(loopindex) | set tmp to array.at(index2)
        |loopindex <> array.at(index2) | array: set at index2 to array.at(loopindex)
        |                              | array: set at loopindex to tmp
        +------------------------------+[/code:1bm3id39]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Maybe this?

    PlayerDetect is overlapping at offset ledge at (PlayerDetect.PlayerDirection*8, 0)

    The offset is relative to the player. It's the same as if the object is moved 8 pixels to the left or right before checking for the overlap.

  • You probably could use python to do it. The Sprite.NumVars expression gives the number of private variables and then you can do something like this to loop over all the variables.

    for i in range(Sprite[0].NumVars):

    Sprite.Value(i)

    The trick here is you can access a value by it's index instead of by it's name.

    I don't have time to make a full solution but you can access everything you need from python. Next you'd need to come up with a way to save and load that data to and from the disk. It's not hard just takes a bit of thought.

  • If you put most of your images on another layout the texture will only be loaded when you create an object. Unloading occurs when switching layouts or using the unload textures system action, just as long as there is no created sprites that are using it.

    Another thing to consider is any open layouts in the editor use video memory. You could try closing them before running a preview. Yet another thing that could happen is previous previews didn't close correctly so you'll see temp.exe, temp2.exe... Etc in the task manager. Ending those tasks will free the vram they're using.

  • You could do it like this. It first sets the array so the values don't match the indexes. Then it picks a random index and swaps the values if it doesn't make a value match an index.

    repeat array.width times          | array: set at loopindex to (loopindex+1)%array.width
    
    global number index2=0
    global number tmp=0
    
    repeat 10 times                   |
    repeat array.width times          | set index2 to int(random(array.width))
        index2 <> array.at(loopindex) |
        loopindex <> array.at(index2) | set tmp to array.at(index2)
                                      | array: set at index2 to array.at(loopindex)
                                      | array: set at loopindex to tmp[/code:2p48jvha]
  • Wikipedia gives the equation for the doppler effect. Basically it's to change the frequency of the sound based on the speeds of the source and the listener.

    The speeds need to be relative between the objects. For the source for example:

    ang = angle(source.x,source.y,listener.x,listener.y)

    speedsource = source.velocityX*cos(ang) + source.velocityY*sin(ang)

    The listener speed is about the same but uses it's speed instead and the ang is from the listener to the source.

    The frequency is calculated with:

    (speedofsound + listenerspeed)/(speedofsound + sourcespeed)

    "speedofsound" is something you can tweak, I used something like 3400 to make the effect more subtle.

    Use the frequency to set the playback speed.

    Here's an experiment of it. In it I used positional sound and some volume fade off.

    examples31/doppler.capx

    https://www.dropbox.com/s/sfs9uqb7vy9bo ... .capx?dl=1

  • Use a sprite with the bullet behavior instead of the particles. Use the gravity property to make them fall. For the bouncing use an event like:

    blood: on collision with wall

    --- blood: bounce off wall

    --- blood: set speed to self.speed*0.5

  • Look in the solution properties to see where the csx file is placed. If compiling was successful it put it somewhere.

    Off the top of my head, I seem to recall it placing the compiled file here:

    ../../ide/plugins/template.csx

    You'll probably want to change the file name use, but I forget where exactly. There used to be a guide for this but sourceforge ate it so it's gone.

  • What's happening in your capx is different than what I described. As written that can't happen.

    If it helps replace "Sprite" with the object you want to use as a dash, and replace "mouse" with the object you want to create a trail.

  • I haven't had a chance to look at your file, but if the collision mask is setup for each frame as you say, then check in the sprite's properties to make sure collisions are set to per-pixel instead of bounding box. If it's still colliding with everything then make sure the areas of the mask have an opacity of 0.

  • If you add sprite for the line and set it's origin to the right, and have at least one instance, this would work:

    sprite: picked top instance

    system: compare distance(Mouse.X,Mouse.Y,Sprite.X,Sprite.Y) > 48

    ---system: create sprite at (sprite.x,sprite.y)

    ---sprite: set angle toward (mouse.x, mouse.y)

    ---sprite: move forward 48 pixels

  • The simplest way would be to take an empty dictionary, and put all the values of the array in it. That will remove all duplicates. Next clear the array and push all the keys from the array back in.

  • If you have visual studio installed, you can open the *.sln files. They are solution files. Once in visual studio you can compile it and it will generate the csx file if everything is setup right. There should be a dropdown that you can select the runtime, release, and debug versions of the two. The release is the editor portion of the plugin and runtime is the runtime portion.

  • For straight lines it actually is less points, so it's not a problem. It is also possible to simplify it first is the object count is too high i'd imagine. It may also be possible to change how may points Inkscape saves.

    As far as editors go it seems simple enough to just use Inkscape. At least it would be my preference.

  • Change the "for each obstacle" to "for each obstacle ordered by obstacle.zindex ascending"