R0J0hound's Forum Posts

  • You can use the canvas plugin to reference pixels.

    If you're sampling only a few pixels you can use the Canvas.rgbaAt(x,y) expression to get color values like this "rgba(0,0,0,0)", "rgba(255,255,0,1)".

    I also added another expression Canvas.AsJSON which is the entire image in a format that can be loaded into an array with a load action. It is a very quick WIP, so it's not that intuitive. The array size ends up being (1,1,Canvas.Width*Canvas.Height*4).

    To access a pixel use this expression:

    Array.At(0, 0, (y*Canvas.Width + x)*4 + component)

    Where x,y is the pixel position and component is 0 for red, 1 for green, 2 for blue and 3 for alpha. Each component will be a number in the range of 0 to 255.

  • This basically breaks down into moving the items with a "grid movement". So all we need to figure out is how far to move and in what direction. Your picture shows the directions to use. A few events to pick each side of items and set the direction and you're done. You may need a few events for the case of the corners; I handled it by noting the order in which the direction is set. Once you know the direction you set the distance to 160 for horizontal directions and 96 for vertical.

    ex:

    http://dl.dropbox.com/u/5426011/examples14/mgs_inv.capx

    A few other notes:

    *At the end of the grid movement the position is rounded to ensure positions are integers so we can compare them exactly.

    *The grid movement speed is set to the distance to move times two so that all the items will take exactly a half a second to move.

  • Here is one way to do it:

    http://dl.dropbox.com/u/5426011/examples14/format_number.capx

    There are solutions to this very problem elsewhere on the forum but I cant find them.

  • Right, the end result would be the player not moving at all but everything around him would move.

    Here is an old cap that uses the method I described, but has a dead zone of no scrolling:

    http://69.24.73.172/scirra/forum/viewtopic.php?f=8&t=4817

  • Just set the width property of the array to 0 and it should work.

    If the width is 10, as it is by default, you will have to press X 11 times before you pick any object you added by pressing Z.

  • In the array properties is the size 0x1x1. By default the size is 10x1x1.

  • This:

    Set Text to Text.Text + "What?"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • n X Pressed

    Object - Pick instance with UID NewArray.Back

    -Pop back on X axis

    This should work, are you setting up the array with object UIDs?

  • If you measure how much the player moves then you can move everything, including the player, by the same amount in the opposite direction. Another way would be to make the layout unbounded and use the scrollto behavior on the player.

  • an anyone give some practical examples, how to use local vars effectively?

    They are handy for temporarily storing values from one event to another. The key word being "temporary".

    hy is it not possible to assign a default value to some parameter like Sprite.X?he values of the first instance of a sprite is where the initial values come from.

  • You can use the wallclocktime expression to measure the time passed. It's unaffected by the fps.

    global number end_time

    start of layout:

    -set end_time to wallclocktime+30

    end_time <= wallclocktime

    • do stuff
  • C2 r100 added a fix to the platform behavior so it works with vertical moving platforms. The workaround now clashes with the platform behavior so the solution is to remove the workaround.

  • To stop the loss of momentum set the deceleration to 0 when you jump and back to what it was before when you land.

  • It's different in r103 because a bug fix of this issue:

    http://www.scirra.com/forum/top-level-event-bug_topic56490.html?KW=

    As it is now I think it's a very logical behavior as events are evaluated from the top down.

    If you don't want the circle to be clicked you can change the order of the events.