R0J0hound's Recent Forum Activity

  • heater19

    Yeah... I agree I left out my my logic for the fix, which makes it not very helpful. So here's my trail of thought:

    Events 5-7 in your original capx only filtered the "Sprite" object. "Sprite2" is unfiltered and only the first instance of "Sprite2" is used in the expressions. "Text" is also not filtered. So it runs like this:

    if "Sprite" is CW from the first "Sprite2" then set all the "Text" objects' text to 'Left'.
    if "Sprite" is CCW from the first "Sprite2" then set all the "Text" objects' text to 'Right'.

    Relevant section of manual: http://www.scirra.com/manual/75/how-events-work

    So there are two problems.

    1. Only the first "Sprite2" is being compared against. Changing "Every tick" to "for each Sprite2" in event 5 fixes that.

    2. All the "Text" objects are getting set to the same value. What is needed is a way to be able to pick the "Text" that's paired with "Sprite2". Unfortunately he pin behavior doesn't cause the pinned objects to be picked, so some other method needs to be used.

    I like using a instance variable to store the UID of another object, so that the paired object can be picked at any time with "pick by UID", but that is not the only solution. You could alternatively use

    Text|Pick nearest to (Sprite2.X, Sprite2.Y)

    or

    System|pick Text instance Sprite2.IID

    and you would avoid the need for an additional variable.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That is an interesting idea. Get a map generator going first. Each room only needs to know in what direction the doors are. For simplicity the doors could always be at the same locations. Then have it pick a random designed room with the same exits.

    Instead of having each designed room on a separate layer, put them on a separate layout, it makes it a bit simpler for designing. In my example the first thing the game does is run each room layout and save each objects position and size into a global array per room. I did this so that I can pick at runtime a room according to the directions of it's exits.

    I didn't do this in my example but having the room data stored in an array makes it easy to implement loading/unloading of rooms all in the same layout, so you can have massive layouts and not have to worry about high object counts bogging down the framerate.

    Here is an implementation of my ideas:

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

    /examples11/rooms2.capx

    The bare minimum amount of rooms is 15, I used 30 so that each possible room has 2 variations.

  • You can check if the game window has focus with python.

    http://dl.dropbox.com/u/5426011/examples11/focus.zip

  • I'll have to test it in linux, and see why it's different.

    Here was the original reason for the script:

    http://www.scirra.com/forum/experimental-cap-to-c2-converter_topic42194.html

    The project is in a coma waiting for C2 to get more features that CC has. At which point I might revive it.

  • Use point filtering and use this action for each object:

    Set position to (round(.X), round(.Y))

    Also round the scroll position:

    Scroll to (round(scrollx), round(scrolly))

  • The link here seems to still work:

    http://www.scirra.com/forum/effect-depixelize_topic43351.html

  • Set the Array size to (Cols+1, Rows+1, 1)

    Otherwise the biggest column and row will be Cols-1 and Rows-1.

    The array's bottom row was lost since Array.At(x,Rows) was outside the array and wasn't saved.

  • A way to do per pixel collisions with physics would be to create a small physics sprite for each collision pixel. I agree this is too tedious to do manually. I used the canvas object to read the pixels of the image, the I made it so only the edge pixels were created to reduce the object count.

    http://dl.dropbox.com/u/5426011/examples11/perpixel.capx

  • Selecting a chain of objects is basically a flood fill.

    http://dl.dropbox.com/u/5426011/examples11/pick_chain.capx

  • You can take advantage of the fact that each object has a unique UID.

    +--------------------------------------------------------+
    |Player | On collision with BulletFamily                 |
    +--------------------------------------------------------+
    |  +-----------------------------------------------------+
    +--|SG_slug    | Pick instance with UID BulletFamily.UID | Player| destroy
    |  +-----------------------------------------------------+
    |  +-----------------------------------------------------+
    +--|AK47_round | Pick instance with UID BulletFamily.UID | Player| change animation to "painfull death"
    |  +-----------------------------------------------------+
    |  +-----------------------------------------------------+
    +--|bb         | Pick instance with UID BulletFamily.UID | Player| laugh
       +-----------------------------------------------------+
  • With the introduction of push and pop the array size can be reduced to 0, but the "set size" action won't let you make the array empty (or 0).

    For instance:

    Array| set size (0,1,1)

    will result in an array of size (1,1,1)

    It can be worked around by doing a pop on the x axis, but it would be nice to remove the restriction that the smallest set size is (1,1,1).

    -cheers