ramones's Forum Posts

  • You can use the angle of the wheel to determine which value is at the top.

    For a wheel with 4 segments you can take the angle / 90 and round it down to get a value 0, 1, 2, or 3.

    floor(angle / 90)[/code:3slveguu]
    [code:3slveguu]angle 0-90: floor(angle / 90) = 0
    angle 90-180: floor(angle / 90) = 1
    angle 180-270: floor(angle / 90) = 2
    angle 270-360: floor(angle / 90) = 3[/code:3slveguu]
    
    If you want the wheel to look like this:
    [img="https://dl.dropboxusercontent.com/u/8367729/construct/sprites/wheel/wheel_4_segments.png"]
    Then you need to add 45 degrees to the angle and use modulo 360 to prevent it going above 360.
    [code:3slveguu]floor(((angle + 45) % 360) / 90)[/code:3slveguu]
    
    Generalising that:
    The value 90 is 360 / number of segments
    The value 45 is 360 / number of segments / 2 [b]=[/b] 180 / number of segments
    
    So the formula for a wheel with any number of segments is:
    [code:3slveguu]floor(((angle + (180 / numSegments)) % 360) / (360 / numSegments))[/code:3slveguu]
  • Set the rotate behavior's acceleration to a negative value to make it slow down. And then disable it or set the speed to 0 when the speed is <= 0.

  • Load from WebStorage (on start of layout):

    [attachment=0:2bfo3o0x][/attachment:2bfo3o0x]

    Save to WebStorage (whenever currentLevel is changed):

    [attachment=1:2bfo3o0x][/attachment:2bfo3o0x]

    Why do you want to store that variable?

  • You just need to save the variable to webstorage when it changes and then load it again on start of layout.

    But the currentLevel variable in that capx is just used to track the level you're currently playing so that it knows which values to update when you complete the level. It gets set when you click on a level button to start a level. There's no need to save/load it really.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Select the layout in the projects window and then select the event sheet under 'Layout properties'.

  • I think your main problem is that you haven't set the 'lvl_slct_ly' layout to use the 'lvl_slct_ev' event sheet.

    (And then it would be better to use an array instead of havning a global variable for each level. And use multiple instances of one lock sprite instead of duplicating the same sprite many times.)

  • You're spawning the objects at -256 though, not 0. 774 + 256 isn't a multiple of 9.

  • The export works correctly with minify off. With minify on I get the same result as you

  • You can use a variable to track the current index:

    currentIndex = 0

    set text to array.at(currentIndex )

    when the player presses a button:

    add 1 to currentIndex

    set text to array.at(currentIndex )

  • Are you running C2 as administrator? Windows won't let you drag drop files from a non-admin window into an application running as administrator.

  • When you push/pop/insert/delete you're adding or removing an entire row/col to the array. The value you insert is used as the value for every new element.

    For example, if you have a 2d array:

    0 0
    0 0[/code:1kxxfbo6]
    
    And you push 1 on the X axis: (adds a new column of 1's at the end)
    [code:1kxxfbo6]0 0 1
    0 0 1[/code:1kxxfbo6]
    
    Insert 2 at index 1 on the X axis: (adds a new column of 2's at position 1)
    [code:1kxxfbo6]0 2 0 1
    0 2 0 1[/code:1kxxfbo6]
    
    Insert 3 at index 0 on the Y axis: (adds a row of 3's at row 0)
    [code:1kxxfbo6]3 3 3 3
    0 2 0 1
    0 2 0 1[/code:1kxxfbo6]
  • You need to set the AvailableDirections array global.

    And you might want to set the change the bullet 'Set angle' property to 'No' on PacMan and the Ghosts.

  • Try regenerating the pathfinding obstacle map on start of layout.

  • If you set the physics stepping mode to 'Framerate independent' then you can set the object time scale.