R0J0hound's Recent Forum Activity

  • str(int(balance))&zeropad(int(balance*100)%100, 2)

  • You can do it with the input system plugin that Zotged linked.

  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?"

  • 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.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound