ramones's Recent Forum Activity

  • When you touch soundgreen:

    Event 1 - are you touching soundgreen? - yes - swap them

    Event 2 - are you touching soundred? - yes (you are now) - swap them back

    End result is nothing changes.

    'System: Wait 0 seconds' will postpone the following actions until the end of the event sheet so soundred won't get swapped in before the check for touch on soundred.

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/toggleButton.png" border="0" />

  • Yeah you could use CanvasToLayer. If your canvas size is 640x480 and you want to spawn an object in the middle at 320,240 then you need to convert that canvas position to a layer position. So the position on layer 0 would be:

    CanvasToLayerX(0, 320, 240), CanvasToLayerY(0, 320, 240)

    or in general:

    CanvasToLayerX(0, WindowWidth/2, WindowHeight/2),

    CanvasToLayerY(0, WindowWidth/2, WindowHeight/2)

  • You can use these expression:

    ViewportLeft(layer)

    ViewportRight(layer)

    ViewportTop(layer)

    ViewportBottom(layer)

    ViewportLeft(0) = the left edge of the screen (layer 0)

    Screen width = ViewportRight(0) - ViewportLeft(0)

    Centre X = ViewportLeft(0) + (ViewportRight(0) - ViewportLeft(0)) / 2

    Centre Y = ViewportTop(0) + (ViewportBottom(0) - ViewportTop(0)) / 2

    200 px from the top of the screen = ViewportTop(0) + 200

    etc...

  • You can use the tokenAt(text, index, seperator) expression to split up strings.

    tokenAt("SetLives 10", 0, " ") = "SetLives"

    and

    tokenAt("SetLives 10", 1, " ") = "10"

    So:

    if tokenAt(input.Text, 0, " ") = "SetLives"

    then set lives to int(tokenAt(input.Text, 1, " "))

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • DiabloMovement2.capx (r111)

    I split the movement into separate horizontal and vertical movements so if it gets blocked horizontally it can still move vertically and vice versa.

  • Zero is already in the array (it's all zeroes at the start) so you can only add 51 values (1-51). It keeps looping trying to add 52 values which isn't possible = infinite loop = freeze.

    You could set all array values to -1 first.

    (or you could use values 1-52 instead of 0-51)

    <img src="https://dl.dropbox.com/u/8367729/construct/pics/cardarray.png" border="0" />

  • In an empty array all the values are 0. If your random number is 0 it won't be used because it already exists in the array so you don't have any card where CARD_ID_ORIGINAL = 0.

    And you should 'set value at n to Random_Number', not 'set value at n-1' otherwise the first value will be at -1 and you end up with a duplicate.

  • Mouse - On left button clicked on 'tiles'

    System - tiles.Layername is visible

    It's probably just checking the visibility of the first layer. Try a 'for each tiles' in between those two conditions.

  • Event 9 you set 'red' towards 'enemy'. Which enemy though? You haven't specified so they'll all just move towards the first in the list. You need associate each 'red' with a specific enemy.

    Give 'red' a number instance variable called 'targetUID'.

    When you spawn the 'red', set it's 'targetUID' to 'enemy.UID'

    and then in event 9 instead of every tick have

    system: for each red

    enemy: pick by UID red.targetUID

    ---> red: set angle toward (enemy.x, enemy.y)

  • One way you could do it instead of using those entrypoint sprites, set the player to the door position and then move him forward a bit so he's not overlapping it.

    layoutDoors.capx

  • You can download the latest version: https://www.scirra.com/construct2/releases/r111. Even if you prefer to use stable it's handy to have the beta installed as well for checking other people's examples.

ramones's avatar

ramones

Member since 17 Apr, 2012

Twitter
ramones has 4 followers

Trophy Case

  • 12-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

15/44
How to earn trophies